ORA-12170: TNS: Connection timeout problem solved

Source: Internet
Author: User

ORA-12170: TNS: Connection timeout problem solved

The virtual machine can access the database normally, but the physical machine connection to the database appeared "ORA-12170: TNS: Connection timeout", you can solve the problem with the following ideas.
I. Check the network
1. ping the IP address to view network problems and check whether the ping is successful;
2. tnsping IP address (or server instance name SID) If "TNS-12535: Operation timeout" is reported, it may be the server-side firewall, not disabled;
3. Check whether port 1521 is disabled in netstat-na.
4. lsnrctl status lsnrctl is the abbreviation of listener-control listener. You can view the status of the listener.
If the problem is caused by a firewall, you can disable the firewall or modify the firewall rules to solve the problem (currently, only access to the wall is encountered ).
Ii. Firewall Problems
2.1 disable Firewall
Chkconfig iptables off; # failure after restart
/Etc/init. d/iptables stop; # expire immediately

2.2 modify firewall rules
1) open the port directly.
Iptables-I INPUT-p tcp -- dport 1521-j ACCEPT; #1521 is the port number;
# If you want to delete a rule, use iptables-d input number;
# Number can be viewed using/etc/init. d/iptables status
# If this method is used, the rule is invalid when the machine is restarted or the firewall is disabled.
2) permanently open a port
First, use vim to open the firewall configuration file:
Vim/etc/sysconfig/iptables
Then, add the following content in the content of the iptables file under the default port 22:
-A input-m state -- state NEW-m tcp-p tcp -- dport 1521-j ACCEPT
Finally, save the configuration file and run the following command to restart the Firewall:
/Etc/init. d/iptables restart
# After testing, add "-A…" to/etc/sysconfig/iptables ......" This content is, in position 1 add statement, after restarting the firewall can connect to the database; in 2 add statement, after restarting the firewall is still reported "ORA-12170: TNS: Connection timeout ".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.