-- Some notes of putting together a simple but functional RMAN backup -- environment -- From the host, connect to RMAN, and to the target database # rman TARGET sys/password@SID ------------------------------------------------------------ -- Getting started, first time configurations -------------- ------------------------------------------------------------ RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 2G FORMAT '/nfs/SID/ora_df_%t_s%s_s%p'; RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS; RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/nfs/SID/controlfile_%F'; ------------------------------------------------------------ -- Level 0 (full) backup -------------- ------------------------------------------------------------ -- Once configured, script the following BACKUP INCREMENTAL LEVEL 0 DATABASE SPFILE PLUS ARCHIVELOG ; ------------------------------------------------------------ -- Level 1 (incremental, cumulative) backup -------------- ------------------------------------------------------------ BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE SPFILE PLUS ARCHIVELOG; ------------------------------------------------------------ -- Miscellaneous RMAN commands -------------- ------------------------------------------------------------ -- Periodically run the following to ensure that RMAN has enough valid -- backup files to recover if necessary BACKUP VALIDATE DATABASE ARCHIVELOG ALL; -- Remove older backup files no longer needed to satisfy the backup window DELETE OBSOLETE; ------------------------------------------------------------ -- Setup scripts runnable from cron -------------- ------------------------------------------------------------ -- Create a script file with the following. This is for level 0 backup, -- Create a second file for level 1 backups. Put both scripts in cron # vi SID-backup-level0.sh #!/bin/sh ORACLE_HOME= ORACLE_SID= PATH=$ORACLE_HOME/bin:$PATH export ORACLE_HOME ORACLE_SID PATH rman TARGET sys/password@SID <