Oracle案例09——ORA-12154: TNS:could not resolve the connect identifier specified
DG处理的问题还是蛮多的,但这次遇到一个比较奇葩的事情,表面配置、网络都没啥问题,但主备的同步始终有问题,经过多次调整参数、重新部署问题依旧,最终还是求助mos问题得以解决,现将处理过程记录如下:
一、问题现象
偶尔发现一个主备数据库同步有问题,检查备库发现除了无法完成同步,其他无错误信息,检查主库发现错误信息如下:
set line 200;
set pagesize 2000;
select dest_id,status,error from v$archive_dest;
ORA-12154: TNS:could not resolve the connect identifier specified
alert日志内容如下:
Error 12154 received logging on to the standby
trace内容如下:
*** 2018-07-02 09:37:36.230
OCIServerAttach failed -1
.. Detailed OCI error val is 12154 and errmsg is 'ORA-12154: TNS:could not resolve the connect identifier specified
'
OCIServerAttach failed -1
.. Detailed OCI error val is 12154 and errmsg is 'ORA-12154: TNS:could not resolve the connect identifier specified
'
OCIServerAttach failed -1
.. Detailed OCI error val is 12154 and errmsg is 'ORA-12154: TNS:could not resolve the connect identifier specified
'
OCIServerAttach failed -1
.. Detailed OCI error val is 12154 and errmsg is 'ORA-12154: TNS:could not resolve the connect identifier specified
'
*** 2018-07-02 09:37:36.246 4329 krsh.c
Error 12154 received logging on to the standby
二、问题原因
一般遇到ora-12154的错误,首先我们想到的肯定是监听配置和tnsnames.ora配置是否一致,然后看dg的服务名配置是否一致,然后还会检查本地监听(local_listener )是否配置正确,通过上述检查发现都没问题,然后又通过服务名用户名密码连接也没问题。那为什么还是会报服务名无法解析导致归档无法完成的错误呢?
最奇葩的是有些归档是可以传输过去,有些归档是无法传输。这里实在没招了,只能求助mos,在mos上找到了解决方案。(Adding an new Standby fails with error Ora-12154: TNS:could not resolve the connect identifier specified (文档 ID 1240558.1))
Cause 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.
大致意思是说新的tns别名在主库被添加,实例和归档进程都没有被重启,导致归档进程读取的tnsnames.ora还是初始化启动的时候的内容,所以无法识别新的tnsnames.ora配置的服务器名。
三、解决方案
mos提供了3中解决方案,重启主数据库实例、指定归档服务串、重启归档进程,我这里采用的是第三种,重启归档进程
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_<n> 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
通过kill 掉主库的归档进程,然后完成alter system switch logfile ;发现数据库数据同步正常。
四、问题总结
查询从库日志应用情况:
select sequence#,archived,applied from v$archived_log order by sequence#;
改变归档路径:
alter system set LOG_ARCHIVE_DEST_STATE_3=defer scope=both; alter system set LOG_ARCHIVE_DEST_3='SERVICE=dbs ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=dbs' scope=both; alter system set log_archive_dest_1='location=/oracle/oradata/db/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db' scope=both;
Oracle案例09——ORA-12154: TNS:could not resolve the connect identifier specified的更多相关文章
- EF:Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
报告错误:Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifi ...
- plsql developer连接Oracle报错ORA-12154: TNS:could not resolve the connect identifier specified
今日更改Oracle网络配置文件后使用plsql developer 尝试连接到Oracle出现报错 ORA-12154: TNS:could not resolve the connect iden ...
- PL/SQL developer连接oracle出现“ORA-12154:TNS:could not resolve the connect identifier specified”问题的解决
转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/50728536 本文出自[我是干勾鱼的博客] 使用PL/SQL developer ...
- Oracle 10g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决! 我同事遇到的问题。 username/
Oracle 10g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决! 我同事遇到的问题. userna ...
- PLSQL 错误问题:ora-12154:TNS:could not resolve the connect identifier
错误问题: ORA-12154: TNS:could not resolve the connect identifier specified 即无法解析指定的连接,这说明缺少了一个环境变量,TNS_ ...
- PL/SQL- ora-12154 '' TNS:could not resolve the connect identifier specified'
出现如上情况在使用pl/sql连接oracle服务器时很常见,问题出现的方式也很多 最终问题还是pl/sql在读取NETWORK\ADMIN\tnsnames.ora是配置的内容时解析错误 也就是说t ...
- PL/SQL Developer报错 ORA-12154:tns:could not resolve the connect identifier specified
PL/SQL Developer使用预先配置数据库报错 ORA-12154:tns:could not resolve the connect identifier specified. 情况描述:我 ...
- 关于ORA-12154: TNS:could not resolve the connect identifier specified的问题
问题:net configuration assistant测试连接可以连接.但是PLSQL连接不了,报ORA-12154: TNS:could not resolve the connect ide ...
- 在linux上使用impdp命令时提示ORA-12154: TNS:could not resolve the connect identifier specified的问题
今天在一台linux服务器上用impdp命令导入dmp文件时出现了错误: ORA: TNS:could not resolve the connect identifier specified 我使用 ...
随机推荐
- typescript 入门
为什么要使用typescript? 出现拼写错误,可以立即指出错误. 出现模块引入错误,立即指出错误. 出现函数.变量类型错误,立即指出错误. 在react组件中制定好了基本的props和state之 ...
- rabbitmq无用使用guest用户远程连接
最近开始使用rabbitmq,因为不了解,浪费了不少时间,记录如下: 使用场景:服务器(linux)上部署了一个app1模块,该模块向rabbitmq发送消息,我想让这个模块的消息发送到我本地(win ...
- JVM-类加载过程(Java类的生命周期)
什么是类加载 类的加载指的是将类的.class文件中的二进制数据读入到内存中,将其放在运行时数据区的方法区内,然后在堆区创建一个java.lang.Class对象,用来封装类在方法区内的数据结构.类的 ...
- Jmeter创建一个 JMS 主题的测试计划
新建一个 JMS 主题的测试计划 JMS 需要下载一些可选的jar 文件.详细信息请参阅 第一章:新手入门.在本章节,将学习如何创建测试计划来测试JMS提供程序.创建5个订阅者和1个发布者.创建2个线 ...
- 深度学习(十五) TextCNN理解
以下是阅读TextCNN后的理解 步骤: 1.先对句子进行分词,一般使用“jieba”库进行分词. 2.在原文中,用了6个卷积核对原词向量矩阵进行卷积. 3.6个卷积核大小:2个4*6.2个3*6和2 ...
- [转]Hadoop集群_WordCount运行详解--MapReduce编程模型
Hadoop集群_WordCount运行详解--MapReduce编程模型 下面这篇文章写得非常好,有利于初学mapreduce的入门 http://www.nosqldb.cn/1369099810 ...
- 请别再拿“String s = new String("xyz");创建了多少个String实例”来面试了吧---转
http://www.iteye.com/topic/774673 羞愧呀,不知道多少人干过,我也干过,面壁去! 这帖是用来回复高级语言虚拟机圈子里的一个问题,一道Java笔试题的. 本来因为见得太多 ...
- 再回首:object是什么
前言 这里说得object是C#语言中的类型object,也是Framework中的System.Object(两者是一个意思).如其名“面向对象编程”对象就是Object.既然提到面向对象,自然就想 ...
- unity多线程
多线程概念 多线程,是指实现多个线程并发执行的技术,合理利用多线程可以提升程序的性能,在unity中,一般是避免使用多线程的,unity对多线程的支持并不友好. 协程概念 协程,是指在主线程运行时开启 ...
- JS Date函数在safari中的问题
问题描述:在做Web的时候,在PC上用Chrome调试成功,但是在safari一测就出现了问题.经过debug发现是日期相关出现问题.查阅一些资料后发现,safari中对于JavaScript的Dat ...