在安裝Oracle數(shù)據(jù)庫(kù)的過(guò)程中出了一系列問(wèn)題,當(dāng)終于排除艱難萬(wàn)險(xiǎn)把數(shù)據(jù)庫(kù)裝上的時(shí)候,一個(gè)和數(shù)據(jù)庫(kù)連接的小軟件又出現(xiàn)了錯(cuò)誤,PL/SQL Developer,一連接就會(huì)出現(xiàn)ora-12541:TNS:無(wú)監(jiān)聽(tīng)程序,真是被搞得頭大,于是在網(wǎng)上找了找大牛們的解決辦法,記錄一下,避免以后犯錯(cuò)。
1. 檢查Oracle/product/10.1.0/db_1/NETWORK/log/listener.log:-
TNSLSNR for 32-bit Windows: Version 10.1.0.2.0 - Production on 04-1月 -2010 13:38:34
Copyright (c) 1991, 2004, Oracle. All rights reserved.
系統(tǒng)參數(shù)文件為D:/Oracle/product/10.1.0/db_1/network/admin/listener.ora
寫入D:/Oracle/product/10.1.0/db_1/network/log/listener.log的日志信息
寫入D:/Oracle/product/10.1.0/db_1/network/trace/listener.trc的跟蹤信息
跟蹤級(jí)別當(dāng)前為0
以 pid=7180 開始
監(jiān)聽(tīng): (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROCipc)))
監(jiān)聽(tīng)該對(duì)象時(shí)出錯(cuò): (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=pc-xxx.mail.yyy.cn)(PORT=1521)))
TNS-12542: TNS: 地址已被占用
TNS-12560: TNS: 協(xié)議適配器錯(cuò)誤
TNS-00512: 地址已在使用
32-bit Windows Error: 48: Unknown error
不再監(jiān)聽(tīng): (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROCipc)))
2. Oracle的listener已經(jīng)啟動(dòng)。
3. 查看Oracle/product/10.1.0/db_1/NETWORK/ADMIN/listener.ora
# listener.ora Network Configuration File: D:/Oracle/product/10.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(Oracle_HOME = D:/oracle/product/10.1.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = pc-xxx.mail.yyy.cn)(PORT = 1521))
)
)
)
把(ADDRESS = (PROTOCOL = TCP)(HOST = pc-xxx.mail.yyy.cn)(PORT = 1521))
改為(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
pc-xxx.mail.yyy.cn是計(jì)算機(jī)名
127.0.0.1也就是目前數(shù)據(jù)庫(kù)正在用的ip地址。
4. 查看Oracle/product/10.1.0/db_1/NETWORK/ADMIN/tnsnames.ora
找到下列語(yǔ)句:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = pc-xxx.mail.yyy.cn)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
將(ADDRESS = (PROTOCOL = TCP)(HOST = pc-xxx.mail.yyy.cn)(PORT = 1521))
改為(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
5. 關(guān)閉后再啟動(dòng)listener
運(yùn)行->cmd啟動(dòng)dos窗口,執(zhí)行l(wèi)snrctl stop關(guān)閉,lsnrctl start啟動(dòng)。
然后再重新利用PL/SQL Developer登錄,就OK了。
這個(gè)是從網(wǎng)上看人家的解決方法,我也試了,并且成功了,但是當(dāng)我再次打開listener.ora時(shí)候,發(fā)現(xiàn)127.0.0.1又變成原來(lái)的樣子,因此我懷疑可能是因?yàn)橹貑⒘朔⻊?wù)就可以了,所以以后有的童鞋也遇到這個(gè)問(wèn)題了,不妨先重啟下服務(wù)試下,如果不行,再試這個(gè)不遲。
本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|