Skip to main content

How can we help you?

Druva Documentation

Recover database from the downloaded backup data

Phoenix Editions: File:/tick.png Business File:/cross.png Enterprise File:/tick.png Elite

 

After the backup data is downloaded, the DBA can run RMAN scripts to fetch backup data from the restore location and restore the database on the required Oracle server host. To proceed with the database recovery, the DBA must have permission to access the restore directory and its parent directory.

To recover a database, ensure that the control file in the current database is intact. If the control file is damaged, you must identify the control file from the downloaded backup data and proceed with the recovery.

Procedure

The following section provides instructions to recover the database from the downloaded backup data:

Recover database when the control file is intact

  1. Shut down the active database.
    Restore_immediate.png
  2. Mount the database to initiate RMAN operations.
    Put DB inmount state.png
  3. Open RMAN command prompt using the following command:
    $rman target <user>/<password>@<host_name>/<database_name>
    where,
    • <user> has the SYSDBA privileges,
    • <password> denotes the password to connect as SYSDBA specified in the target database’s orapwd file.
      Example: $rman target sys/oracle@localhost/cdb01
  4. Configure the SBT channel and provide the Druva SBT library present at the  /opt/Druva/PhoenixOracle/lib/libphxsbt.so location.
  5. Run the following command:
    configure channel device type sbt PARMS 'SBT_LIBRARY=/opt/Druva/PhoenixOracle/lib/libphxsbt.so,SBT_PARMS=(LogDirSuffix=restore_logs;RestoreFromLocalDir=/restore/Thu-Jan-28-14-16-43-2021)';
    where,
    • LogDirSuffix is the directory to save the restore logs.
    • RestoreFromLocalDir is the directory where you have downloaded the backup data.
      SBT_Run_BLock.png

      Note: After the control file is restored from the previous backup, the control file might contain the history of archived logs, which were backed up and deleted by the subsequent backups. Because the control file refers to the old archived logs, which no longer exist on the system, it is recommended to execute the following RMAN command after the control file restore:
      RMAN> crosscheck archivelog all;

  6. Restore the database.
    Restore DB.png
  7. Recover the database.
    Recover DB.png
  8. Open the database using the alter database open command.
  9. Check the status of the database after it is recovered.
    DB status after recover.png
  10. Back up the database based on your requirement.

Recover database when the control file is damaged

  1. Identify the control file from the downloaded backup data. The control file from the backup data has the following name format:
    Phx_<DBID>_<IncarnationNo>_CF
    Example: Phx_DN-SP01_DBID-1660729487_DT-20210128-142756_govlp4ld_1_1_CF
  2. Shut down the active database and bring the database to the NOMOUNT state.
    Shutdown Immediate and Startup nomount.png
  3. Open RMAN command prompt and restore the control file. Run the following command:
    run
    { allocate channel ch0 device type sbt PARMS 'SBT_LIBRARY=/opt/Druva/PhoenixOracle/lib/libphxsbt.so,SBT_PARMS=(LogDirSuffix=restore_logs;RestoreFromLocalDir=/restore/Thu-Jan-28-05-02-29-2021)';
    restore controlfile from 'Phx_DN-SP01_DBID-1660729487_DT-20210128-051550_envlo45s_1_1_CF';
    }

    Where,
    • LogDirSuffixis the directory to save the restore logs.
    • RestoreFromLocalDir is the directory where you have downloaded the backup data.
      SBT_Run_BLock.png
      In the RMAN run block shown above, specify the control file name in the restore controlfile from command statement.
  4. Mount the database to initiate RMAN operations.
    Put DB inmount state.png
  5. Configure the SBT channel.
    Configure RMAN parameters.png

    Note: After the control file is restored from the previous backup, the control file might contain the history of archived logs, which were backed up and deleted by the subsequent backups. Because the control file refers to the old archived logs, which no longer exist on the system, it is recommended to execute the following RMAN command after the control file restore:
    RMAN> crosscheck archivelog all;

  6. Restore the database.
    Restore DB.png
  7. Recover the database.
    Recover DB.png
  8. Open the database using the resetlogs option because we restored the control file. Verify the database incarnation.
    Alter DB List Incarnation.png
  9. Check the status of the database after it is recovered.
    DB status after recover.png
  10. Back up the database based on your requirement.