ORA-12154:tns:could not resolve the connect identifier specified ...
PL/SQL Developer使用預先配置資料庫報錯 ORA-12154:tns:could not resolve the connect identifier specified。
情況描述:我Orcle客戶端使用的是instantclient_12_2,根路徑為x:\Program Files\instantclient_12_2。安裝後沒有tnsnames.ora文件 ,這個文件的路徑從網上查詢得知是:根路徑+\network\admin\tnsnames.ora。
於是在根目錄下建兩級文件夾。然後用notpad建了tnsnames.ora,把搜到的文件內容粘貼進去。(這一步是個坑)
結果登錄報錯。ORA-12154:tns:could not resolve the connect identifier specified。網上有說環境變數PATH不對的,還有說TNS_ADMIN沒有配置的,試過之後都不行。
最後解決辦法:從同事那要來tnsnames.ora文件替換自己建的文件,改成自己用的資料庫鏈接。神奇的可以用了。
估計是空格或格式問題,時間有限不探究那麼多了,記錄下來警示指導後來人。