I will write about resolving the Primary/Standby log gap in case of we deleted some archive log files from primary. Suppose that we don’t have the backup of the deleted archive files. Normally we (DBAs) should not allow such a situation but such a situation can happen to us. In this case, we need to learn the current SCN number of Primary and standby databases.
1- let’s learn current SCN number with the following query on the Primary.
SQL> select current_scn from v$database;2- let’s learn current SCN number with the following query on the Standby
CURRENT_SCN
———–
1289504966
SQL> select current_scn from v$database;using the function scn_to_timestamp(SCN_NUMBER) you can check the time difference between primary and standby.
CURRENT_SCN
———–
1289359962
3- Stop apply process on the Standby database.
SQL> alter database recover managed standby database cancel;4- Shutdown the Standby database.
SQL> shutdown immediate;5- Take incremental backup from the latest SCN number of the Standby database on the Primary database. And copy backup to the standby server.
RMAN> backup incremental from scn 1289359962 database;6- Create new standby control file on the Primary database. And copy this file to standby server.
# scp /backup_ISTANBUL/dun52q66_1_1 oracle@192.168.2.3:/oracle/ora11g
SQL> alter database create standby controlfile as ‘/oracle/ora11g/standby.ctl’;7- Open the Standby database on NOMOUNT state to learn control files location.
# scp /oracle/ora11g/standby.ctl oracle@192.168.2.3:/oracle/ora11g
SQL> startup nomount8- Replace new standby control file with old files.
SQL> show parameter control_files
# cp /oracle/ora11g/standby.ctl /oracle/ora11g/ISTANBUL/data1/control01.ctl9- Open the Standby database on MOUNT state.
# cp /oracle/ora11g/standby.ctl /oracle/ora11g/ISTANBUL/data2/control02.ctl
SQL> alter database mount standby database;10- Connect to the RMAN and register backup to catalog.
# rman target /It will ask for confirmation. Click “y” .
RMAN> catalog start with ‘/oracle/ora11g’;
11- Now, you can recover the Standby database. Start recover database.
RMAN> recover database;When recover of database is finished, it searches the latest archive file. And it gives an ORA-00334 error. In this case, don’t worry about it. Exit from RMAN and start apply process on the standby database.
SQL> alter database recover managed standby database disconnect from session;We solved the Primary/Standby log gap with RMAN incremental backup . When we faced with such a situation we don’t need to think about re-installing standby database. Because time is very valuable for us.
Talip Hakan Öztürk
Không có nhận xét nào:
Đăng nhận xét