Here an easy script to run a backup an in this case with a 30 day retention:
[oracle@hostname]$ pwd
/backup/backup_DB
[oracle@hostname]$ cat db_backup.cmd
RUN
{
allocate channel dsk1 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk2 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk3 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk4 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk5 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk6 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk7 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk8 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk9 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk10 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk11 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk12 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk13 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk14 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk15 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
allocate channel dsk16 type disk format '/backup/backup_DB/DB_%u_%p_%c_%s_%t';
backup incremental level 0 tag "backup_DB_MAR2021" as compressed backupset database INCLUDE CURRENT CONTROLFILE PLUS ARCHIVELOG filesperset 128 keep until time 'sysdate+30';
}
[oracle@hostname]$
Just load DB env variables and execute:
[oracle@hostname]$ nohup rman target / cmdfile=db_backup.cmd msglog=db_backup.log &
[1] 256506
[oracle@hostname]$ jobs
[1]+ Running nohup rman target / cmdfile=db_backup.cmd msglog=db_backup.log &
[oracle@hostname]$
[1]+ Done nohup rman target / cmdfile=db_backup.cmd msglog=db_backup.log
[oracle@hostname]$
**files will be left under /backup/backup_DB
Comments