TNS-12543: TNS:destination host unreachable
Ex: I am trying to ping standby database from primary, got the following error.
[oracle@localhost ~]$ tnsping stdby
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2017 05:22 :39
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.92.129)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = stdby)))
TNS-12543: TNS:destination host unreachable
Possible issues:
1. First step to trace this error is to test the host reachability using hostname/IP ping on OS level.
> ping IP/hostname
I am able to ping here, host is reachable, if we get issue here, we need to contact network admin.
2. Second step is to check listener is running in the remote host to where your are trying to ping, in this scenario remote server is standby.
>lsnrctl status
If listener is not running, just start the listener and check tnsping. In this scenario my listener in standby is running fine, but still i am getting TNS-12543, host unreachable.
3. Third step is to check is SElinux settings, SELINUX should be always disabled as below.
[oracle@localhost ~]$ cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
If above setting is showing enforcing, then you need to login as root edit the file /etc/selinux/config and reboot the server.
In my case its disabled, but still issue is not resolved.
4. Now i check the firewall, firewall should be always disabled. use the below steps to disable firewall.
[oracle@localhost ~]$ systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-05-22 04:23:33 EDT; 1h 1min ago
Main PID: 604 (firewalld)
CGroup: /system.slice/firewalld.service
ââ604 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
In my care firewall is the issue, i disabled as follows, issue got resolved.
[oracle@localhost ~]$ su -
Password:
Last login: Mon May 22 04:12:57 EDT 2017 on pts/2
[root@localhost ~]# systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-05-22 04:23:33 EDT; 1h 1min ago
Main PID: 604 (firewalld)
CGroup: /system.slice/firewalld.service
ââ604 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
May 22 04:22:55 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
May 22 04:23:33 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost ~]# systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
May 22 04:22:55 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
May 22 04:23:33 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
May 22 05:25:42 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
May 22 05:25:43 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost ~]# exit
logout
[oracle@localhost ~]$ tnsping stdby
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2017 05:26:57
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.92.129)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = stdby)))
OK (0 msec)
[oracle@localhost ~]$
Ex: I am trying to ping standby database from primary, got the following error.
[oracle@localhost ~]$ tnsping stdby
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2017 05:22 :39
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.92.129)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = stdby)))
TNS-12543: TNS:destination host unreachable
Possible issues:
1. First step to trace this error is to test the host reachability using hostname/IP ping on OS level.
> ping IP/hostname
I am able to ping here, host is reachable, if we get issue here, we need to contact network admin.
2. Second step is to check listener is running in the remote host to where your are trying to ping, in this scenario remote server is standby.
>lsnrctl status
If listener is not running, just start the listener and check tnsping. In this scenario my listener in standby is running fine, but still i am getting TNS-12543, host unreachable.
3. Third step is to check is SElinux settings, SELINUX should be always disabled as below.
[oracle@localhost ~]$ cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
If above setting is showing enforcing, then you need to login as root edit the file /etc/selinux/config and reboot the server.
In my case its disabled, but still issue is not resolved.
4. Now i check the firewall, firewall should be always disabled. use the below steps to disable firewall.
[oracle@localhost ~]$ systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-05-22 04:23:33 EDT; 1h 1min ago
Main PID: 604 (firewalld)
CGroup: /system.slice/firewalld.service
ââ604 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
In my care firewall is the issue, i disabled as follows, issue got resolved.
[oracle@localhost ~]$ su -
Password:
Last login: Mon May 22 04:12:57 EDT 2017 on pts/2
[root@localhost ~]# systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-05-22 04:23:33 EDT; 1h 1min ago
Main PID: 604 (firewalld)
CGroup: /system.slice/firewalld.service
ââ604 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
May 22 04:22:55 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
May 22 04:23:33 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost ~]# systemctl status firewalld
â firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
May 22 04:22:55 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
May 22 04:23:33 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
May 22 05:25:42 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
May 22 05:25:43 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost ~]# exit
logout
[oracle@localhost ~]$ tnsping stdby
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2017 05:26:57
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.92.129)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = stdby)))
OK (0 msec)
[oracle@localhost ~]$
thanks a lot, the firewall daemon was the culprit
ReplyDeleteThanks Ramesh .. it is very useful document..
ReplyDeleteThis helped realy !!!
ReplyDeletevery useful Document, thank you very much Ramesh
ReplyDeleteHi I have checked all the above and still the issue persists. Please help
ReplyDeleteThanks Ramesh it was worth.
ReplyDeleteGreat article, very methodical, helped me immensely with the firewall
ReplyDeleteThanks Ramesh.. Very good document..
ReplyDeleteThanks a lot Ramesh very good doc..help me to resolve long pending issue.
ReplyDeleteWe still stuck after all those step as mentioned abkve
ReplyDeletewhat is the error you are getting, copy the tnsping result and listener status result
DeleteThis is very useful document. thank you so much.
ReplyDeleteThis is a complete solution. Thanks for your nice contribution.
ReplyDeleteThanks awesome doc. After disabling firewall I worked
ReplyDeletethank you very much buddy. Such a detailed explanation
ReplyDeleteReally helped a lot.. thank you
ReplyDeleteThis is the best troubleshooting ever.
ReplyDeleteVery helpful. Thanks
Thanks...It is very useful document.
ReplyDeleteThank you so much for the solution
ReplyDeleteThanks you so much.
ReplyDelete