Oracle DG(dataguard)常用维护命令参考

1.检查归档日志应用情况
  set linesize 300
  colu name for a60
  select name,applied from v$archived_log; 
  select thread#,sequence#,name,standby_dest,archived,applied,status from v$archived_log order by 1,2;

2.开启备库恢复应用进程
  alter database recover managed standby database disconnect;
  alter database recover managed standby database using current logfile disconnect from session;

3.关闭备库恢复应用进程
  alter database recover managed standby database cancel;

4.查看备库gap
  select * from v$archive_gap;
  
5.查看主备库数据库基本信息
  select open_mode,protection_mode,database_role,switchover_status from v$database;

6.主库切换为备库
  alter database commit to switchover to physical standby with session shutdown;
  shutdown immediate;
  startup;

7.备库切换为主库
  alter database commit to switchover to primary with session shutdown;
  alter database open;

8.检查主备库日志一致性
  select max(sequence#) from v$log;

9.检查备库是否开启实时应用
  select recovery_mode from v$archive_dest_status where dest_id=2;

10.检查备库恢复应用进程是否开启
   ps aux|grep mrp 
   select process,status,sequence# from v$managed_standby;

你可能感兴趣的:(Oracle,dg,dataguard,oracle,recover,manage)