Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

rman hot backup

934853Jun 26 2012 — edited Jun 29 2012
hello

i am using rman hot backup script to take backup database everyday but the problem is it is working but not deleting old backup older than 2 days .

also i have question .. my database is in archive log mode and everyday about 6-7 .arch files generating in my archive directory.
it is not deleting the old files but generating new files everyday so adding up to the space.



SQL> show parameter archive

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
log_archive_config string
log_archive_dest string /u03/archive_logs/DEVL
log_archive_dest_1 string



also should i set dest_1 as archive location or just log_archive_dest
whats is the difference.?





my rman script is





RMAN Hot backup.unix script
*******************************************

The RMAN hot backup script rman_backup.sh:
# !/bin/bash

# Declare your environment variables
export ORACLE_SID=DEVL
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export PATH=$PATH:${ORACLE_HOME}/bin

# Start the rman commands
rman target=/ << EOF
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/backup/autobackup_control_file%F';
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;

ALLOCATE CHANNEL RMAN_BACK_CH01 TYPE DISK;
CROSSCHECK BACKUP;
BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT '/u03/backup/databasefiles_%d_%u_%s_%T';
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/u03/backup/archivelogs_%d_%u_%s_%T' DELETE INPUT;
BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FORMAT '/u03/backup/controlfile_%d_%u_%s_%T';
CROSSCHECK BACKUP;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
RELEASE CHANNEL RMAN_BACK_CH01;
}
EXIT;
EOF

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2012
Added on Jun 26 2012
6 comments
2,431 views