Oracle 11g RAC客户端使用SCAN IP无法连接问题

Oracle 版本:11.2.0.1.0

客户端:Windows Server 2003/PLSQL Developer


Oracle服务器端的ip设置如下:

##公网ip
192.168.135.201 WIN-2008SERVER1
192.168.135.202 WIN-2008SERVER2


##虚拟ip
192.168.135.211 WIN-2008SERVER1-vip
192.168.135.212 WIN-2008SERVER2-vip


##私网ip
10.168.135.201 WIN-2008SERVER1-pri
10.168.135.202 WIN-2008SERVER2-pri

##SCAN ip
192.168.135.220 scan


两个RAC实例的虚拟ip已经设置为ip地址而不是名称,如下:




客户端PLSQL Developer的tnsnames.ora设置如下:

ORCL = (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.201)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.202)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
      (FAILOVER_MODE =
         (TYPE = select)
         (METHOD = basic)
         (RETRIES = 180)
         (DELAY = 5)
      )
    )


scan =

  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


192.168.135.200 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.200)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

使用PLSQL Developer连接ORCL,没有任何问题。


客户端Windows的hosts文件没有修改之前,使用PLSQL Developer连接Oracle的SCAN ip 192.168.135.200,异常如下:

ORA-12541: TNS: no listener


连接Oracle的SCAN名称scan,异常如下:

ORA-12545: Connect failed because target host or object does not exist


网上有说升级Oracle版本就可以解决的,没有尝试过,不知道可否?

也有说将RAC实例的local_listener修改为虚拟ip就可以的,但是已经是这样了,不知为何?


最后,客户端Windows的hosts文件添加Oracle服务器端的虚拟ip和SCAN ip的设置,重启操作系统之后,使用PLSQL Developer连接Oracle的SCAN名称scan,连接成功!


扩展话题:如果SCAN名称直接设置为ip地址(不知Oracle是否支持?),客户端PLSQL Developer连接的host名称也就可以填写为ip地址了,这样看起来就和连单机Oracle实例很像了。


扩展阅读:

ORA-12541: TNS:no listener ( ERROR coming when one node of RAC database is off

http://www.dbasupport.com/forums/showthread.php?53938-ORA-12541-TNS-no-listener-(-ERROR-coming-when-one-node-of-RAC-database-is-off


java应用连接oracle 11g R2 rac (用scanip连接报错)

http://blog.csdn.net/weiwangsisoftstone/article/details/38535463


11gR2 clients connect to the database using SCANs

http://www.dbatoolz.com/t/11gr2-clients-connect-to-the-database-using-scans.html


scan-ip部分可以连接,部分连接不了

http://t.askmaclean.com/thread-4090-1-1.html


posted @ 2016-03-07 22:36  小龙在线  阅读(9828)  评论(0编辑  收藏  举报