How to use RMAN incremental backup to recover data guard log gap (log suspended)

Source: Internet
Author: User

Main Library Query minimum SCN information:
Sql> Col CURRENT_SCN for 999999999999999
Sql> SELECT CURRENT_SCN from V$database;

Select min (FHSCN) from X$KCVFH;

Select min (F.FHSCN) from X$kcvfh F, v$datafile D
where F.hxfil =d.file#
and d.enabled! = ' READ only ';
Current_scn
----------------
12614205226673

MIN (FHSCN)
----------------
12614205076072

MIN (F.FHSCN)
----------------
12614205076072

+++++++++++++++++++++++++++++++++++++++++++++++=


1.----Library to cancel the archive application
ALTER database RECOVER MANAGED STANDBY database CANCEL;


2.----standby to determine lowest SCN
Col CURRENT_SCN for 99999999999999
SELECT CURRENT_SCN from V$database;

Select min (FHSCN) from X$KCVFH;

Select min (F.FHSCN) from X$kcvfh F, v$datafile D
where F.hxfil =d.file#
and d.enabled! = ' READ only ';

Take the minimum value from the above query

Sql> Col CURRENT_SCN for 999999999999999999
Sql> SELECT CURRENT_SCN from V$database;

Current_scn
-------------------
12611050666604

sql> Select min (FHSCN) from X$KCVFH;

MIN (FHSCN)
----------------
12611050666605

sql> Select min (F.FHSCN) from X$kcvfh F, v$datafile D
where F.hxfil =d.file#
and d.enabled! = ' READ only '; 2 3

MIN (F.FHSCN)
----------------
12611050666605


3.-----on primary DB end incremental backup based on minimum SCN obtained in step 2nd
BACKUP INCREMENTAL from SCN 12611050666604 DATABASE FORMAT '/lixora/forstandby_%u ' tag ' forstandby ';


4.-----Copy Backup to the standby library
$SCP forstandby_07pqprm4_1_1 192.168.0.10:/tmp


5.----on standby db to register the backup slice on the standby side, note the user owner, permissions
Rman> CATALOG START with '/lixora/forstandby ';


6.----Perform recovery
rman> RECOVER DATABASE Noredo;




7.-----on primary db to generate a new standby control file
Rman> BACKUP current controlfile for STANDBY FORMAT '/lixora/forstandbyctrl.bck ';



8.----Copy the standby control files generated from the main library to the repository, note the user owner, permissions

Rman> BACKUP current controlfile for STANDBY FORMAT '/lixora/forstandbyctrl.bck ';

Scp/lixora/forstandbyctrl.bck 192.168.0.10:/tmp


9.------Back up the repository data file information to be used after recovering the new standby control file
Spool Datafile_names_step8.txt
Set Lines 200
Col name format A60
Select file#, name from V$datafile order by file#;
Spool off


------on standby Db to restore new standby control files

Rman> SHUTDOWN IMMEDIATE;
Rman> STARTUP Nomount;
Rman> RESTORE STANDBY controlfile from '/tmp/forstandbyctrl.bck ';


-----Update the data file information in the control file
Make the new standby control file effective
Rman> SHUTDOWN;
Rman> STARTUP MOUNT;

CATALOG START with ' +data/zhglptdg/datafile/';


------on Primary db. Make sure that the main library has not added a new data file after the log gap has occurred in the standby repository.
SELECT file#, NAME from V$datafile WHERE creation_change# > 12611050666604;

If there is a record, you cannot do the witch operation, you can refer to the document to recover:
Note 1531031.1 Steps to perform for rolling forward a standby the database using RMAN incremental backup when DataFile is Adde D to Primary


-----Renaming a data file
Rman> SWITCH DATABASE to COPY;


-----Re-confirm that there is not much difference between the main library and the standby SCN in the recovery of incremental backup tablets
Sql> Col CURRENT_SCN for 99999999999999
SELECT CURRENT_SCN from V$database;

Select min (FHSCN) from X$KCVFH;

Select min (F.FHSCN) from X$kcvfh F, v$datafile D
where F.hxfil =d.file#
and d.enabled! = ' READ only ';

Current_scn
---------------
12614205662375

MIN (FHSCN)
----------------
12614205076072

MIN (F.FHSCN)
----------------
12614205076072


------on standby database, clean up the standby log group
SELECT * from V$standby_log;

sql> ALTER DATABASE CLEAR LOGFILE GROUP 1;
sql> ALTER DATABASE CLEAR LOGFILE GROUP 2;
sql> ALTER DATABASE CLEAR LOGFILE GROUP 3;


------Start Redo Data Apply
sql> ALTER database RECOVER MANAGED STANDBY database DISCONNECT;

If you encounter some data loss due to setting nologgling, you can install the following method to recover
To resolve nologging operations only, see Note 958181.1.
In addition to this information, see the online documentation:
10.2:http://download.oracle.com/docs/cd/b19306_01/server.102/b14239/scenarios.htm#cihiaadc
11.1:http://download.oracle.com/docs/cd/b28359_01/server.111/b28294/rman.htm#sbydb00759
11.2:http://download.oracle.com/docs/cd/e11882_01/server.112/e17022/rman.htm#cihiaadc


PostScript
If you want to enable the real-time application, you need to add standby redo log in the standby, the size should be the same as the main library, and more than the main library group;


ALTER DATABASE Add standby LOGFILE GROUP 6 size 500M;
ALTER DATABASE Add standby LOGFILE GROUP 7 size 500M;
ALTER DATABASE Add standby LOGFILE GROUP 8 size 500M;
ALTER DATABASE Add standby LOGFILE GROUP 9 size 500M;


Enable command:
ALTER database RECOVER MANAGED STANDBY database USING current LOGFILE;


For details, see :

Oracle 10g Standby Database Real-time application redo data


How to ensure that the DG is normal, the background log resembles the following:
Mon Dec 10:03:04 CST 2014
RFS[1]: Archived Log: ' +data/lixora/archivelog/1_23094_790186477.dbf '
Mon Dec 10:03:25 CST 2014
Media Recovery Log +data/lixora/archivelog/1_23094_790186477.dbf
Media Recovery waiting for thread 1 sequence 23095 (in transit)
Mon Dec 10:05:53 CST 2014
RFS[2]: Archived Log: ' +data/lixora/archivelog/1_23095_790186477.dbf '
Primary database is in MAXIMUM performance mode
RFS[2]: No standby redo logfiles of size 1024000 blocks exist
Mon Dec 10:05:55 CST 2014
Media Recovery Log +data/zhglptdg/archivelog/1_23095_790186477.dbf
Media Recovery waiting for thread 1 sequence 23096 (in transit)
Mon Dec 10:05:57 CST 2014
RFS[2]: Archived Log: ' +data/lixora/archivelog/1_23096_790186477.dbf '
Primary database is in MAXIMUM performance mode
RFS[2]: No standby redo logfiles of size 1024000 blocks exist
Mon Dec 10:06:00 CST 2014
Media Recovery Log +data/lixora/archivelog/1_23096_790186477.dbf
Media Recovery waiting for thread 1 sequence 23097 (in transit)




Like a log, it shows that the log was just passed in, but there was no application:
Tue Dec 17:28:48 CST 2014
Primary database is in MAXIMUM performance mode
RFS[3]: Successfully opened standby log 7: ' +data/lixora/onlinelog/group_7.360.857131345 '
Tue Dec 18:57:12 CST 2014
Primary database is in MAXIMUM performance mode
RFS[3]: Successfully opened standby log 8: ' +data/lixora/onlinelog/group_8.361.857131375 '
Tue Dec 20:12:13 CST 2014
Primary database is in MAXIMUM performance mode
RFS[3]: Successfully opened standby log 7: ' +data/lixora/onlinelog/group_7.360.857131345 '
Tue Dec 21:40:39 CST 2014
Primary database is in MAXIMUM performance mode
RFS[3]: Successfully opened standby log 8: ' +data/lixora/onlinelog/group_8.361.857131375 '




How can I ensure that DG is normal:
1) Whether the v$archive_log.applied is yes
2) Main Library switch log: ALTER system Swtich logfile;
Look at the library v$database. Is there growth in CURRENT_SCN?

How to use RMAN incremental backup to recover data guard log gap (log suspended)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.