If your Oracle backup strategy requires you to secure more than 2 copies of the same backup to separate devices, this can be achieved using two methods:
- Using NetVault Backup GUI
- Or using Oracle RMAN CLI
To backup Oracle to 3 separate devices and restore from any online device, you can either use RMAN or NVBU GUI:
1) Using Oracle RMAN CLI:
- Backup with RMAN using SET BACKUP COPIES.
Here is an example on how to get an Oracle database with archive logs to 3 different devices - dev1, dev2 and dev3 being NVBU Target Set names each pointing to a separate device:
---------------------------
RMAN> run {
2> allocate channel ch1 type sbt;
3> set backup copies 3;
4> backup database plus archivelog
5> format ':dev1:::%d_%s_%t', ':dev2:::%d_%s_%t', ':dev3:::%d_%s_%t';
6> release channel ch1;}
---------------------------
- To restore please consider the following when using RMAN:
Using RMAN to restore is possible but introduces some important limitations. For instance, if dev1 and dev2 are offline, but dev3 is online, using RMAN CLI restore command to restore from dev3 will hang indefinitely until dev1 is back online.
This is because RMAN will only restore from the latest backup piece known to it and will ignore the 2 other copies.
Any attempt to use the RMAN RESTORE FROM command given the correct TAG or backup piece name will always result in the restore job hanging, waiting for the first device to come back up online.
RMAN will always be requesting the backup piece last known to it, even if the same backup was multiplexed to other devices.
To workaround this RMAN limitation, during restores use SQLPLUS dbms program instead.
Below is an example restore of tablespace USERS from the specific backup piece dev3. To retrieve the backup piece wanted use RMAN 'list backup;' command:
-------------------------------------------
SQL> alter tablespace USERS offline;
Tablespace altered.
SQL> declare
2 devtype varchar2(256);
3 done boolean;
4 BEGIN
5 devtype := dbms_backup_restore.deviceallocate('sbt_tape', params=>' '); dbms_backup_restore.restoresetdatafile;
6 dbms_backup_restore.RestoreDatafileTo (dfnumber=> 4); dbms_backup_restore.restorebackuppiece(':dev3:::ORAK_227_776343513_3',done=>done);
7 dbms_backup_restore.DeviceDeallocate;
8 END;
9 /
PL/SQL procedure successfully completed.
SQL> recover datafile 4;
Log applied.
Media recovery complete.
SQL> alter tablespace USERS online;
Tablespace altered.
--------------------------------------------
The above example applies to datafiles, therefore if other data types need to be restored, please see the dbms syntax for spfile, control file, and archivelogs e.g.:
dbms_backup_restore.RestoreArchivedLog (thread=>xx, sequence=>zz);
dbms_backup_restore.RestoreControlfileTo(cfname=>’<path>’);
...
2) Using NVBU GUI:
Copying an Oracle backup to 3 separate devices is possible using NVGUI and creating 2 jobs.
JOB#1 - Copy 1 and 2:
- Create an Oracle job by selecting all nodes and saving the Selection Set (it is important to have a Selection Set)
- Target the Phase1 backup to device1 and the Phase2 Duplication (not datacopy) to device2
- After completion of this backup job, this will create 1 saveset with 2 backup indexes located on 2 separate tapes, this is the same index but duplexed to 2 media.
JOB#2 - Copy 3:
- Create a Datacopy job by selecting the previously used selection set under "Backup Sets"
- Choose the Duplicate option of the datacopy plugin to perform the third copy (not the "independent" datacopy option).
- After completion of this datacopy job, this will create yet another copy of the original backup using the same index.
So in the Restore window you will see only 1 saveset but performing a right click > "Media List" on this saveset, will show the index is multiplexed to 3 different tapes.
- To restore from these copies, any online device that hosts this index will be used, even if the 2 others are offline as NVBU will locate the needed backup index on any available target.