RAC TAF 連線 (tnsnames.ora)

tolywang發表於2011-03-09

 TYPE=SELECT 意味著如果當某臺伺服器出現故障時,Oracle 正在執行 SELECT 語句,在進行故障切換時將重新執行該 SELECT 語句,遊標的指向方式會使客戶端可以無縫地繼續獲取行。但是,INSERT 或 UPDATE 的事務仍會回滾。您還可以配置 TYPE=SESSION,這樣如果首個連線失敗,所有在當時正在進行的工作都將無可挽回地丟失。

METHOD=BASIC 意味著僅在任一伺服器出現故障時連線到故障切換伺服器。METHOD=PRECONNECT 意味著在任一伺服器連線出現故障以前就連線到所有伺服器;這樣可避免重新連線的開銷,但是意味著每個預連線的連線將佔用的未使用的其他資源。

  In this example of a TAF basic dedicated connection, the TAF application first tries to connect to the 144.25.28.74 IP address. If it cannot connect, then it attempts to perform. a connect-time failover to 144.25.27.75. If the instance fails after the connection, then the TAF application fails over to the other node's listener, reserving SELECT statements that are in progress. If the failover connection attempt fails, then Oracle Net waits 5 seconds before trying to connect again. Oracle Net attempts to connect up to 180 times.

Specify a TAF basic dedicated connection for the SALES database as follows:

SALES_DED_BASIC=
  (DESCRIPTION=
     (LOAD_BALANCE=OFF)
     (FAILOVER=ON)
     (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1524))
        (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1524)))
     (CONNECT_DATA=
        (SERVICE_NAME=SALES.ORACLE.COM)
        (SERVER=DEDICATED)
        (INSTANCE_ROLE=PRIMARY)
        (FAILOVER_MODE=
             (BACKUP=SALES_DED_BASIC_BACKUP)
             (TYPE=SELECT)
             (METHOD=BASIC)
             (RETRIES=180)
             (DELAY=5))))

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

相關文章