Restore uard with a gap sequence fix

Source: Internet
Author: User
1. the following error occurs in row 1st of the GAP sequence phenomenon SQLgt; alterdatabaseopen *: Today's replica uard, when the standby database recovers from open

I. gap sequence: SQLgt; alter database open * 1st line errors: Today's recovery uard, when the standby database is restored to open

I. gap sequence

SQL> alter database open;
Alter database open
*
Row 3 has an error:
An error is reported when the slave database recovers from open to the standby database at the same time:

ORA-16004: backup database recovery required
ORA-01152: File 1 has not been recovered from an old backup
ORA-01110: Data File 1: 'C: \ Oracle \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ system01.dbf'

Although archivelog can be synchronized:

SQL> select max (sequence #) from v $ archived_log;

MAX (SEQUENCE #)
--------------
15

Log displayed on the master database:
Tue Jan 03 19:11:20 2012
FAL [server]: Fail to queue the whole FAL gap
GAP-thread 1 sequence 8-8
DBID 1778268600 branch770765436

Standby Database alert Log:
FAL [client]: Failed to request gap sequence
GAP-thread 1 sequence 8-8
DBID 1778268600 branch770765436
FAL [client]: All defined FAL servers have been attempted.
-------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
Parameter is defined to a value that is sufficiently large
Enough to maintain adequate log switch information to resolve
Archivelog gaps.

Ii. Repair operations
1. query the scn of the slave Database

SQL> select current_scn from v $ database;

CURRENT_SCN
-----------
614090

Purpose: 1) determine whether a data file is added to the master database after the scn. If a file is added, manually add it to the slave database.
2) determine the starting point of the Incremental backup of the master database

2. Determine whether to add data files to the master database.

SQL> select FILE #, name from v $ datafile where CREATION_CHANGE #>=614090;

Unselected row

3. The slave database stops the log application.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

4. Incremental backup of the master database and transmission to the slave Database
Incremental backup of the master database
RMAN> backup incremental from scn 614090 database format 'C: \ soft \ sheng_U % 'tag'shp ';

Note: The master database must have completed the full backup of rman before (without the full backup database, the Incremental Backup Based on scn can also be successful)

5. Restore on the slave Database
RMAN> catalog start with 'C: \ soft ';
RMAN> recover database noredo;
Note: catalog start with is a 10 Gb or later version. Without this function, you can use catalog or copy the control file of the master database. The directory of rman backup is the same as that of the master database backup.

6. Create a standby controlfile on the master database and transfer it to the slave database.
RMAN> backup current controlfile for standby format 'C: \ soft \ sheng_ctl.bck ';

7. Backup database recovery Control File
RMAN> shutdown;
RMAN> startup nomount;
RMAN> restore standby controlfile from 'C: \ soft \ SHENG_CTL.BCK ';
RMAN> alter database mount;

8. Clear the standby Database Log Group
SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1;
NOTE: If standby log mode is used, you do not need to clear it.
SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1;
Alter database clear logfile group 1
*
ERROR at line 1:
ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 1 thread 1: 'C: \... \ redo01.log'
NOTE: If standby log mode is not used, several groups need to be cleared.

9. Reset flashback in the standby Database
SQL> ALTER DATABASE FLASHBACK OFF;
SQL> ALTER DATABASE FLASHBACK ON;

10. The slave database re-receives and applies logs.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

----------------------
I tried the above operation and found that the redo location is different, causing an error:

The standby Database alert is found:
RFS [1]: Unable to open standby log 6: 313
Tue Jan 03 20:23:16 2012
Errors in file c: \ oracle \ product \ 10.2.0 \ admin \ sheng \ udump \ sheng_rfs_2000.trc:
ORA-00313: open failed for members of log group 7 of thread 1
ORA-00312: online log 7 thread 1: 'd: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO07.LOG'
ORA-27041: unable to open file
OSD-04002: Unable to open file
O/S-Error: (OS 21) the device is not ready.

Check the log location and find a problem:

SQL> select * from v $ logfile;
The row is truncated.


GROUP # STATUS TYPE MEMBER
-----------------------------------------------------------------------------
3 online d: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO03.LOG
2 online d: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO02.LOG
1 online d: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO01.LOG

SQL> select * from v $ log;
Truncation before column FIRST_CHANGE # (as required)


GROUP # THREAD # SEQUENCE # BYTES MEMBERS ARC STATUS FIRS
-------------------------------------------------------------------------
1 1 17 52428800 1 yes clearing 03-1
3 1 16 52428800 1 yes inactive 03-1
2 1 18 52428800 1 YES CLEARING_CURRENT 03-1

Perform the following repairs:
In fact, add the following to the pfile of the standby database:
Log_file_name_convert = D: \ oracle \ product \ 10.2.0 \ oradata \ sheng \, C: \ oracle \ product \ 10.2.0 \ oradata \ sheng \

Shutdown immediate
Create spfile from pfile;

Startup nomount;
Alter database mount;

After the above operations on the slave database,
Select * from v $ logfile;

GROUP # STATUS TYPE MEMBER
-----------------------------------------------------------------------------
3 online c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO03.LOG
2 online c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO02.LOG
1 online c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO01.LOG
4 standby c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO04.LOG
5 standby c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO05.LOG
6 standby c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO06.LOG
7 standby c: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO07.LOG

You have selected 7 rows.

Found correct.

Below are the details:

Master database:

SQL> alter system switch logfile;

The system has been changed.
SQL> select current_scn from v $ database;

CURRENT_SCN
-----------
654580
Alert:

Tue Jan 03 21:22:56 2012
Thread 1 advanced to log sequence 19
Current log #3 seq #19 mem #0: D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO03.LOG
Tue Jan 03 21:22:57 2012
ARC1: Standby redo logfile selected for thread 1 sequence 18 for destination LOG_ARCHIVE_DEST_2


Take a look at the standby database information:

SQL> select current_scn from v $ database;

CURRENT_SCN
-----------
654555

RFS [1]: Successfully opened standby log 4: 'C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ SHENG \ REDO04.LOG'
Tue Jan 03 21:22:54 2012
Media Recovery Log C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ARCH \ 00100018770765436.ARC
Media Recovery Waiting for thread 1 sequence 19

-----

So far:

If the open Database is busy, run the following command to stop:

Alter database recover managed standby database cancel

Alter database open read only, you can open the database.

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.