Oracle Data Guard - Recover Standby Database Using Incremental Backup - Resolve Log Gap
ฝัง
- เผยแพร่เมื่อ 21 ส.ค. 2024
- In this video we are going to talk about how to recover from a situation when the archived logs are deleted before they were applied on the standby and there is no backup of the archived logs available. This situation will develop a log gap in the standby causing it to be out of sync with the primary. I will demonstrate using an incremental backup from the primary, how we can resolve the log gap and bring the standby database back into sync with the primary.
The series "You - The Oracle Expert" is for Oracle enthusiasts where I cover different Oracle database related topics.
Oracle data guard is an indispensable part of oracle's high availability solutions. In a real world scenario the Primary and Physical standby databases reside on geographically different locations or different data centers to make sure that even if one region goes completely down, your database is still available and intact. In this tutorial I am using a virtual environment for demonstration purpose.
Commands and SQLs used :
docs.google.co...
My other series on TH-cam:
===========================
Mastering OEM 13c (Full Series):
• Mastering OEM 13c
Setting up OEM Notification, Monitoring and Alerting:
• OEM Monitoring and Ale...
Oracle VirtualBox Virtual Machines:
• VBox Virtual Machines
Very informative video keed uploading..
Thank you, I will
Very good!
Thanks for your feedback.
Nice practice
Thanks for your feedback.
it was very nice explanation, thank you.
Thanks for your feedback.
Thanks a lot
Most welcome
Good explanation thanks for sharing video.I have one doubt here current scn is not same both primary standby difference is 1276.
@PavanKumar-ft8eq - Thanks for your feedback and the question.
Yes, your observation is correct. The difference in SCN may be sometimes above 1000.
SCN can be incremented by many hundreds or thousands within a few seconds. It is not just the user activities that cause the SCN to get incremented but anything happening including the SYS/background activities. There was almost 50 seconds in between when I executed the statement in the standby and the primary and also in another session (not included in the video) I was extracting an AWR from the primary. That might have caused to increase. But at the end of the day, what we should be more concerned is the time lag between the primary and the standby. You can find that out using the function "scn_to_timestamp" as shown below.
SQL> select scn_to_timestamp(250605041) from dual;
Output:
SCN_TO_TIMESTAMP(250605041)
---------------------------------------------------------------------------
06-NOV-23 09.05.58.000000000 AM
I am using an example SCN of 250605041 here. Using the output from this statement executed against both the primary and standby SCN, you can find out by how much time the standby is lagging. For an ideal system in real time apply, there may be a few seconds which is expected. Hope this clears your doubt.
Hello , If i am not correct we need to catalog the backup pieces .. After restoring control file we need to catalog backup pieces then existing datafiles . then we need to recover database. Please confirm on this
Recovery of Standby DB Command Sequence
========================================
SQL> shutdown immediate
SQL> startup nomount
RMAN> RESTORE STANDBY CONTROLFILE FROM '/tmp/bkp/standby_control.ctl';
alter database mount;
catalog start with '/u001/app/oracle/oradata/TESTDG2/datafile';
SWITCH DATABASE TO COPY;
RMAN> recover database noredo;
Check the SCN’s in primary and standby:
Hi Shashi, thanks for watching my video and the question.
We need to catalog the backup pieces only if the backup location is different in the standby server.
As I mentioned in the video, I am maintaining the same backup location in the primary and standby server so we don't have to catalog the backup pieces here.
However, you must catalog the datafiles while using the standby control file that you copied from primary as the datafile location in the primary and standby server are different.
Hope this explains your doubt.
@@YouVolve thanks for clarifying..
@@shashiranjan06cse04 my pleasure