主库
alter system switch logfile;
alter system set log_archive_dest_state_2='defer';
select switchover_status from v$database;
alter database commit to switchover to physical standby with session shutdown;
shutdown immediate;
startup mount;
alter database recover managed standby database disconnect;
备库
alter database recover managed standby database disconnect; 转换不需要cancel先停掉,防止报ORA-16139: media recovery required,可能是由于未应用日志引起,可先执行。
select switchover_status from v$database;
alter database commit to switchover to primary with session shutdown;
alter database open;
alter system set log_archive_dest_state_2='enable';