DG之物理Standby的failover

1.检查归档文件是否连续
ORCLPRE:
ORCLPRE_STD >startup
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              75499764 bytes
Database Buffers           88080384 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
ORCLPRE_STD >select thread#,low_sequence#,high_sequence# from v$archive_gap;

no rows selected
若有记录,把列出的记录号对应的归档转换到待转换的Standby,不然数据会不一致。并加入数据字典(Alter database register physical logfile 'filespecl')
2.检查归档文件是否完整
ORCLPRE_STD >select distinct thread#,max(sequence#) over(partition by thread#) A from v$archived_log;

   THREAD#          A
---------- ----------
         1         39
ORCLPDG:
ORCLPDG_PRI >startup
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              62916852 bytes
Database Buffers          100663296 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
ORCLPDG_PRI >select distinct thread#,max(sequence#) over(partition by thread#) A from v$archived_log;

   THREAD#          A
---------- ----------
         1         39
若最大序号不同,需要复制到待转换的Standby。
3.启动failover

ORCLPRE_STD >alter database recover managed standby database finish force;//force停止当前活动的RFS进程(RFS是REDO传输服务)。

Database altered.
4.切换物理Standby为Primary
ORCLPRE_STD >alter database commit to switchover to primary;

Database altered.

5.启动新的Primary
ORCLPRE_STD >select status from v$instance;

STATUS
------------
STARTED

ORCLPRE_STD >alter database open;
alter database open
*
ERROR at line 1:
ORA-01507: database not mounted


ORCLPRE_STD >shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
ORCLPRE_STD >startup
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              75499764 bytes
Database Buffers           88080384 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
ORCLPRE_STD >select * from scott.test;

        ID
----------
         1
         2
         3
         4
         5
         6

6 rows selected.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值