1. 程式人生 > >通過增量備份恢復來處理Oracle DG 復制GAP

通過增量備份恢復來處理Oracle DG 復制GAP

disco manage cndb down and HERE oracl with next

1、確定增備scn範圍,通過alert日誌獲取gap日誌序列
GAP - thread 1 sequence 109631-117170


2、根據序列獲取增備起點SCN
提示最小gap序列為109631, 往前推一個序列,然後獲得scn號

select THREAD#,SEQUENCE#,FIRST_CHANGE#,NEXT_CHANGE# from v$archived_log where SEQUENCE#=109630;
THREAD# SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ---------- ------------- ------------
1 109630 1606624354 1606624958


3、在primary做基於該scn的增量備份及生成新的備庫控制文件
##增量備份數據庫
export ORACLE_SID=xxx
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 1000 M;
backup incremental from scn 1606624354 database format ‘/oradata/dgbackup/xxx/xxx_1606624354%U.bak‘;
--在primary創建standby controlfile
alter database create standby controlfile as ‘/oradata/dgbackup/xxx/xxx01.ctl‘;


4、備庫關閉數據庫,替換控制文件
--關閉備庫,備份當前備庫控制文件
shutdown immediate
mv /oradata/xxx/control01.ctl /oradata/xxx/control01.ctl.bak
替換當前備庫控制文件
cp /oradata/dgbackup/xxx/xxx01.ctl /oradata/xxx/control01.ctl


5、啟動備庫進行增量恢復
-----啟動數據庫到nomount
startup nomount;
----啟動數據庫到mount
alter database mount standby database;
##rman增量恢復
catalog start with ‘/oradata/dgbackup/inscndbkf‘;
recover database noredo;


6、啟動備庫復制應用
-----啟動恢復
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

通過增量備份恢復來處理Oracle DG 復制GAP