PL/SQL连不上,报 ORA-12170:TNS 连接超时
排错步骤:
1.查看网络是否通畅
打开cmd, ping 数据库IP
2. 查看端口是否通畅
打开cmd,tnsping 数据库IP
如果piing不通,可能是防火墙问题
3.检查防火墙状态
#service iptables status
如果开启,请关闭:#service iptables stop
4.查看监听服务是否开启
$lsnrctl status
如果未开启,执行命令启动监听: lsnrctl start
## tns配置
ORCL =
(DESCRIPTION =
(ADDRESS =(PROTOCOL = TCP)(HOST = 172.20.36.79)(PORT = 1521))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)