With disk-based backups in the flash recovery area, you still have a big limitation: disk space. Especially when going across a network—as is usually the case—it's advisable to create as small a backup set as possible. In Oracle Database 10g RMAN, you can compress files inside the backup command itself:
RMAN>
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
setlimit channel d1 kbytes 1024000;
setlimit channel d2 kbytes 1024000;
backup format '/oradisk2/backups/ORATST/rman_%d_%t_%U.ctf' current controlfile;
backup format '/oradisk2/backups/ORATST/rman_%d_%t_%U.arf' filesperset 10 archivelog all;
backup as compressed backupset database format '/oradisk2/backups/ORATST/rman_%d_%t_%U.dtf';
release channel d1;
release channel d2;
}
exit;
Note the use of the clause COMPRESSED. It compresses backup files with an important difference: while restoring, RMAN can read the files without uncompressing. To confirm compression, check for the following message in the output:
channel d1: starting compressed full datafile backupset
Furthermore, you can verify that the backup was compressed by checking the RMAN list output:
RMAN> list backup of database;
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
49 Full 61.18M DISK 00:01:24 18-JUL-07
BP Key: 49 Status: AVAILABLE Compressed: YES Tag: TAG20070718T142021
Piece Name: /oradisk2/backups/ORATST/rman_ORATST_628266022_1pin5516_1_1.dtf
List of Datafiles in backup set 49
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 Full 386458 18-JUL-07 /oradisk1/oradata/ORATST/datafile/o1_mf_undotbs1_1zl14557_.dbf
3 Full 386458 18-JUL-07 /oradisk1/oradata/ORATST/datafile/o1_mf_sysaux_1zl14gvs_.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
50 Full 66.14M DISK 00:01:30 18-JUL-07
BP Key: 50 Status: AVAILABLE Compressed: YES Tag: TAG20070718T142021
Piece Name: /oradisk2/backups/ORATST/rman_ORATST_628266022_1oin5516_1_1.dtf
List of Datafiles in backup set 50
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 386456 18-JUL-07 /oradisk1/oradata/ORATST/datafile/o1_mf_system_1zl13ds1_.dbf
4 Full 386456 18-JUL-07 /oradisk1/oradata/ORATST/datafile/o1_mf_users_1zl150qk_.dbf
As with any compression process, this approach puts pressure on CPUs. As a tradeoff, you can keep more RMAN backups on disk that are readily available for restore-and-recover operations. Alternatively, you can make RMAN backups at the Physical Standby Database that can be used to recover the primary database. That approach will offload backup resourses to another host.
No comments:
Post a Comment