今天在Linux 下配置了一个ORACLE 11G 
这是Linux服务端的监听状态
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 27-NOV-2012 20:59:20
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                27-NOV-2012 20:53:09
Uptime                    0 days 0 hr. 6 min. 11 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/dbserver1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl_db" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcldbXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully之后我在客户段Windows 平台下配置tnsnames.ora
orcl_db =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.200)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME =ORCL_DB)
    )
  )
之后用PLSQL 去连接 
username=sysrman
passd=sysrman
serv_name=orcl_db
就报错 ORA-12560

解决方案 »

  1.   

    Linux 下 端口 1521 是否已经打开
      

  2.   

    listener.ora
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver1)(PORT=1521)))
    host 为 主机名
    tnsnames.ora
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.200)(PORT = 1521))
      host 为 ip 地址=========================================================================listener.ora 可以改成 ip 地址。或者系统 hosts文件中添加一行192.168.100.200  dbserver1
      

  3.   

    linux的版本?
    [root@Asiaunx oracle]# vi /etc/sysconfig/iptables
    [root@Asiaunx oracle]# vi /etc/sysconfig/ip6tables
    在里面规则添加
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
    [root@Asiaunx oracle]# service iptables restart
    iptables:应用防火墙规则:                                 [确定]
    [root@Asiaunx oracle]# service ip6tables restart
    ip6tables:应用防火墙规则:                                [确定]windows的cmd下telnet下1521是否通再说其他的。
      

  4.   

    netstat -an
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address               Foreign Address             State      
    tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:39715               0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:877                 0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      
    tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      
    tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      
    tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      
    tcp        0      0 192.168.100.200:49290       192.168.100.200:1521        ESTABLISHED 
    tcp       86      0 192.168.100.200:53890       192.168.97.109:21           CLOSE_WAIT  
    tcp        0      0 192.168.100.200:1521        192.168.100.200:49290       ESTABLISHED 
      

  5.   

    修改listener.ora
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver1)(PORT=1521)))后
    listener.ora
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.200)(PORT=1521)))
    依然还是报老错误