问题:12C 客户端:连接 ORACLE 出现 "TNS-12535: TNS: 操作超时"
tnsping 192.168.0.230 报错: ORACLE 出现 "TNS-12535: TNS: 操作超时"
搞了两天才搞懂明白,哈哈;写一下;
第一步: DOS 窗口:ping 192.168.0.230 ,可以PING 通;没有问题可以连上服务器;
第二步: 检查服务器是否开监听
[oracle@ora12c ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-AUG-2019 21:50:14
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora12c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 01-JUL-2019 15:39:25
Uptime 38 days 6 hr. 10 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oradb/app/oracle/product/12.2.0.1/db_1/network/admin/listener.ora
Listener Log File /oradb/app/oracle/diag/tnslsnr/ora12c/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora12c)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=ora12c)(PORT=5500))(Security=(my_wallet_directory=/oradb/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora12c ~]$
第三步: 检查防火墙;
1,关闭防火墙,
[root@ora12c ~]# service iptables stop
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
提示请用 /bin/systemctl stop iptables.service 关闭防火墙;不要用service iptables stop
RHEL 7 中防火墙由firewalld来管理,
如果要添加范围例外端口 如 1000-2000
语法命令如下:启用区域端口和协议组合
firewall-cmd [--zone=<zone>] --add-port=<port>[-<port>]/<protocol> [--timeout=<seconds>]
此举将启用端口和协议的组合。端口可以是一个单独的端口 <port> 或者是一个端口范围 <port>-<port> 。协议可以是 tcp 或 udp。
实际命令如下:
添加
[root@ora12c ~]# firewall-cmd --zone=public --add-port=1521/tcp --permanent
success
重新载入
[root@ora12c ~]# firewall-cmd --reload
success
查看
[root@ora12c ~]# firewall-cmd --zone=public --query-port=1521/tcp
yes
在去:DOS 下 执行: tnsping 192.168.0.230 就可以PING通了;