ADG主备库切换 - Switchover

DBA 专栏收录该内容
262 篇文章 0 订阅

0 检查状态

备库查询
select process, pid, status, thread#,sequence#,blocks from v$managed_standby;

主库切归档
alter system switch logfile;

备库查询
select process, pid, status, thread#,sequence#,blocks from v$managed_standby;

1 停应用

2 删除进程

ps -ef|grep  |grep -v ora_|grep LOCAL=NO|awk '{print $2}'|xargs kill -9

3 主库切换归档确保最新数据同步至ADG端

alter system checkpoint;
alter system switch logfile;
alter system checkpoint;
alter system switch logfile;
alter system archive log current;
alter system switch logfile;
alter system checkpoint;
alter system switch logfile;

4 主库 -> 备库

select open_mode,switchover_status,database_role from v$database;
alter database commit to switchover to physical standby with session shutdown;

主库会关闭!

5 备库 -> 主库

select switchover_status from v$database;
alter database commit to switchover to primary with session shutdown; 

alter database open;
select open_mode,database_role from v$database;

6 检查状态

备库查询
select process, pid, status, thread#,sequence#,blocks from v$managed_standby;

主库切归档
alter system switch logfile;

备库查询
select process, pid, status, thread#,sequence#,blocks from v$managed_standby;
  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值