手机版
你好,游客 登录 注册
背景:
阅读新闻

配置静态监听解决ORA-12514错误的案例

[日期:2014-10-08] 来源:Linux社区  作者:aaron8219 [字体:大 中 小]
今天做Linux下DG配置的时候,遇到一个现象,tnsname.ora文件配置都正常,tnsping也正常,监听也正常,但是仍然报ORA-12514错误:
 
SQL> set lin 130 pages 130 
SQL> select dest_id,error from v$archive_dest;
 
   DEST_ID ERROR
---------- -----------------------------------------------------------------
         1
         2 ORA-12514: TNS:listener does not currently know of service
           requested in connect descriptor
 
         3
         4
         5
         6
         7
         8
         9
        10
 
--查看主库监听
SQL> !lsnrctl status
 
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)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
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
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=prd)(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...
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文件内容
# 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 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )
 
PRD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prd)
    )
  )
 
STD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = std)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prd)
    )
  )
 
--主库tnsping测试网络服务名是否正常
SQL> !tnsping prd
 
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 parameter files:
 
 
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)))
OK (10 msec)
 
SQL> !tnsping std
 
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 parameter files:
 
 
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)))
OK (20 msec)
 
--查看备库监听
[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)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
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
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=std)(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...
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
 
--查看备库远程归档路径
SQL> set lin 130 pages 130 
SQL> col error for a20
SQL> select dest_id,error,status from v$archive_dest;
 
   DEST_ID ERROR                STATUS
---------- -------------------- ---------
         1                      VALID
         2                      VALID
         3                      INACTIVE
         4                      INACTIVE
         5                      INACTIVE
         6                      INACTIVE
         7                      INACTIVE
         8                      INACTIVE
         9                      INACTIVE
        10                      INACTIVE
        11                      VALID
 
--备库tnsping测试网络服务器名是否正常
SQL> !tnsping prd
 
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 parameter files:
 
 
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)))
OK (20 msec)
 
SQL> !tnsping std
 
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 parameter files:
 
 
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)))
OK (10 msec)
 
tnsping测试下来也都是通的,这就比较奇怪了,但是ORA-12514错误很明显是指监听方面的问题,导致服务名无法解析,由于主备库采用的是同一个实例名,因此两边的instance_name用的都是prd,乍一看好像很正常,但是解析确实出现了问题,那么怎么办呢? 

Oracle数据库监听非常慢,基本hang住故障处理 http://www.linuxidc.com/Linux/2014-08/104942.htm

Oracle监听之动态监听与静态监听特点 http://www.linuxidc.com/Linux/2013-09/89702.htm

Oracle 11g RAC 环境下单实例非缺省监听及端口配置 http://www.linuxidc.com/Linux/2013-08/88936.htm

Oracle 监听器日志配置与管理 http://www.linuxidc.com/Linux/2013-08/88935.htm

Oracle错误- ORA-12514:TNS:无监听程序 http://www.linuxidc.com/Linux/2013-06/85878.htm

ORA-12514 监听错误解决 http://www.linuxidc.com/Linux/2012-12/76049.htm

Oracle监听器出现的6种连接问题及其解决方法 http://www.linuxidc.com/Linux/2012-12/75568.htm

Oracle LISTENER 未监听到Oracle实例问题解决 http://www.linuxidc.com/Linux/2012-05/60910.htm

设置 Oracle 监听器密码(LISTENER) http://www.linuxidc.com/Linux/2011-07/39421.htm

更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-10/107760p2.htm

linux
相关资讯       ORA-12514 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款