1

Can I use external compression tools like WinZip, 7zip or winrar to compress rman backup files?

The DBMS is Oracle. A senior DBA claims that backups could be damaged by external compression tools. He argues that the tools shrink blocks which are not full and at a restore the database might have problems because control sums don’t match. I didn't find a source on that.

  • Have you ever zipped a file, then later when you unzipped it, the archive was damaged and could not be opened? How often does that happen? – Andrew Brennan Oct 19 '16 at 8:55
  • 1
    If you are using rman then you should indeed not touch the files. But rman can do compression on its own (but requires enterprise edition if I'm not mistaken) – a_horse_with_no_name Oct 19 '16 at 19:59
2

Since the backup is just a file, you can use whatever file tools there exists, including any and all compression tools.

In order to restore, you will ofcourse need to uncompress the file first.

A far better solution is to use any built-in compression of the backups from whatever sql engine you use. That saves both IO, space and time.

  • Using compression during your backup will make the backup itself take longer and use more cpu. It is usually favourable to take an uncompressed backup and then compress it later. – Andrew Brennan Oct 19 '16 at 8:55
  • 2
    Also don't forget that for anything other than BASIC compression, oracle advanced compression licence is required. – Phil Sumner Oct 19 '16 at 13:20
  • @AndrewBrennan: In my experience (mainly with MS SQL Server) compressing while you backup is far more efficient than after due to the lower I/O and/or network use (plain read & write for backup, then plain read & compressed write for the 2nd step) being vastly more significant than the CPU use. Of course if you are backing up over a network then there may be an advantage in CPUs separate from the active DB server doing that work, but that will only be significant if your DB instance(s) are already bottlenecked at the CPU (IO is usually the main bottleneck, with network bw/latency after that) – David Spillett Oct 19 '16 at 13:49
  • Yeah it will probably be fine, but the OP should be aware that there are costs and tradeoffs involved – Andrew Brennan Oct 19 '16 at 14:07
1

I have used Winzip to compress backup database file. Most of time it compresses 40% to 70% of original file.

  • If you don't have "as compressed backupset" as part of your backup command than you probably aren't doing compressed backups. In that case yes compressing the backup files will make a difference. If you take the highwater mark in every datafile and add it up, is that nearly the size of your backups? – Gandolf989 Oct 20 '16 at 13:53
1

I don't compress my backup sets, because that increases time to restore even further (e.g. now there's an extra step that includes "decompress backup files", which could take a significant amount of time.

The backup files are just files. As long as your tool doesn't do anything stupid with the files when it decompresses them, then they will end up identical to what they were at the beginning.

You can prove this by doing an MD5sum (or equivalent) on the file before zipping, and then zip it up, unzip it again and do another MD5sum. They should be identical.

1

You should have more than one backup on disk. As a part of the backup process you should crosscheck your backups and prune off older backups. Hence your control file and recovery catalog will track what backups are online and available every time you do a crosscheck backups. If you compress and rename your backup files your database will not know that they still exist. If you leave the files where they are when they are backed up, you won't have to move them to restore or duplicate your database.

Also since RMAN does compression starting in 10g, why not just let RMAN do the compression? You probably won't have smaller backup files if you backup as compressed data set. Make sure that your backup script is compressing the backup of the data files and archive log files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.