問(wèn)題提示
錯(cuò)誤提示:ERROR:ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
解決方法:
代碼如下:
1. 打開(kāi)/network/admin/listener.ora文件,找到:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:oracleproduct10.1.0db_1)
(PROGRAM = extproc)
)
)
2. 添加:
代碼如下:
(SID_DESC =
(GLOBAL_DBNAME = ORACLE)
(ORACLE_HOME = D:oracleproduct10.1.0db_1)
(SID_NAME = ORACLE)
)
3. 最后變成:
代碼如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:oracleproduct10.1.0db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORACLE)
(ORACLE_HOME = D:oracleproduct10.1.0db_1)
(SID_NAME = ORACLE)
)
)
4. 保存文件,重啟服務(wù)中的TNSListener,OK!
注意,一定要重啟TNSListener,
方法:命令模式
代碼如下:
C:>lsnrctl
LSNRCTL>stop
LSNRCTL>start
搞定,好使了.
另一種出一這種問(wèn)題的情況是:Ora-12514:TNS:無(wú)監(jiān)聽(tīng)程序
解決辦法:TNSListener服務(wù)沒(méi)有啟動(dòng),把服務(wù)啟動(dòng)就可以了。
通常的名字:OracleOraDb10g_home1TNSListener:
該服務(wù)對(duì)應(yīng) %Oracle_HoembinTNSLSNR.EXE
Ora-12514:TNS:監(jiān)聽(tīng)程序當(dāng)前無(wú)法識(shí)別鏈接描述符中請(qǐng)求的服務(wù)。
對(duì)于這個(gè)錯(cuò)誤,網(wǎng)上的做法通常是這樣的:
打開(kāi):%Oracle_Hoem%/network/admin/listener.ora文件
在
代碼如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:OracleOracle10g)
(PROGRAM = extproc)
)
后面添加:
代碼如下:
(SID_DESC =
(GLOBAL_DBNAME = ORACLE)
(ORACLE_HOME = D:OracleOracle10g)
(SID_NAME = ORACLE)
)
最后變成:
代碼如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:OracleOracle10g)
(PROGRAM = extproc)
) (SID_DESC =
(GLOBAL_DBNAME = ORACLE)
(ORACLE_HOME = D:OracleOracle10g)
(SID_NAME = ORACLE)
)
)
不過(guò)我覺(jué)得不用這么費(fèi)力。首先關(guān)閉監(jiān)聽(tīng)器服務(wù),然后關(guān)閉數(shù)據(jù)庫(kù)服務(wù),啟動(dòng)數(shù)據(jù)庫(kù)服務(wù),啟動(dòng)監(jiān)聽(tīng)器服務(wù)。就是這么簡(jiǎn)單。
更多信息請(qǐng)查看IT技術(shù)專欄