全部博文(41)
分类: Oracle
2011-12-05 11:03:51
搭建了2套oracle环境在进行dg测试的时候,启动从库和监听,然后从主库连接从库,居然提示ORA-12514: TNS:listener does not currently know of service requested in connect
Descriptor
tnsping没问题,怎么回事呢?
原因:
监听刚启动时候,动态注册还没完成,需要一个时间,这个时候状态如下:
$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 16-APR-2010 00:39:18
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/oracle/product/10.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /u01/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 16-APR-2010 00:39:18
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
Services Summary...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
-bash-3.2$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 16-APR-2010 00:39:22
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 16-APR-2010 00:39:18
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
Services Summary...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
可以发现并没有STANDBY的监听出现,这个时候在其他机器可以tnsping通
-bash-3.2$ tnsping standby
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 16-APR-2010 00:51:19
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/u01/oracle/product/10.2.0/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = STANDBY)))
OK (0 msec)
-bash-3.2$ sqlplus system/welcome@standby
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 16 00:51:21 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
这个时候我们需要手动注册下或者等待一会儿系统会自动注册
SQL> alter system register;
System altered.
-bash-3.2$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 16-APR-2010 00:52:48
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 16-APR-2010 00:52:25
Uptime 0 days 0 hr. 0 min. 22 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
Services Summary...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "standby", status READY, has 1 handler(s) for this service...
Service "standby" has 1 instance(s).
Instance "standby", status READY, has 1 handler(s) for this service...
Service "standby_XPT" has 1 instance(s).
Instance "standby", status READY, has 1 handler(s) for this service...
The command completed successfully
-bash-3.2$