oracle load banlance 配置與測試方法

paulyibinyi發表於2010-01-28

oracle load banlance 配置與測試方法

client 端設定方法:
rac_test =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 138.30.0.201)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 138.30.0.202)(PORT = 1521))
    (LOAD_BALANCE= yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME =racdb)
    )
  )

server端設定方法:

引數設定
節點1 local_listener='LISTENERS_RAC1'    listeners_rac1 在tnsnames.ora中配置見節點1 tnsnames.ora
或者直接寫ip地址有以下格式
(ADDRESS=(PROTOCOL=TCP)(HOST=138.30.0.201)(PORT=1521))
命令如下:
alter system set local_listener='LISTENERS_RAC1' scope=both sid='racdb1';
或者
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=138.30.0.201)(PORT=1521))' scope=both sid='racdb1';

 

節點2 local_listener='LISTENERS_RAC2'    listeners_rac2在tnsnames.ora中配置見節點2 tnsnames.ora
或者直接寫ip地址有以下格式
(ADDRESS=(PROTOCOL=TCP)(HOST=138.30.0.202)(PORT=1521))
命令如下:
alter system set local_listener='LISTENERS_RAC2' scope=both sid='racdb2';
或者
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=138.30.0.202)(PORT=1521))' scope=both sid='racdb2';

remote_listeners='LISTENERS_RACDB' 會自動預設設定好

tnsnames.ora設定


tnsnames.ora in RAC ORACLE_HOME
節點1

LISTENERS_RACDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
)

LISTENERS_RAC1 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
)

節點2

LISTENERS_RACDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
)

LISTENERS_RAC2 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
)

 


測試方法:

sqlplus ""
select instance_name from v$instance;
exit;

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

相關文章