RMAN> show all;
RMAN configuration parameters for database with db_unique_name xxxxx are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+FRA/bsquat/autobackup/%F';
----OR-----
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mnt/OracleBackup/BSQUAT/RmanOnline/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT '*';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_bsquat1.f';
------------------------------------------------ Limit Backup Piece size --------------------
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT 'sys/xxxx@target' MAXPIECESIZE = 500M;
----Optional to default auto backup location of Controlfile Configuration .---
RMAN> backup current controlfile format '/mnt/OracleBackup/BSQUAT/RmanOnline/FRA_%d_%T_%U.ctl';
RMAN> backup as backupset spfile format '/mnt/OracleBackup/BSQUAT/RmanOnline/FRA_%d_%T_%U.spfile';
Single Instance RMAN Configuration :
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name VOLDEV are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mnt/OracleBackup/voldev/RmanOnline/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/mnt/OracleBackup/voldev/RmanOnline/%d_%D%M%Y_s%s_p%p';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_voldev.f';
RMAN CRON JOB:
[oracle@vol-oracledev ~]$ crontab -l
00 22 * * 5 /fra/backupScript/backupFRIDAY.sh >> /fra/backupScript/backupFRIDAY.log 2>&1
00 22 * * 1-4 /fra/backupScript/backupMON2THU.sh >> /fra/backupScript/backupMON2THU.log 2>&1
----Script 1
backupFRIDAY.sh
#!/bin/bash
export DATE=$(date +%Y-%m-%d__%A_%H@%M@%S)
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=voldev
export PATH=$PATH:$ORACLE_HOME/bin
#export NLS_DATE_FORMAT=.DD-MON-YY HH24:MI:SS.
rman catalog rman/xxxx@voldev target sys/xxxxx@voldev msglog /fra/flash_recovery_area/VOLDEV/onlinelog/logs/rman_INCR_0_bk__voldev_${DATE}.log <<EOF
RUN
{
backup incremental level 0 device type disk tag '%TAG' database;
backup device type disk tag '%TAG' archivelog all not backed up;
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete device type disk;
crosscheck archivelog all;
delete noprompt expired archivelog all;
}
EXIT;
EOF
-----Script 2
backupMON2THU.sh
#!/bin/bash
export DATE=$(date +%Y-%m-%d__%A_%H@%M@%S)
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=voldev
export PATH=$PATH:$ORACLE_HOME/bin
#export NLS_DATE_FORMAT=.DD-MON-YY HH24:MI:SS.
rman catalog rman/xxxx@voldev target sys/xxxxx@voldev msglog /fra/flash_recovery_area/VOLDEV/onlinelog/logs/rman_INCR_1_bk__voldev_${DATE}.log <<EOF
RUN
{
backup incremental level 1 device type disk tag '%TAG' database;
backup device type disk tag '%TAG' archivelog all not backed up;
}
EXIT;
EOF
No comments:
Post a Comment