ORA-12154: TNS:could not resolve the connect identifier specified
搭建DG时,采用热备份方式进行部署,参数文件等等配置完成后,在主库开启热备份,将数据文件拷贝到备库,备库recover恢复时,
查看select error,destination from v$archive_dest;出现此报错
ORA-12154: TNS:could not resolve the connect identifier specified
排查方向:
检查/etc/hosts文件
检查主备库的监听问题
tnsname.ora书写问题
并使用tnsping 以及 网络直连测试tnsname配置的正确性
以上均没有问题
最终定位到log_archive_dest_2参数配置
log_archive_dest_2='service=stddb valid_for=(online_logfiles,primary_role) db_unique_name=stddb'
该参数定义了远程redo的发送地。
发现该参数service=xxx 的内容是备库的service_name
service后面接的内容应该是tnsname而不是备库的service_name,此处发现问题,修改后故障解决。