时间:2021-07-01 10:21:17 帮助过:4人阅读
alter database recover to logical standby READDB;
我们的业务是passport应用,无法停止或者停掉很麻烦,总之,药不能停。
经过摸索,我们得到一个经验:须要等到MRP应用日志到跟主库一致,此时运行该命令才不会hang住。
详细流程大概是这种:
1. 开启实时日志应用
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION在这个过程中,我们能够边查看日志应用情况,在备库运行例如以下命令:
SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
在主库运行:
archive log list
select max(sequence#) from v$archived_log;
2. 接着,我们须要在备库停掉MRP进程:
alter database recover managed standby database cancel;
ERROR at line 1: ORA-16136: Managed Standby Recovery not active
3. 然后,我们能够在主库生成数据字典
exec dbms_logstdby.build;
alter system archive log current;
alter database recover to logical standby READDB;
Good Luck!
Oracle DG故障诊断一则:alter database recover to logical standby new_logical_dbname卡住
标签: