在dos窗口都能登录数据库,但通过PL/SQL登录是老是报 ORA-12541 或12154的错,在Oracl Net Manager 中也配置好了服务器命名和监听程序,查看系统配置文件系统参数文件为D:oracleproduct10.1.0db_1 etworkadminlistener.ora 和 tnsnames.ora 也都对,这个问题浪费了我好大把时间,终于在下面这位大神的介绍中给解决了,其方法是启动listener:
运行->cmd启动dos窗口,执行lsnrctl stop关闭,lsnrctl start启动。重新登录可以了!
外地回来,登录pl/sql出现错误:ORA-12541:TNS:无监听程序。
1. 检查oracleproduct10.1.0db_1NETWORKloglistener.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.
系统参数文件为D:oracleproduct10.1.0db_1 etworkadminlistener.ora
写入D:oracleproduct10.1.0db_1 etworkloglistener.log的日志信息
写入D:oracleproduct10.1.0db_1 etwork racelistener.trc的跟踪信息
跟踪级别当前为0
以 pid=7180 开始
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROCipc)))
监听该对象时出错: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=pc-xxx.mail.yyy.cn)(PORT=1521)))
TNS-12542: TNS: 地址已被占用
TNS-12560: TNS: 协议适配器错误
TNS-00512: 地址已在使用
32-bit Windows Error: 48: Unknown error
不再监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROCipc)))
2. Oracle的listener已经启动。
3. 查看oracleproduct10.1.0db_1NETWORKADMINlistener.ora
#listener.oraNetworkConfigurationFile:D:oracleproduct10.1.0db_1 etworkadminlistener.ora #GeneratedbyOracleconfigurationtools. SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (SID_NAME=PLSExtProc) (ORACLE_HOME=D:oracleproduct10.1.0db_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是计算机名
127.0.0.1也是目前数据库正在用的ip地址。
4. 查看oracleproduct10.1.0db_1NETWORKADMIN nsnames.ora
找到下列语句:
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. 关闭后再启动listener
运行->cmd启动dos窗口,执行lsnrctl stop关闭,lsnrctl start启动。