Translate

Search This Blog

compressed archivelog backup set in 11g

Oracle 10g brought compressed backupset feature which is wonderful especially when backing up large data warehouse databases. This not only saves the disk space but also the backup time is reduced. This comes at only little price of CPU. But archivelogs could not be compressed in 10g. From 11g onwards archive logs also can be compressed as backup set.

RMAN> backup as compressed backupset archive log from sequence=2000

RMAN> backup as compressed backupset archive log from sequence=2000 until time sysdate-10*1/1440

If any of archive logs is physicall deleted then archive log backup can fail. In this case
RMAN> change archivelog all validate or RMAN>crosscheck archivelog all comes handy.

If you are in oracle 10g you can backup archive logs using below shell script

#!/bin/bash
# change directory to archive log location
cd /apps/oracle/archive_logs
# it is assumed log_archive_format has .arc in last
ls -t *.arc >file_list
# sed is used to leave latest two archive logs from compression as they might be stilll being generated
cat file_list|sed '1,2d'>file_list_to_compress
for file in `cat file_list_to_compress`
do
gzip $file
done

Follow by Email