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:
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
Open a command shell.
Log in to Oracle RMAN by using the Oracle user ID and password.
The command prompt changes to an RMAN prompt.
Connect to the Oracle database to restore.
List all available backups by typing the
list backup command:
list backup;
From the backup to be restored, retrieve the following information from the control file:
Examine the database backup control file name.
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.
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
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.
Log out of the RMAN session by typing the following command:
exit
Log in to Oracle RMAN by using the Oracle user ID and password.
The command prompt changes to an RMAN prompt.
Connect to the Oracle database to restore.
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.