Today, I accessed a new Oracle 10 Gb database in the data center. As a result, Oracle SQLl Developer could not connect to the database, and I was dizzy, so I had to check the database and found that TNS was configured, it's okay to log on to the server.
When I was confused, I was reminded that "is the linux firewall blocked ?"
First, use iptables to view the current rule: iptables-L-n, for example:
Only a few ports are allowed to be connected, so enable iptables to open port 1521 to allow this port to be connected:
First:
# Vi/etc/sysconfig/iptables
Join:
-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 1521-j ACCEPT
Save and exit the vi editor. Then:
# Service iptables save
# Service iptables restart
Service iptables save to save the new rule. Otherwise, restart the machine and restore it to its original state.
Then I connected it with SQL Developer. It was a success! Haha.
Check iptables-L-n again. port 1521 has been allowed to be connected by iptables, as shown in the red box section: