Oracle 11g logical standby switchover

11.2.0.4 on Oracle Linux 5.8

1、检查primary的switchover_status

select switchover_status from v$database;

 如果为sessions active或者to standby 都可以向下进行。

2、Prepare primary database

primary 上执行:

alter database prepare to switchover to logical standby;

执行完成后检查 switchover_status,如果是PREPARING SWITCHOVER则是成功

3、prepare logical standby

在logical standby上执行

alter database prepare to switchover to primary;

执行完成后如果查看switchover_status ,如果是preparing dictonary,表示LogMiner dictionary is being recorded inthe redo stream;

PREPARING SWITCHOVER表示此步骤已经完成

此时如果要撤销switchover,分别在primary和standby上先后执行

alter database prepare to switchovercancel;

4 、Switchover primary datanase to logical standby

 alter database commit to switchover to logical standby;

 这里不能有正在进行的transcation,查询v$transcation查询有哪些活动transcation

执行后primary也不能再执行任何transcation

5、switchover logical standby to primary

在这里logical standby一定要开启apply。当日志apply完成后,switchover_status会变成primary

在logica standby上查询switchover_status ,如果为TO PRIMARY则执行以下:

alter database commit to switchover to primary;

6、在新的standby上开启apply

alter database start logical standby apply immediate;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值