日期:2014-05-16  浏览次数:20544 次

跨NAT,防火墙(firewall)的RAC监听配置(ORA-12545)

    对于存在NAT或防火墙的RAC数据库,在启用了服务器端的load balance后,经常会碰到ORA-12545连接错误,这是因为服务器端转发客户端连接请求到其它节点后,客户端使用返回的IP再次发出连接请求而出现不可识别的IP地址或主机名而造成的。本文描述了这个问题并给出了解决方案。

  有关RAC监听配置请参考
    ORACLE RAC 监听配置 (listener.ora tnsnames.ora)
    ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)

 

一、NAT下监听描述图

   


二、配置情况

1、服务器端的配置情况
 ################Server node 1 listener.ora########################
 LISTENER_VMDB01P =
   (DESCRIPTION_LIST =
     (DESCRIPTION =
       (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb01pvip)(PORT = 1314)(IP = FIRST))
       (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb01p)(PORT = 1314)(IP = FIRST))
     )
   )
 
 SID_LIST_LISTENER_VMDB01P =
   (SID_LIST =
     (SID_DESC =
       (SID_NAME = PLSExtProc)
       (ORACLE_HOME = /u01/oracle/db)
       (PROGRAM = extproc)
     )
   )
 
 ################Server node 2 listener.ora########################
 LISTENER_VMDB02P =
   (DESCRIPTION_LIST =
     (DESCRIPTION =
       (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb02pvip)(PORT = 1314)(IP = FIRST))
       (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb02p)(PORT = 1314)(IP = FIRST))
     )
   )
 
 SID_LIST_LISTENER_VMDB02P =
   (SID_LIST =
     (SID_DESC =
       (SID_NAME = PLSExtProc)
       (ORACLE_HOME = /u01/oracle/db)
       (PROGRAM = extproc)
     )
   )
 
 ################Server side tnsnames.ora, same for both nodes########################
 remote_lsnr_lm5330 =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb01pvip)(PORT = 1314))
     (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb02pvip)(PORT = 1314))
   )
 
 local_lsnr_lm5330a =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb01pvip)(PORT = 1314))
   )
 
 local_lsnr_lm5330b =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = vmdb02pvip)(PORT = 1314))
   )
 
 ################Server side host table, same for both nodes######################## 
 127.0.0.1          localhost
 10.200.48.17    vmdb01p.oradb.com   vmdb01p
 10.200.48.18    vmdb02p.oradb.com   vmdb02p
 10.200.48.15    vmdb01pvip.oradb.com        vmdb01pvip
 10.200.48.16    vmdb02pvip.oradb.com        vmdb02pvip
 192.168.48.17   vmdb01pph.oradb.com vmdb01pph
 192.168.48.18   vmdb02pph.oradb.com vmdb02pph
 
 SQL> show parameter instance_name
 
 NAME                                 TYPE                              VALUE
 ------------------------------------ ------------------- ------------------
 instance_name                        string              LM5330A
 SQL> show parameter listener
 
 NAME                                 TYPE                VALUE
 ------------------------------------ ------------------- -------------------
 local_listener                       string              local_lsnr_lm5330a
 remote_listener                      string              remote_lsnr_lm5330
 
 SQL> show parameter instance_name
 
 NAME                                 TYPE                VALUE
 ------------------------------------ ------------------- ------------------
 instance_name                        string              LM5330B
 SQL> show parameter listener
 
 NAME                                 TYPE                VALUE
 ------------------------------------ ------------------- ------------------
 local_listener                       string              local_lsnr_lm5330b
 remote_listener                      string              remote_lsnr_lm5330

2、客户端tnsnames.ora配置 
 #For NAT