dataguard failover恢复

Prerequisite:

1.Dataguard of primary database is down due to power failure or other disaster  

2.Primary can be flashbacked on(alter database flashback on; need restart instance)

two parameters are related to flashback:

DB_RECOVERY_FILE_DEST(db_recovery_file_dest_size) and db_flashback_retention_target(default value:1440 minute)

(1)Failover:

standby side

1.stop redo apply

alter database recover managed standby database cancel;

2.finish applying all received redo data:

alter database recover managed standby database finish force;

select database_role from v$database;

3.switchover standby to primary

alter database commit to switchover to primary with session shutdown;

4.open new primary database

alter database open

5.get the scn from new primary where old primary failed over

select to_char(standby_became_primary_scn) from v$database;

TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)

----------------------------------------

7490727

(2)flashback old primary database

1.mount old primary database

startup mount;

2.flashback to the scn  where it failed over

flashback database to scn  7490727;

3.switch old primary database to standby

alter database convert to physical standby;

4.restart new standby database

shutdown immediate

startup

5.start redo apply

alter database recover managed standby database disconnect from session;

6.check primary status and test new dataguard

select OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database;

OPEN_MODE            DATABASE_ROLE    SWITCHOVER_STATUS

-------------------- ---------------- --------------------

READ ONLY WITH APPLY PHYSICAL STANDBY SWITCHOVER PENDING

(3)Switchover the dataguard environment if needed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值