星期四, 12月 01, 2011

[Example] tnsnames.ora for 9i/10g/11g RAC, DataGuard

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.11.158)(PORT = 1521))
    )
    (CONNECT_DATA = (SID = orcl))
  )

-
For Oracle RAC  Failover:
請在一台有安裝Oracle Client軟體上,修改tnsnames.ora設定檔,加入以下

orcl =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = rac1pub)(PORT = 1521))
 (ADDRESS = (PROTOCOL = TCP)(HOST = rac2pub)(PORT = 1521))
)
 (CONNECT_DATA =
 (SERVICE_NAME = orcl)
 (failover_mode=(type=select)(method=basic))
)
 (LOAD_BALANCE=ON)
 (FAILOVER=ON)
)

For Oracle DataGuard :
---------------------------------------------------------

TAFTEST=
   (DESCRIPTION=
      (LOAD_BALANCE=ON)
      (FAILOVER=ON)
      (ADDRESS=
         (PROTOCOL=tcp)(HOST=orcl)(PORT=1521))
      (ADDRESS=
         (PROTOCOL=tcp)(HOST=orclstdby)(PORT=1521))
      (CONNECT_DATA=
         (SERVICE_NAME=orcl)
         (FAILOVER_MODE=
            (TYPE=select)
            (METHOD=basic)
         )
      )
   )

---------------------------------------------------------

sql> select instance_name from v$instance(利用sql plus工具)
(得知目前連到那一台Instance上,假設為orcl2的話,故意將orcl2的Instance關閉,並且再執行一次,您會發現已變更為orcl1,證實已經自動進行 Failover)
-
Configure TAF failover on Oracle 9i rac Oracle9i Real Application Clusters Setup and Configuration 9.2 a96600(p.160) tnsnames.ora
db.us.acme.com=
 (description=
  (address=
        (protocol=tcp)
        (host=db1-server)
        (port=1521))
  (address=
        (protocol=tcp)
        (host=db2-server)
        (port=1521))
   (connect_data=
     (service_name=db.us.acme.com)
        (failover_mode=
        (type=select)
        (method=basic)
        (retries=20)
        (delay=15))))

-
note
Oracle9i Database Migration Release 2 (9.2) (a96530.pdf)(p.240)
file:///D:\Oracle_docs\9i_B10501_01\server.920\a96530.pdf
Replace the SID parameter with the SERVICE_NAME parameter to connect to a release 8.1 or higher service, as in the following example.

sales=
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=sales.us.acme.com)))

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...