Script:RAC Failover检验脚本loop.sh

作者: Maclean Liu , post on August 30th, 2011 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: Script:RAC Failover检验脚本loop.sh
本文永久地址: http://www.oracledatabase12g.com/archives/script-rac-failover%e6%a3%80%e9%aa%8c%e8%84%9a%e6%9c%acloop-sh.html

以下脚本可以用于验证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:

  1. 脚本:监控数据库中的活跃用户及其运行的SQL
  2. 脚本:监控并行进程状态
  3. Script:To Report Information on Indexes
  4. Script: Listing Memory Used By All Sessions
  5. Script to show Active Distributed Transactions
  6. Script to Collect RAC Diagnostic Information (racdiag.sql)
  7. ORA-4030 PGA Usage Diagnostic Script
  8. Script:Diagnostic ORA-01000 maximum open cursors exceeded
  9. Script:收集UNDO诊断信息
  10. Script:收集RAC性能诊断信息

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>