Rolling a Standby Forward using an RMAN Incremental Backup To Fix The Nologging Changes [ID 958181.1] | |||||
Modified 24-OCT-2009 Type BULLETIN Status REVIEWED |
In this Document
Purpose
Scope and Application
Rolling a Standby Forward using an RMAN Incremental Backup To Fix The Nologging Changes
STEPS
++ Follow this step-by-step procedure to roll forward a physical standby database for which nologging changes have been applied to a small subset of the database:
++ Follow this step-by-step procedure to roll forward a physical standby database for which nologging changes have been applied to a large portion of the database:
References
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.2Information in this document applies to any platform.
Purpose
This document describes a method of rolling forward a standby database using incremental backups to fix the ORA-1578 and the ORA-26040 errors that were cuased due to Nologging/Unrecoverable operation.
Scope and Application
When a segment is defined with the NOLOGGING attribute and if a NOLOGGING/UNRECOVERABLE operation updates the segment, the online redo log file is updated with minimal information to invalidate the affected blocks when a RECOVERY is later performed.
This kind of NOLOGGING/UNRECOVERABLE will mark the affected blocks as corrupt during the media recovery on the standby database.Now, when you either activate the standby database, or open the standby database with the read-only option, and attempt to read the range of blocks that are marked as "UNRECOVERABLE," you see error messages similar to the following:
ORA-01578: ORACLE data block corrupted (file # 1, block # 2521)ORA-01110: data file 1: '/vobs/oracle/dbs/stdby/tbs_1.f'
ORA-26040: Data block was loaded using the NOLOGGING option
Rolling a Standby Forward using an RMAN Incremental Backup To Fix The Nologging Changes
STEPS
++ Follow this step-by-step procedure to roll forward a physical standby database for which nologging changes have been applied to a small subset of the database:
1.List the files that have had nologging changes applied by querying the V$DATAFILE view on the standby database. For example:
SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;FILE# FIRST_NONLOGGED_SCN
---------- -------------------
4 225979
5 230184
2.Stop Redo Apply on the standby database:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE DATAFILE 4 OFFLINE FOR DROP;SQL> ALTER DATABASE DATAFILE 5 OFFLINE FOR DROP;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
RMAN> BACKUP INCREMENTAL FROM SCN 225979 DATAFILE 4 FORMAT '/tmp/ForStandby_%U' TAG 'FOR STANDBY';RMAN> BACKUP INCREMENTAL FROM SCN 230184 DATAFILE 5 FORMAT '/tmp/ForStandby_%U' TAG 'FOR STANDBY';
SCP /tmp/ForStandby_* standby:/tmp
RMAN> CATALOG START WITH '/tmp/ForStandby_';
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE DATAFILE 4 ONLINE;SQL> ALTER DATABASE DATAFILE 5 ONLINE;
RMAN> RECOVER DATAFILE 4, 5 NOREDO;
SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;
RMAN> DELETE BACKUP TAG 'FOR STANDBY';
rm /tmp/ForStandby_*
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;++ Follow this step-by-step procedure to roll forward a physical standby database for which nologging changes have been applied to a large portion of the database:
1.Query the V$DATAFILE view on the standby database to record the lowest FIRST_NONLOGGED_SCN:
SQL> SELECT MIN(FIRST_NONLOGGED_SCN) FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN>0;MIN(FIRST_NONLOGGED_SCN)
------------------------
223948
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
RMAN> BACKUP INCREMENTAL FROM SCN 223948 DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FOR STANDBY';
scp /tmp/ForStandby_* standby:/tmpRMAN> CATALOG START WITH '/tmp/ForStandby_';
RMAN> RECOVER DATABASE NOREDO;
SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;
RMAN> DELETE BACKUP TAG 'FOR STANDBY';
rm /tmp/ForStandby_*
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Niciun comentariu:
Trimiteți un comentariu