oracle rac遭遇ora-12170

byfree發表於2009-10-20
現象:客戶端配置了tnsname指向rac兩個節點的VIP地址,tnsping tnsname正常,使用sqlplus連線則會出現偶發的ora-12170報錯(同時觀察網路狀態一切正常)。
以前遇到過:
WARNING: inbound connection timed out (ORA-3136)
sqlnet.log:Fatal NI connect error 12170.
通過:
1.set INBOUND_CONNECT_TIMEOUT_=0 in listener.ora
2. set SQLNET.INBOUND_CONNECT_TIMEOUT = 0 in sqlnet.ora of server.
3. stop and start both listener and database.
4. Now try to connect to DB and observe the behaviour
可解決問題,但我這次碰到的顯然不是這樣的問題
在metalink中找到Doc ID:453544.1,它描述的問題跟我遇到的十分像,
---------------------------------------------------
Cause:
Client -----------&gt NAT firewall ----------&gt  RAC
The problem lies with the network design. Client can access RAC only via RAC's external IP address, because the connection goes via NAT firewall/router.
As part of RAC configuration, the connections may be re-directed among available nodes to have loadbalancing feature. RAC DB sends the internal IP/hostname in the redirected packet. When the client tries to connect using this internal IP address, it can not connect and thus errors out.
You will see the error if the redirection happends to other nodes. Connection will be successful if no redirection happends.
---------------------------------------------------
之後通過其Solution,解決了ora-12170問題。
解決方法:
1.設定rac每個節點的系統引數LOCAL_LISTENER
node1
-----
SQL>alter system set local_listener='(address=(protocol=tcp)(host=node1)(port=1521))' sid='ocrl1'
node2
-----
SQL>alter system set local_listener='(address=(protocol=tcp)(host=node2)(port=1521))' sid='ocrl2'
這個有點像以前遇到的ora-12545問題的解決方法,不同的是host=node1(注意是:hostname,我使用了VIP hostname)
2.檢查listener狀態
$ lsnrctl services
Service "oracle" has 2 instance(s).
  Instance "oracle1", status READY, has 3 handler(s) for this service...
    Handler(s):
       "DEDICATED" established:0 refused:0 state:ready
             REMOTE SERVER
             (ADDRESS=(PROTOCOL=TCP)(HOST=node1)(PORT=1521))
       "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
  Instance "oracle2", status READY, has 2 handler(s) for this service...
    Handler(s):
       "DEDICATED" established:0 refused:0 state:ready
            REMOTE SERVER
            (ADDRESS=(PROTOCOL=TCP)(HOST=node2)(PORT=1521))
3.client端tns
RAC =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oracle)
      (FAILOVER_MODE =
         (TYPE = SELECT)
         (METHOD = BASIC)
      )
    )
  )
4.確保client端能解析伺服器hostname(設定不同平臺下的hosts檔案)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17997/viewspace-617020/,如需轉載,請註明出處,否則將追究法律責任。

相關文章