Backup Oracle database with RMAN: full hot backup scripts

The following scripts were developed by me and being used by a federal contracting company for backing up Deltek Costpoint databases (Oracle 9i).

1, costpoint_rman_full_backup.txt

run
{
CROSSCHECK BACKUP;
CROSSCHECK archivelog all;
CROSSCHECK COPY;
CROSSCHECK backup of database;
CROSSCHECK backup of controlfile;
resync catalog;
DELETE noprompt backup completed before 'sysdate-7';
delete NOPROMPT obsolete redundancy 2;
DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;
allocate channel ch1 device type disk format 'L:\Rman_backup\%d_%u_%s_%p';
allocate channel ch2 device type disk format 'L:\Rman_backup\%d_%u_%s_%p';
# allocate channel ch3 device type disk format 'L:\Rman_backup\%d_%u_%s_%p';
#BACKUP INCREMENTAL LEVEL 0 tag = 'weekly_full_backup' database include current controlfile;
backup incremental level 0 tag = 'weekly_full_backup' ( database setsize 15000000 filesperset 1 include current controlfile );
sql 'alter system switch logfile';
sql 'alter system archive log current';
# BACKUP filesperset 1 archivelog all tag ='archive_log';
BACKUP filesperset 1 archivelog all tag ='archive_log' delete input;
# restore database validate;

#BACKUP VALIDATE DATABASE ARCHIVELOG ALL;
release channel ch1;
release channel ch2;
# release channel ch3;
}

run
{
allocate channel ch1 device type disk format ‘L:\Rman_backup\%d_%u_%s_%p';
#delete obsolete device type disk;
delete noprompt obsolete;
BACKUP SPFILE;
DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;
RELEASE CHANNEL ch1;
}
exit;

2. costpoint_rman_full_backup.bat

rman catalog rmansiit/xxx@rman target sys/xxx@SIIT_18 cmdfile C:\oracle\job\rman_costpoint\costpoint_rman_full_backup.txt log=C:\Oracle\job\rman_costpoint_logs\%date:~10,4%_%date:~4,2%_%date:~7,2%_full_log.txt

Tags:

March 22, 2007 at 10:25 pm

Leave a Comment