I need bash example (good & effective rman bash example) of rman backup for my production database , simple but effective that
1- it does level 0 backup of database including the control file , spfile every week on saturdays
----------------------------- level 0
run
{
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/FULL_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/FULL_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/FULL_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/FULL_%U';
.....
backup as backupset incremental level 0 section size 32g database tag 'RMAN/FULL_L0' plus archivelog not backed up 2 times;
#control file backup
allocate channel ch_cntl device type disk format '/ZFS/DB_PRO/disk1/cf_%U';
backup as backupset CURRENT CONTROLFILE channel ch_cntl;
#spfile backup
allocate channel ch_sp device type disk format '/ZFS/DB_PRO/disk1/sp_%U';
backup as backupset SPFILE channel ch_sp;
DELETE NOPROMPT OBSOLETE;
}
----------------------------- level 1
run
{
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/INC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/INC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/INC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/INC_%U';
.....
backup as backupset incremental level 1 section size 32g database tag 'RMAN/LEVEL_L1' plus archivelog not backed up 2 times;
DELETE NOPROMPT OBSOLETE;
}
------------------------------
-------------------- archivelog backup
run
{
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/ARC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/ARC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk1/ARC_%U';
allocate channel ch01 device type disk format '/ZFS/DB_PRO/disk2/ARC_%U';
backup archivelog all not backed up 2 times;
delete noprompt archivelog until time '(sysdate-30)';
}
--------some rman configuration setting
RMAN> show all;
RMAN configuration parameters for database with db_unique_name DB_PRO are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 5;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ZFS/DB_PRO/disk1/auto/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+REC1/DB_PRO/snapcf_DB_PRO.f';