1. 首页
  2. IT资讯

11.2.0.1配置DATAGUARD遭遇ORA-12514

今天同事配置了一套DATAGUARD但是配置好后备库没有RFS进程,查看日志报错

Error 12154 connecting to destination LOG_ARCHIVE_DEST_2 standby host ‘bossdbd’
Error 12154 attaching to destination LOG_ARCHIVE_DEST_2 standby host ‘bossdbd’
ORA-12154: TNS:could not resolve the connect identifier specified 
既然是报12154那么一般说明是TNSNAMES.ORA里面的配置不对的。但是奇怪的是,我使用
sqlplus sys/***@bossdbd 连接备库是没有问题。这就说明TNSNAMES.ORA配置没有问题。
考虑到11.2.0.1是比较低的版本,以前配置11.2.0.3并没有这个问题,可能是BUG。随机查询文档,在MOS上查到如下:

Adding an new Standby fails with error Ora-12154: TNS:could not resolve the connect identifier specified (文档 ID 1240558.1)
Oracle Database – Enterprise Edition – Version 9.0.1.0 to 11.2.0.1 [Release 9.0.1 to 11.2]

After adding a new standby database, a corresponding new TNS alias entry was added to the tnsnames.ora on the primary node, but neither the instance nor the archiver processes were restarted.

The ARC processes read the tnsnames.ora only once during process initialization, any updates to the tnsnames.ora after startup will not be known to the ARC process and hence the error
ORA-12154: TNS:could not resolve the connect identifier specified
is reported when the ARC processes try to resolve the (new) value for the ‘service’ attribute.

解决方法如下:

1. Shutdown and restart the primary database instance.

This will cause a (short) outage of the primary database and may not be feasible for this reason.

2. Use a connect descriptor for the ‘service’ parameter.

Instead of using a TNS alias for the service parameter (which requires a lookup of the tnsnames.ora file) one can use the connect descriptor itself.

Assume the following (new) entry in the tnsnames.ora on the primary node:

REMOTE_DEST_NEW = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standbynode)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = STDBY) ) ) 

The corresponding ‘alter system’ command would then be:

alter system set log_archive_dest_2 = ‘service=”(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=standbynode)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=STDBY)))”‘ ;

Please note that there’s a length limit for the log_archive_dest_ parameter, so this will only work if the length of the connect string plus the length of other attributes specified does not exceed this limit.

3. Kill the ARC processes of the primary instance.

With RDBMS releases <= 9.2 it was possible to stop and restart the archiver processes by issuing 'archive log stop' followed by 'archive log start'.
However these commands are no longer valid with 10g and above, so to cause a respawn of the archiver processes they must be killed, they will be restarted immediately by the instance.

This solution requires due care to avoid accidentally killing other vital background processes.

The following script (ksh,bash) may assist in identifying the correct ARC processes that need to be killed:

ps -ef|egrep "ora_arc.*_${ORACLE_SID}"|grep -v grep |while read user pid junk  do   echo "kill -9 $pid"  done

记录一下。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7728585/viewspace-1310967/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:深沉的少年,转转请注明出处:http://www.cxybcw.com/183368.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code