Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solve the problem of "ORA-12170: TNS: connection timeout"

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The database can be accessed normally on the virtual machine, but when "ORA-12170:TNS: connection timeout" occurs when connecting to the database on the physical machine, you can use the following ideas to solve the problem.

First, check the network

Check the 1.ping ip address for network problems and see if you can ping it.

If the 2.tnsping ip address (or the server's instance name SID) reports "TNS-12535: operation timed out", it may be a server-side firewall and is not turned off.

3.netstat-na to see if port 1521 is down

4.lsnrctl status lsnrctl is an acronym for listener-control listener to check the status of the listener.

If it is detected that it is a firewall problem, you can turn off the firewall or modify the firewall rules to resolve the problem (currently only access walls are encountered).

II. Firewall issues

2.1 turn off the firewall

Chkconfig iptables off;# fails after restart

/ etc/init.d/iptables stop;# expires 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 with / etc/init.d/iptables status

# in this way, if the machine is rebooted or the firewall is turned off and then on, the rule is invalid.

2) permanently open a port

First, open the firewall configuration file with vim:

Vim / etc/sysconfig/iptables

Then, in the contents of the iptables file, add the following on the line below the default port 22:

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 1521-j ACCEPT

Finally, after saving the configuration file, restart the firewall by executing the following command:

/ etc/init.d/iptables restart

# after testing, add "- A..." to / etc/sysconfig/iptables This content is, add a statement in location 1, restart the firewall, you can connect to the database; add a statement in 2, restart the firewall is still reported "ORA-12170:TNS: connection timeout".

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report