Common scripts:
----- Level 1. 0 backup
Batch file:
Set Oracle_SID = orcl
Rman target sys/test @ orcl prepare file ='s:/backup/scripts/0/db_fullbakup_orcl.rman 'Log ='s:/backup/LOG/rman_backup _ % DATE :~ 0, 4% % DATE :~ 5, 2% % DATE :~ 8, 2%. Log'
Rman script:
Run {
Configure retention policy to recovery window of 14 days;
Configure controlfile autobackup on;
Configure controlfile autobackup format for device type disk to's: \ backup \ controlfile \ bak _ % F ';
Allocate channel c1 device type disk format's: \ backup \ data \ bak _ % U ';
Allocate channel c2 device type disk format's: \ backup \ data \ bak _ % U ';
Backup incremental level = 0 database skip inaccessible
Plus archivelog filesperset 20
Delete all input;
Release channel c1;
Release channel c2;
}
Allocate channel for maintenance device type disk;
Crosscheck backupset;
Delete noprompt obsolete;
----- Level 2 backup
Batch file:
Set ORACLE_SID = orcl
Rman target sys/test @ orcl prepare file ='s:/backup/scripts/1/db_fullbakup_orcl.rman 'Log ='s:/backup/LOG/rman_backup _ % DATE :~ 0, 4% % DATE :~ 5, 2% % DATE :~ 8, 2%. Log'
Rman script:
Run {
Configure retention policy to recovery window of 14 days;
Configure controlfile autobackup on;
Configure controlfile autobackup format for device type disk to's: \ backup \ controlfile \ bak _ % F ';
Allocate channel c1 device type disk format's: \ backup \ data \ bak _ % U ';
Allocate channel c2 device type disk format's: \ backup \ data \ bak _ % U ';
Backup incremental level = 1 cumulative database skip inaccessible
Plus archivelog filesperset 20
Delete all input;
Release channel c1;
Release channel c2;
}
Allocate channel for maintenance device type disk;
Crosscheck backupset;
Delete noprompt obsolete;