RAC loadBanlance用到的指令碼

tianya_2011發表於2013-12-06
cliernt-side loadbalance測試中用到的指令碼

指令碼test.sh

#!/bin/bash
i=1
while [ $i -le $2 ]; do
      i=$((i+1))
      sqlplus -s system/oracle@$1 @test.sql
done

指令碼test.sh

#!/bin/sh
count=0
while [ $count -lt 1000 ]                                       # Set up a loop control
do                                                              # Begin the loop
    count=`expr $count + 1`                                     # Increment the counter
    sqlplus -s system/oracle@rac @test.sql
done

備註:兩個test.sh指令碼任選其一即可.

指令碼test.sql
select instance_name from v$instance
/
exit;


客戶端tnsname.ora

rac =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
      (LOAD_BALANCE = yes)
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = rac)
    )
  )

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

相關文章