RMAN Example: Restoring an Oracle Full Database for Disaster Recovery

You can restore an Oracle database to the same or a different client in the event of a disaster.

Procedure

  1. Put the database in MOUNT mode.

  2. You cannot start the database from sqlplus because the pfile and the spfile files were deleted. Connect to RMAN and type the following commands, which start the Oracle instance with a dummy parameter file.

    RMAN> connect target sys/sys@dbname RMAN> startup force nomount;
  3. On the RMAN command line, run the following sample script, substituting any required or optional Oracle SBT parameters.

    For information on required and optional SBT parameters, see SBT Parameters.

    run { 
    SET DBID 208759155;
    allocate channel ch1 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvInstanceName=Instance001)";
    allocate channel ch2 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvInstanceName=Instance001)";
    allocate channel ch3 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvInstanceName=Instance001)";
    allocate channel ch4 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvInstanceName=Instance001)";
    restore spfile  from autobackup ;
    startup force nomount;
    restore controlfile  from autobackup ;
    sql 'alter database mount';
    restore database ;
    recover database until time = "TO_DATE('JAN 07 2021 20:50:13', 'MON DD YYYY HH24:MI:SS')";
    alter database open resetlogs;
    }

Page contents

×

Loading...