Oracle Blog

April 28, 2010

GZIP or COMPRESS – An Observation

Filed under: BattleAgainstAnyGuess,Clone,Oracle,Script,Uncategorized — Vikram @ 6:47 pm

Recently when investigating a very slow database backup operation, I had to spend some time deciding which command to use: gzip or compress. My observations are below.

Background:

The Database hot backup of 350G is taking 9 hours to complete. The shortest time the previous vendor could manage a hot backup was in 4.5 hours. It fell upon me to investigate what is causing the delay in the backup of the datafiles. One of the aspects we reviewed as part of determining the cause was to decide which command should be used: gzip or compress. The command gzip shrinked the files to smaller sizes when compared to compress. However, compress took less time to shrink the file than gzip.

In the below snapshot, there are files listed along with their actual sizes and sizes they have been shrunk using compress and gzip command. Almost always gzip shrunk the files to smaller sizes than compress. Almost always, compress took less time than gzip.

clip_image002

The above snapshot randomly selected seven files for the test.

GZIP took 9 hours but took 50G of space for entire database

COMPRESS took 5.30 hours but took 91G of space for entire database.

Command compress takes less time to shrink files. If we have time constraints but we can do with slightly bigger compressed files, then compress is the command.

Command gzip takes more time to shrink files. If we have space constraints but we can do with slightly bigger compression times, then gzip is the command.

The observation, though, that compress is right or gzip is right cannot be made generic. One should exercise one’s own discretion when deciding which command to be used. In our case, we decided to go with compress command to save on time.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.