Data Guard 健壯性查詢必背彙總

kuqlan發表於2011-07-28
在平時或切換Oracle Dataguard之前我們必須確認現有Dataguard環境健壯性的前提下才能開始下一步的切換操作。但是在正式切換時我們總是有點緊張原因在檢查環節就會浪費不少時間。基於這些因素,總結了如下查詢語句,也希望養成將這些語句執行在sql*plus環境下而不是PLSQL Developer 的習慣。[@more@]

在主庫:

1、檢視歸檔模式:

archive log list;

2、檢視archive_dest值是否準確:

col destination for a16;

col dest_name for a20;

select dest_name,status,target,schedule,destination FROM V$ARCHIVE_DEST;

3、檢視archived_log的歸檔和應用情況:

select * from (

select recid,thread#,dest_id,sequence#,applied,status from V$ARCHIVED_LOG

order by recid desc)

where rownum <16;

或如下:

select recid,stamp,name,dest_id,thread#,sequence#,first_time,next_time,completion_time from (

SELECT * FROM V$ARCHIVED_LOG order by recid desc)

where rownum <10;

4、檢視當前連結會話情況:

select username, program,machine from v$session where username is not null;

5、檢視DB狀態:

select open_mode, database_role, switchover_status from v$database;

在備庫:

1、檢視歸檔模式:

archive log list;

2MANAGED_STANDBY檢視:

col group# for a4;

select process,status,client_process,group#,thread#,sequence# from V$MANAGED_STANDBY;

3、檢視是否有GAP

select * from v$archive_gap;

---select THREAD#,SEQUENCE#,APPLIED from v$archived_log where THREAD#=2 and SEQUENCE#=1952

4、檢視archived_log的歸檔和應用情況:

select * from (

select recid,thread#,dest_id,sequence#,applied,status from V$ARCHIVED_LOG

order by recid desc)

where rownum <16;

5、檢視當前連結會話情況:

select username, program,machine from v$session where username is not null;

6、檢視DB狀態:

select open_mode, database_role, switchover_status from v$database;

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

相關文章