Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell Avamar for Oracle 19.10 User Guide

PDF

Restoring a database

To restore a database backup, you must specify a value from the control file name. Backups you perform from RMAN use the format, c.DBID-DATE-SEQ, for the control file name. Backups you perform with Avamar Administrator add a prefix to the control file name.

About this task

You can modify the default RMAN format of the control file by passing directives to RMAN scripts.

Avamar Administrator generates scripts that contain the RMAN directive, %F:

set controlfile autobackup format for device type sbt\
to "CONTROLFILE.%F";

The %F directive combines the DBID, date, and sequence to form the following control file name:

CONTROLFILE.c.DBID-DATE-SEQ

The sample scripts in this guide assume this format for the control file name.

The control file name contains a prefix when you use a backup that you created with Avamar Administrator for the restore. You must then add the prefix to the send command. The prefix must be the first directive. The following send command specifies “11g/orcl” as the prefix for an Oracle 11g database with a SID of orcl:

send '"--prefix=11g/orcl/" "--flagfile=/oracle/my-avtar-flags.txt"\
  "--taskfile=/oracle/taskfile.txt" "--bindir=install-dir/bin"';

The path that you specify by the --prefix option must contain a trailing slash (/). The direction of the slash does not change on Windows platforms.

The following procedure uses an RMAN script to restore an Oracle control file and database.

Steps

  1. Open a command shell.
  2. Log in to Oracle RMAN by using the Oracle user ID and password.
    The command prompt changes to an RMAN prompt.
  3. Connect to the Oracle database to restore.
  4. List all available backups by typing the list backup command:
    list backup;
  5. From the backup to be restored, retrieve the following information from the control file:
    1. Examine the database backup control file name.
    2. Note the values for the following variables:
      • DATE
      • DBID
      • SEQ
      Use the values of the DATE, DBID, and SEQ variables in the RMAN restore script.
  6. Restore the Oracle control file by typing the following RMAN commands:

    set dbid=DBID;
    set controlfile autobackup format for device type sbt to\
    'CONTROLFILE.%F';
    run {
    allocate channel c1 type sbt\
    PARMS="SBT_LIBRARY=install-dir/lib/libobk_avamar.so"\
    format '%d_%U';
    send '"--flagfile=/oracle/my-avtar-flags.txt"\
      "--taskfile=/oracle/taskfile.txt"\
    "--bindir=install-dir/bin"';
    restore controlfile from autobackup MAXSEQ=SEQ\
    until time = "TO_DATE('DATE','YYYYMMDD')";
    startup mount;
    release channel c1;
    list backup;
    }

    where:
    • DBID is the database ID.
    • install-dir is the base installation directory for the platform. For example, specify /usr/local/avamar on Linux, /opt/AVMRclnt on Solaris, C:\Progra~1\avs\bin on Windows.
    • YYYYMMDD is a date.
    The restore process copies the control file and puts the database in a mount state. A list of available database backups and corresponding system change numbers (SCN) appears in the command shell
  7. Locate and note the SCN that corresponds to the backup to use for the recover process:
    • To recover an archive log backup, locate and note the next SCN for the archive log.
    • To recover from a database backup, locate and note the SCN for the database.
    NOTE:In general, database control files are small and it is highly recommended a single channel is used for restoring the control file for achieving better performance.
  8. Log out of the RMAN session by typing the following command:
    exit
  9. Log in to Oracle RMAN by using the Oracle user ID and password.
    The command prompt changes to an RMAN prompt.
  10. Connect to the Oracle database to restore.
  11. Restore the Oracle database by typing the following RMAN commands:

    run {
    allocate channel c1 type sbt PARMS="SBT_LIBRARY=install-dir\
    /lib/libobk_avamar.so" format '%d_%U';
    send '"--flagfile=/oracle/my-avtar-flags.txt"\
      "--taskfile=/oracle/taskfile.txt"\
       "--bindir=install-dir/bin"';
    set until scn scn;
    restore database;
    recover database;
    release channel c1;
    }
    alter database open resetlogs;

    where:
    • scn is the next SCN value (noted in step 7) for the archive log recovery or the SCN value for the database.
    • install-dir is the base installation directory for the platform. For example, specify /usr/local/avamar on Linux, /opt/AVMRclnt on Solaris, C:\Progra~1\avs\bin on Windows.
    NOTE:If the restore process fails, you might need to perform manual recovery steps. ORA-19870: error while restoring backup piece provides more information.

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\