RMAN Full Compressed backup and Maintenance in 11g
Master batch file calling script
<<Full_Rman.bat>>set oracle_sid=<Oracle_SID>
set oracle_home=E:\oracle\product\11.1.0\db_1
echo Starting backup on .... %date:~-7,2%%date:~-10,2%%date:~-4,4% >> full_Rman.log
rman target sys/<PASSWORD> @g:\backup\full_Rman.rcv LOG g:\backup\full_Rman.rcv APPEND
Full database script
<<Script Name : full_Rman.rcv>>-- Run as sys on rman prompt
rman> connect target sys/<PASSWORD>
RUN
{
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT 'd:\OraBack\b_%U';
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG DELETE INPUT;
}
Maintenance Script
<<Script Name: Maint_Rman.rcv>>-- Run as sys on rman prompt
rman> connect target sys/<PASSWORD>
RUN
{
Crosscheck archivelog all;
delete expired archivelog all;
crosscheck backup;
delete expired backup;
delete obsolete;
}
Configuration for full backup
Login to RMAN with sys user and set the below configuration :--- Sample RMAN configuration for full backup with retention period of 3 days
-- Run as sys on rman prompt
rman> connect target sys/<PASSWORD>
RMAN configuration parameters for database with db_unique_name <Oracle_SID> are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
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 '%F'; # default
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 'BZIP2';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\11.1.0\DB_1\DATABASE\SNCF<ORACLE_SID>.ORA'; # default
Note: Please do not use the scripts on production until you tried on test environment
No comments:
Post a Comment