以下脚本可以用于验证RAC中FAILOVER的可用性:
loop.sh
nohup sqlplus su/su@failover @verify.sql &
sleep 1
nohup sqlplus su/su@failover @verify.sql &
sleep 1
nohup sqlplus su/su@failover @verify.sql &
sleep 1
nohup sqlplus su/su@failover @verify.sql &
sleep 1
verify.sql (检验SQL)
REM set pagesize 1000
REM the following query is for TAF connection verification
col sid format 999
col serial# format 9999999
col failover_type format a13
col failover_method format a15
col failed_over format a11
select sid, serial#, failover_type, failover_method, failed_over
from v$session where username = 'SU';
REM the following query is for load balancing verification
select instance_name from v$instance;
exit
REM you can also combine two queries:
col inst_id format 999
col sid format 999
col serial# format 9999999
col failover_type format a13
col failover_method format a15
col failed_over format a11
select inst_id, sid, serial#, failover_type, failover_method,
failed_over from gv$session where username = 'SU';
REM a simple select to see the distribution of users when testing
REM connection load balancing
select inst_id, count(*) from gv$session group by inst_id;
用法:
./loop.sh
© 2011, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.
相关文章 | Related posts:
- 脚本:监控数据库中的活跃用户及其运行的SQL
- 脚本:监控并行进程状态
- Script:To Report Information on Indexes
- Script: Listing Memory Used By All Sessions
- Script to show Active Distributed Transactions
- Script to Collect RAC Diagnostic Information (racdiag.sql)
- ORA-4030 PGA Usage Diagnostic Script
- Script:Diagnostic ORA-01000 maximum open cursors exceeded
- Script:收集UNDO诊断信息
- Script:收集RAC性能诊断信息




最新评论