oracle ORA-12543

来源:互联网 发布:python 嵌套字典赋值 编辑:程序博客网 时间:2024/05/19 14:00

Oracle 网络连接配置

1. 检查监听注册参数

SQL>show parameter local_listener

SQL> show parameter local_lis

NAME                                      TYPE                     VALUE
------------------------------------ ----------- ------------------------------
local_listener                          string     (DESCRIPTION=(ADDRESS=(PROTOCO
                                                             L=tcp)(HOST=192.168.1.122)(POR
                                                             T=1521)))



2. 查看监听状态

$listener status

[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 09-OCT-2017 02:37:49
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.122)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                09-OCT-2017 02:13:31
Uptime                    0 days 0 hr. 24 min. 18 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.122)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully



3. 检查客户端与服务器是否能ping通

ping  192.168.1.122

[oracle@localhost ~]$ ping 192.168.1.122
PING 192.168.1.124 (192.168.1.122) 56(84) bytes of data.
64 bytes from 192.168.1.122: icmp_seq=1 ttl=64 time=1.67 ms
64 bytes from 192.168.1.122: icmp_seq=2 ttl=64 time=0.638 ms

ping  192.168.1.124

[oracle@localhost ~]$ ping 192.168.1.124
PING 192.168.1.124 (192.168.1.124) 56(84) bytes of data.
64 bytes from 192.168.1.124: icmp_seq=1 ttl=64 time=1.67 ms
64 bytes from 192.168.1.124: icmp_seq=2 ttl=64 time=0.638 ms



4.在以上步骤都没有错误的情况下,客户端使用命令连接到服务器端

sqlplus  scott/tiger@192.168.1.122:1521/orcl as sysdba

报错:

ORA -12543:TNS :destination host unreachable


出错原因:

1521端口没有开放

解决办法:

vi /etc/sysconfig/iptables

-----------------------------------------------------------------------------------------

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

------------------------------------------------------------------------------------------

重启防火墙

# /etc/init.d/iptables restart


解决方法2:iptables -F   //关闭防火墙