一、物理备库切换快照备库
1.取消备库日志应用
--- 检查备库状态
set pages 100 lines 180
col name for a10
select dbid,name,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from gv$database;
-- 取消备库日志应用
alter database recover managed standby database cancel;
2.切换备库为快照备库
-- 执行转换为快照数据库后,备库的开启状态为:MOUNTED
alter database convert to snapshot standby;
-- 开启备库后,数据库开启状态为:READ WRITE
alter database open;
set pages 100 lines 180
col name for a10
select dbid,name,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from gv$database;
---停止数据库定时任务
show parameter job_queue_processes;
alter system set job_queue_processes=0;
二、快照备库回切物理备库
1.关闭备库,将备库启动到 mount 状态
shutdown immediate
startup mount
2.执行回切命令
alter database convert to physical standby;
3.再次关闭备库,启动到 open 状态,开启实时应用
-- 关闭备库
shutdown immediate
-- 启动数据库到 open 状态
startup
-- 开始备库实时应用
alter database recover managed standby database using current logfile disconnect from session;
4.查看备库状态
set pages 100 lines 180
col name for a10
select dbid,name,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from gv$database;
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




