switch over Physical Standby steps

Fisrt switch the primary  to standby and then switch the standby to primary.

A switchover must be initiated on
the current primary database and completed on the target standby database

1 Verify the primary if it is ready 

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
-----------------
TO STANDBY

如果显示是sessions active,则用以下语句看一下是哪些用户还连着

SELECT SID, PROCESS, PROGRAM FROM V$SESSION 
 WHERE TYPE = 'USER'
 AND SID <> (SELECT DISTINCT SID FROM V$MYSTAT);


2 switch the primary to standby

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;

3 shutdown ,mount the primary and make it  standby

be sure to start the apply service

alter database recover managed standby database disconnect;

4 verify if the standby is ready 

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
-----------------
TO_PRIMARY
1 row selected

5 switch the standby to primary

6 start the new primary in read write mode

7 test if the switchover works


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值