首页 > 数据库 > Oracle > Data Guard 健壮性查询必背汇总
在主库:
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;
2、MANAGED_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博客 ” ,链接:https://blog.itpub.net/18841027/viewspace-1053122/ ,如需转载,请注明出处,否则将追究法律责任。