Oracle Rac监听之困惑


今天在客户碰到一问题,在这里记录一下:
/etc/hosts文件配置为
引用
127.0.0.1       localhost       loopback        # loopback (lo0) name/address

#public network
192.200.31.3    hisdb01
192.200.31.4    hisdb02

#virtual ip address
192.200.31.19   hisdb01_vip
192.200.31.20   hisdb02_vip

#private network used for rac
10.0.0.1        hisdb01_priv
10.0.0.2        hisdb02_priv


listener.ora文件配置为

引用
LISTENER_HISDB02 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hisdb02_vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.200.31.4)(PORT = 1521)(IP = FIRST))
    )
  )

SID_LIST_LISTENER_HISDB02 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/products/rdbms)
      (PROGRAM = extproc)
    )
  )

SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER_HISDB02=OFF
INBOUND_CONNECT_TIMEOUT_ =0
PREFER_LEAST_LOADED_NODE_LISTENER_LISTENER_HISDB02=OFF


主机上监听状态显示
引用
oracle.orcl2@hisdb02:/home/oracle$lsnrctl status listener

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 05-FEB-
2010 10:58:49

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1
.0 - Production
Start Date                03-FEB-2010 16:00:32
Uptime                    1 days 18 hr. 58 min. 16 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/products/rdbms/network/admin/listener.ora
Listener Log File         /oracle/products/rdbms/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hisdb02)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
Service "orcl" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
  Instance "orcl2", status READY, has 2 handler(s) for this service...
Service "orclXDB" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
  Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
  Instance "orcl2", status READY, has 2 handler(s) for this service...
Service "standby" has 2 instance(s).
  Instance "standby1", status READY, has 1 handler(s) for this service...
  Instance "standby2", status READY, has 2 handler(s) for this service...
Service "standby_XPT" has 2 instance(s).
  Instance "standby1", status READY, has 1 handler(s) for this service...
  Instance "standby2", status READY, has 2 handler(s) for this service...
The command completed successfully



引用
oracle.orcl2@hisdb02:/oracle/products/rdbms/network/admin$lsnrctl service

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 05-FEB-
2010 11:02:54

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "+ASM_XPT" has 1 instance(s).
  Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "orcl" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2147 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb01)(PORT=1521))
  Instance "orcl2", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:29731 refused:0 state:ready
         LOCAL SERVER
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb02)(PORT=1521))
Service "orclXDB" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: hisdb01, pid: 1232986>
         (ADDRESS=(PROTOCOL=tcp)(HOST=hisdb01)(PORT=32808))
  Instance "orcl2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: hisdb02, pid: 1232986>
         (ADDRESS=(PROTOCOL=tcp)(HOST=hisdb02)(PORT=32856))
Service "orcl_XPT" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2147 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb01)(PORT=1521))
  Instance "orcl2", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:29731 refused:0 state:ready
         LOCAL SERVER
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb02)(PORT=1521))
Service "standby" has 2 instance(s).
  Instance "standby1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb01)(PORT=1521))
  Instance "standby2", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb02)(PORT=1521))
Service "standby_XPT" has 2 instance(s).
  Instance "standby1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb01)(PORT=1521))
  Instance "standby2", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=hisdb02)(PORT=1521))
The command completed successfully


监听进程显示为
引用
oracle.orcl2@hisdb02:/home/oracle$ps -ef|grep tns
  oracle 1040544       1   0   Feb 03      -  3:52 /oracle/products/rdbms/bin/tnslsnr LISTENER -inherit
  oracle 3342398 3113092   0 10:58:35  pts/0  0:00 grep tns


rac状态显示为
引用
oracle.orcl2@hisdb02:/home/oracle$crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    hisdb01
ora....01.lsnr application    ONLINE    ONLINE    hisdb01
ora....b01.gsd application    ONLINE    ONLINE    hisdb01
ora....b01.ons application    ONLINE    ONLINE    hisdb01
ora....b01.vip application    ONLINE    ONLINE    hisdb01
ora....SM2.asm application    ONLINE    ONLINE    hisdb02
ora....02.lsnr application    ONLINE    ONLINE    hisdb02
ora....b02.gsd application    ONLINE    ONLINE    hisdb02
ora....b02.ons application    ONLINE    ONLINE    hisdb02
ora....b02.vip application    ONLINE    ONLINE    hisdb02
ora.orcl.db    application    ONLINE    ONLINE    hisdb01
ora....orcl.cs application    ONLINE    ONLINE    hisdb01
ora....cl1.srv application    ONLINE    ONLINE    hisdb01
ora....cl2.srv application    ONLINE    ONLINE    hisdb02
ora....l1.inst application    ONLINE    ONLINE    hisdb01
ora....l2.inst application    ONLINE    ONLINE    hisdb02


本地客户端tnsnames.ora配置为
引用
RAC2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.200.31.20)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
      (INSTANCE_NAME = orcl2)
    )
  )


奇怪的事情发生了,tnsping居然能通,为什么呢?
引用
C:\Documents and Settings\Administrator>tnsping rac2

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 05-2月 -
2010 10:56:42

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

已使用的参数文件:
D:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora


已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.200.
31.20)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)
(INSTANCE_NAME = orcl2)))
OK (10 毫秒)



你可能感兴趣的:(oracle,C++,c,IBM,AIX)