ITPub博客

首页 > Linux操作系统 > Linux操作系统 > dataguard 物理standby的 failover

dataguard 物理standby的 failover

原创 Linux操作系统 作者:xpj0515 时间:2011-04-28 21:08:10 0 删除 编辑
standby_detail.sql 脚本内容
set linesize 200
col name for a8
col db_unique_name for a8 heading "UNIQUE"
col log_mode for a10
col switchover_status for a18
col open_mode for a10
col MODE for a5
col LEVEL for a5
col force_logging for a5 heading "FORCE"
col ROLE for a8
select name,db_unique_name,open_mode,
force_logging ,decode(database_role,'PHYSICAL STANDBY','PHYSICAL','LOGICAL STANDBY','LOGICAL',database_role)"ROLE",log_mode,
switchover_status,decode(protection_mode,'MAXIMUM PERFORMANCE','PER',
'MAXIMUM PROTECTION','PRO','MAXIMUM AVAILABILITY','AVAI') "MODE",
decode(protection_level,'MAXIMUM PERFORMANCE','PER',
'MAXIMUM PROTECTION','PRO','MAXIMUM AVAILABILITY','AVAI')  "LEVEL"
 from v$database
/

SYS@standby1/01-JAN-02>@standby_detail.sql

NAME     UNIQUE   OPEN_MODE  FORCE ROLE     LOG_MODE   SWITCHOVER_STATUS  MODE  LEVEL
-------- -------- ---------- ----- -------- ---------- ------------------ ----- -----
ORCL     orcl_2   READ ONLY  YES   PHYSICAL ARCHIVELOG NOT ALLOWED        PER   PER
                  WITH APPLY


1 row selected.

Elapsed: 00:00:00.00
SYS@standby1/01-JAN-02>alter database recover managed standby database finish force;

Database altered.

Elapsed: 00:00:12.13
SYS@standby1/01-JAN-02>@standby_detail.sql

NAME     UNIQUE   OPEN_MODE  FORCE ROLE     LOG_MODE   SWITCHOVER_STATUS  MODE  LEVEL
-------- -------- ---------- ----- -------- ---------- ------------------ ----- -----
ORCL     orcl_2   READ ONLY  YES   PHYSICAL ARCHIVELOG TO PRIMARY         PER   PER

1 row selected.

Elapsed: 00:00:00.00
SYS@standby1/01-JAN-02>alter database commit to switchover to primary;

Database altered.

Elapsed: 00:00:00.68
SYS@standby1/01-JAN-02>@standby_detail.sql

NAME     UNIQUE   OPEN_MODE  FORCE ROLE     LOG_MODE   SWITCHOVER_STATUS  MODE  LEVEL
-------- -------- ---------- ----- -------- ---------- ------------------ ----- -----
ORCL     orcl_2   MOUNTED    YES   PRIMARY  ARCHIVELOG NOT ALLOWED        PER

1 row selected.

Elapsed: 00:00:00.02
SYS@standby1/01-JAN-02>alter database open;

Database altered.

Elapsed: 00:00:09.51
SYS@standby1/01-JAN-02>@standby_detail.sql


NAME     UNIQUE   OPEN_MODE  FORCE ROLE     LOG_MODE   SWITCHOVER_STATUS  MODE  LEVEL
-------- -------- ---------- ----- -------- ---------- ------------------ ----- -----
ORCL     orcl_2   READ WRITE YES   PRIMARY  ARCHIVELOG RESOLVABLE GAP     PER   PER

1 row selected.

Elapsed: 00:00:09.63


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24890594/viewspace-694042/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-08

  • 博文量
    32
  • 访问量
    52752