Recovering an Auxiliary or Standby Oracle Database to the Current Time When a Duplicate Restore Fails or When It Is Only Recovered to a Point-In-Time and the RMAN Catalog Is Not Configured

You can recover an auxiliary or standby database to the current time when a duplicate restore operation fails or when it is only recovered to a point-in-time and the RMAN catalog is not configured.

Procedure

  1. Obtain the list of datafile paths of the auxiliary or standby instance by executing the RMAN "report schema" command on the auxiliary or standby instance. Type the following at the RMAN prompt:

    report schema;
  2. Restore any datafiles that are not known to the auxiliary or standby control file. This is required if the database has new datafiles that were added but they were not part of the auxiliary or standby database at the time of duplication.

    1. Find the list of datafiles from the source (target database) by executing the RMAN "report schema" command. Type the following at the RMAN prompt:

      report schema;
    2. Find the list of datafiles on the auxiliary or standby instance by executing the RMAN "report schema" command on the auxiliary or standby instance. Type the following at the RMAN prompt:

      report schema;
    3. Compare the lists from the target and auxiliary or standby databases to determine which files are missing from the auxiliary or standby database.

    4. Run a duplicate restore. The following shows example commands. In this example, datafiles 14 through 18 are missing from the auxiliary or standby database.

      run { 
      alter clone database mount; 
      set newname for clone datafile 14 to new; 
      set newname for clone datafile 15 to new; 
      set newname for clone datafile 16 to new; 
      set newname for clone datafile 17 to new; 
      set newname for clone datafile 18 to new; 
      restore clone datafile 14, 15, 16, 17, 18; 
      switch clone datafile all; } 
      exit;
  3. Add a "set newname" line for each of the datafile paths, as shown in the example below. This recovers the database using the chosen criteria. Choose the SCN or point-in-time criteria for the "set until" statement that is the same as the duplicate.

    run { alter clone database mount; 
    set until scn 2789951; 
    set newname for datafile 1 to '+DATADDG/ONEDC/DATAFILE/system.357.1053110405'; 
    set newname for datafile 2 to '+DATADDG/ONEDC/DATAFILE/ts_scott.359.1053110405'; 
    set newname for datafile 3 to '+DATADDG/ONEDC/DATAFILE/sysaux.352.1053110405'; 
    set newname for datafile 4 to '+DATADDG/ONEDC/DATAFILE/undotbs1.358.1053110405'; 
    set newname for datafile 5 to '+DATADDG/ONEDC/DATAFILE/ts_db.360.1053110405'; 
    set newname for datafile 6 to '+DATADDG/ONEDC/DATAFILE/users.356.1053110405'; 
    set newname for datafile 7 to '+DATADDG/ONEDC/DATAFILE/ts_scott.361.1053110405'; 
    set newname for datafile 8 to '+DATADDG/ONEDC/DATAFILE/ts_scott.362.1053110405'; 
    set newname for datafile 9 to '+DATADDG/ONEDC/DATAFILE/ts_diptiman.348.1053110405'; 
    set newname for datafile 10 to '+DATADDG/ONEDC/DATAFILE/ts_scott.349.1053110405'; 
    set newname for datafile 11 to '+DATADDG/ONEDC/DATAFILE/ts_scott.363.1053110405'; 
    set newname for datafile 12 to '+DATADDG/ONEDC/DATAFILE/ts_scott.337.1053110405'; 
    set newname for datafile 13 to '+DATADDG/ONEDC/DATAFILE/ts_diptiman.355.1053110405'; 
    set newname for datafile 14 to '+DATADDG/ONEDC/DATAFILE/ts_scott.367.1053167759'; 
    set newname for datafile 15 to '+DATADDG/ONEDC/DATAFILE/ts_diptiman.368.1053167759'; 
    set newname for datafile 16 to '+DATADDG/ONEDC/DATAFILE/ts_diptiman.369.1053167759'; 
    set newname for datafile 17 to '+DATADDG/ONEDC/DATAFILE/ts_scott.370.1053167759'; 
    set newname for datafile 18 to '+DATADDG/ONEDC/DATAFILE/ts_scott.371.1053167759'; 
    recover clone database delete archivelog; 
    } 
    exit;
  4. To use the recover until current option, refer to the previous step, obtain the auxiliary or standby schema, remove the line "set until scn <>;" (as seen in the previous step's example), and run the recovery until the current time.

Page contents

×

Loading...