今天做Linux下DG配置的时候,遇到一个现象,tnsname.ora文件配置都正常,tnsping也正常,监听也正常,但是仍然报ORA-12514错误:
SQL> set lin 130 pages 130
SQL> select dest_id,error from v$archive_dest;
---------- -----------------------------------------------------------------
2 ORA-12514: TNS:listener does not currently know of service
requested in connect descriptor
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:31:46
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prd)(PORT=1521)))
Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date 08-OCT-2014 10:34:51
Uptime 0 days 1 hr. 56 min. 54 sec
Security ON: Local OS Authentication
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=prd)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "prd" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
Service "prdXDB" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
Service "prd_XPT" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
The command completed successfully
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
EXTPROC_CONNECTION_DATA =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = std)(PORT = 1521))
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:32:35
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prd)))
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:32:43
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = std)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prd)))
[oracle@std ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:29:52
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=std)(PORT=1521)))
Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date 08-OCT-2014 09:41:41
Uptime 0 days 2 hr. 48 min. 11 sec
Security ON: Local OS Authentication
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=std)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "std" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
Service "std_XPT" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
The command completed successfully
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:39:40
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prd)))
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:39:44
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = std)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prd)))
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(ADDRESS = (PROTOCOL = TCP)(HOST = std)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
[oracle@prd ~]$ lsnrctl reload
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:55:17
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prd)(PORT=1521)))
The command completed successfully
[oracle@prd ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:55:24
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prd)(PORT=1521)))
Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date 08-OCT-2014 10:34:51
Uptime 0 days 2 hr. 20 min. 33 sec
Security ON: Local OS Authentication
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=prd)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "prd" has 2 instance(s).
Instance "prd", status UNKNOWN, has 1 handler(s) for this service...
Instance "prd", status READY, has 1 handler(s) for this service...
Service "prdXDB" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
Service "prd_XPT" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@std ~]$ lsnrctl reload
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:57:15
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=std)(PORT=1521)))
The command completed successfully
[oracle@std ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-OCT-2014 12:57:25
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=std)(PORT=1521)))
Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date 08-OCT-2014 09:41:41
Uptime 0 days 3 hr. 15 min. 44 sec
Security ON: Local OS Authentication
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=std)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "prd" has 1 instance(s).
Instance "prd", status UNKNOWN, has 1 handler(s) for this service...
Service "std" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
Service "std_XPT" has 1 instance(s).
Instance "prd", status READY, has 1 handler(s) for this service...
The command completed successfully