TNS-03505: Failed to resolve name的终极解决方法

系统环境:centos7

oracle环境:11G

故障描述: 服务器跑数据死机之后直接进行重启,重启之后各种报错,

本机tnsping oracle ip:端口/实例名    报错TNS-03505: Failed to resolve name,

外部PLSQL连接提示ORA-12170:TNS:连接超时。

具体解决思路如下:

1、检查文件配置信息 listener  和 tnsnames, 确认如下无误即可。此文件配置错误,会直接导致监听服务无法正常开启。

TNS-03505: Failed to resolve name的终极解决方法_第1张图片

TNS-03505: Failed to resolve name的终极解决方法_第2张图片

 

2、开启监听服务 lsnrctl start, 并更新注册

TNS-03505: Failed to resolve name的终极解决方法_第3张图片

Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 

此处提示‘未知’,需要进行注册更新,

3、开启orcl服务,并对注册更新

sqlplus / as sysdba

startup

alter system register;

quit

lsnrctl status

TNS-03505: Failed to resolve name的终极解决方法_第4张图片

TNS-03505: Failed to resolve name的终极解决方法_第5张图片

Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

确认监听状态是 READY 即可
 

4、测试结果

tnsping oracle IP:端口/实例名    测试具体结果,但是显示 TNS-03505 failed to resolve name,确认前面的步骤操作没有问题之后,进行最后步骤,查看防火墙及端口信息

 

5、检查防火墙信息,查看具体的端口信息,并添加对应的端口,确认端口添加之后,重新进行测试,即可正常访问

TNS-03505: Failed to resolve name的终极解决方法_第6张图片

TNS-03505: Failed to resolve name的终极解决方法_第7张图片

TNS-03505: Failed to resolve name的终极解决方法_第8张图片

 

你可能感兴趣的:(TNS-03505: Failed to resolve name的终极解决方法)