2008年(105)
分类: Oracle
2008-06-18 14:01:58
物理 dataguard 的管理:
1. 查询备用库的保护模式,可切换模式
SQL> select OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,SWITCHOVER_STATUS from v$database;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL SWITCHOVER_STATUS
---------- -------------------- -------------------- --------------------
MOUNTED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE NOT ALLOWED
2. 查询连接程序
select sid,process,program from v$session;
3.查询有没有传输日志,MFS 进程
v$managed_standby ----有没有正在传输的日志
SQL> select process,client_process,status,sequence#,block# from v$managed_standby;
如果有 wait_for_log or waiting 则可能说明有正在有日志恢复
同时查询 mrp 进程是否
4. 查询日志应用情况:
5. 查询备用库recovery 状态
6 . 查询最大历史日志
7. 查询dataguard 状态,有用的信息
物理 dataguard 的管理:
1. 查询备用库的保护模式,可切换模式
SQL> select OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,SWITCHOVER_STATUS from v$database;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL SWITCHOVER_STATUS
---------- -------------------- -------------------- --------------------
MOUNTED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE NOT ALLOWED
2. 查询连接程序
select sid,process,program from v$session;
3.查询有没有传输日志,MFS 进程
v$managed_standby ----有没有正在传输的日志
SQL> select process,client_process,status,sequence#,block# from v$managed_standby;
PROCESS CLIENT_P STATUS SEQUENCE# BLOCK#
--------- -------- ------------ ---------- ----------
ARCH ARCH CONNECTED 0 0
ARCH ARCH CONNECTED 0 0
RFS ARCH IDLE 0 0 -- 不正常
RFS ARCH IDLE 0 0
SQL> select process,client_process,status,sequence#,block# from v$managed_standby;
PROCESS CLIENT_P STATUS SEQUENCE# BLOCK#
--------- -------- ------------ ---------- ----------
ARCH ARCH CONNECTED 0 0
ARCH ARCH CONNECTED 0 0
MRP0 N/A WAIT_FOR_LOG 4009 0 ----正常
RFS UNKNOWN IDLE 0 0
如果有 wait_for_log or waiting 则可能说明有正在有日志恢复
同时查询 mrp 进程是否
$ ps -ef|grep mrp
oracle 23566 1 0 07:47:17 ? 3:33 ora_mrp0_ sid
4. 查询日志应用情况:
SQL>
select ARCHIVED_THREAD#, ARCHIVED_SEQ# , APPLIED_THREAD# , APPLIED_SEQ# ,status from v$archive_dest_status;
ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ# STATUS
1 3977 1 2878 VALID -----有过多的归档日志没有应用 (不正常)
ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ# STATUS
1 4009 1 4008 VALID -----正常
5. 查询备用库recovery 状态
sql>select recovery_mode from v$archive_dest_status;
MANAGED
6 . 查询最大历史日志
select thread#,max(sequence#) from v$log_history group by thread#
select max(sequence#) from v$archived_log
7. 查询dataguard 状态,有用的信息
select message from v$dataguard_status;