主库alert.log如下:
Tue Nov 4 15:44:46 2008
Errors in file /u01/app/oracle/admin/logstat1/bdump/logstat1_arc0_6272.trc:
ORA-12505: TNS:listener does not currently know of SID given in connect descriptor
PING[ARC0]: Heartbeat failed to connect to standby 'test2'. Error is 12505.
从库alert.log报错如下:
Tue Nov 4 23:46:08 2008
Errors in file /u01/app/oracle/admin/logstat1/bdump/logstat1_mrp0_16454.trc:
ORA-12505: TNS:listener does not currently know of SID given in connect descriptor
经检查发现主从的监听和TNSNAMES.ORA的配置均正确无误.
tnsping均能正确返回.
但在从库中测试连接报错.
SQL> conn sys/oracle@test2 as sysdba
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor
Warning: You are no longer connected to ORACLE.
SQL> exit
监听的状态信息:
LSNRCTL> start
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.204)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.204)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 05-NOV-2008 00:10:28
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.204)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
怀疑是没有正确监听的原因,手动进行注册如下
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 5 00:19:51 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> ALTER SYSTEM REGISTER;
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost admin]$ sqlplus sys/oracle@test2 as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 5 00:19:59 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
仍然没有效果.
最后修改监听器的配置
[oracle@localhost arch]$ vi /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = logstat1)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.204 )(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
增加红色区域后重启监听,问题解决.
这说明还是动态服务器注册的问题.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9375/viewspace-485704/ ,如需转载,请注明出处,否则将追究法律责任。