When Amanda is configured and licensed for Oracle backup, Amanda Enterprise uses Oracle's RMAN and native OS tools to back up Oracle data files, control files, and archive logs.
There are two ways to backup Oracle using Amanda Enterprise:
Both methods can be configured using Zmanda Management Console.
The Oracle backup procedure using above methods using RMAN can be customized to suit customer needs. For example: Oracle backup can be customized to backup tablespaces only. For more information on how to customize Oracle backup, please email Zmanda Services ([email protected])
These instructions assume you have already installed and licensed the Amanda server and the Oracle server being backed up as described here. There are a number of additional steps. Both backup methods require the same configuration on the Oracle Server (Amanda Client).
define application-tool "app_amrman_user" { property "ORACLE-GROUP" "dba" }
# id oracle uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
Determine the gid, and modify group membership for the amandabackup user:
# usermod -G oinstall amandabackup
Confirm that the change was made correctly:
# id amandabackup uid=502(amandabackup) gid=6(disk) groups=6(disk),501(oinstall)
SID
For further details on Oracle parameters, see man amoracle and man amrman; these man pages are installed on the server along with Amanda Enterprise Edition.
Lastly, make sure that all Oracle databases selected for backup are mounted and open. For restore, the databases should be mounted but closed.
After you have prepared the Amanda client/Oracle Server by editing the amanda-client.conf file as described above, you can use the ZMC to configure and schedule Oracle backups. You can add Oracle databases as a DLE to a backup set. It is recommended that you use separate backup sets for Oracle databases.
On the Backup What page you are prompted to select what type of object you want to back up. Choose Oracle on Linux/Solaris under Databases, and the following options are displayed:
Click Add or Update. Make sure Check Hosts is successful. You can then configure the backup set just as you would any other by setting the options on Backup Where, Backup How, and Backup When, etc.
Restoration involves two main steps:
If RMAN was specified as the Custom Application on the Backup What page, you will need to make RMAN aware of the Amanda media before a restore can be completed. After restoring from the ZMC as described above, follow these steps:
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE '/home/oracle_restore/5kk8v9pt_1_1';
or a RUN {} block can be written for the same. For example:
RUN
{
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/4skbv4ic_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/4tkbv4k2_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/4ukbv4ln_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/4vkbv4nc_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/50kbv4p2_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/51kbv4qn_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/52kbv4sc_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/53kbv4u2_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/54kbv4vo_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/55kbv57j_1_1.17';
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE
'/home/oracle_restore/56kbv581_1_1.17';
}
Verify all catalog'ed backup pieces using list backup RMAN command.
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Full Unknown SBT_TAPE 00:00:26 17-DEC-09
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20091217T043756
Handle: /home/oracle_restore/system_<wbr/>tbs/09l13rl4_1_1.17 Media:
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 675339 17-DEC-09 /u02/oradata/db10g/system01.<wbr/>dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Full Unknown SBT_TAPE 00:00:02 17-DEC-09
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20091217T043756
Handle: /home/oracle_restore/system_<wbr/>tbs/0al13rm8_1_1.17 Media:
Control File Included: Ckp SCN: 675370 Ckp time: 17-DEC-09
SPFILE Included: Modification time: 16-DEC-09
RMAN is now configured to complete the Oracle recovery as described below.
Before running RMAN, you may want to read "Using RMAN for Restores" from the Oracle documentation.
Start RMAN for all the databases being restored. These databases should be mounted but closed. Execute RMAN RESTOREcommands to restore from the directory created above. Execute the RMAN RECOVER command after the RESTORE is successful. When you are done, you can delete the directory you created for the recovery.
RMAN command example to restore and recover the deleted data file from one of the tablespaces.
RMAN> restore datafile '/u02/oradata/ORCL/datafile/zmanda_tsp.dfb';
Starting restore at 03-MAR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=130 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=128 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: AMANDA MEDIA MANAGEMENT LIBRARY FOR ORACLE
channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00005 to
/u02/oradata/ORCL/datafile/zmanda_tsp.dfb
channel ORA_SBT_TAPE_1: reading from backup piece 5kk8v9pt_1_1
channel ORA_SBT_TAPE_1: errors found reading piece handle=5kk8v9pt_1_1
channel ORA_SBT_TAPE_1: failover to piece
handle=/u02/oracle_bkp_test/restore/5kk8v9pt_1_1
tag=TAG20090303T043820
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
Finished restore at 03-MAR-09
RMAN> recover datafile '/u02/oradata/ORCL/datafile/zmanda_tsp.dfb';
Starting recover at 03-MAR-09
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 03-MAR-09
Online the tablespace that had missing data file or corrupted data file. Oracle will perform tablespace recovery.