The dump command includes a compress option that allows you to compress databases and transaction logs using Backup Server.
Table 28-5 The shows the syntax for dump database … compress and dump transaction … compress commands is:
Backing up a database or log |
Loading a database or log |
|
---|---|---|
dump {database | tran} database_name to |
load {database | tran} database_name from |
|
Compress option |
[compress::[compression_ level::]] |
[compress::] |
stripe_device [at server_name] [density = density, blocksize = number_bytes, capacity = number_kilobytes, dumpvolume = volume_name, file = file_name] [stripe on |
stripe_device} [at server_name] [density = density, dumpvolume = volume_name file = file_name] [stripe on |
|
Compress option |
[compress::[compression_ level::]] |
[compress::] |
stripe_device [at server_name] [density = density, blocksize = number_bytes, capacity = number_kilobytes, dumpvolume = volume_name, file = file_name] ...] [with{ density = density, blocksize = number_bytes, capacity = number_kilobytes, dumpvolume = volume_name, file = file_name, [nodismount | dismount], [nounload | unload], retaindays = number_days, [noinit | init], [notify = {client | operator_console}] standby_access}] |
stripe_device [at server_name] [density = density, dumpvolume = volume_name, file = file_name] ...] [with{ density = density, dumpvolume = volume_name, file = file_name, [nodismount | dismount], [nounload | unload], [notify = {client | operator_console}]}] |
The partial syntax specific to dump database … compress and dump transaction … compress is:
dump database database_name to compress::[compression_level::]stripe_device …[stripe on compress::[compression_level::]stripe_device] …
dump transaction database_name to compress::[compression_level::]stripe_device …[stripe on compress::[compression_level::]stripe_device]…
Where database_name is the database you are loading into, and compress::compression_level is a number between 0 and 9, with 0 indicating no compression, and 9 providing the highest level of compression. If you do not specify compression_level, the default is 1. stripe_device is the full path to the archive file of the database or transaction log you are compressing. If you do not include a full path for your dump file, Adaptive Server creates a dump file in the directory in which you started Adaptive Server.
Use the stripe on clause to use multiple dump devices for a single dump. See “Specifying additional dump devices: the stripe on clause” for more information about the stripe on clause.
The compress option works only with local archives; you cannot use the servername option.
dump database pubs2 to "compress::4::/opt/bin/Sybase/dumps/dmp090100.dmp”
Backup Server session id is: 9. Use this value when executing the 'sp_volchanged' system stored procedure after fulfilling any volume change request from the Backup Server. Backup Server: 4.132.1.1: Attempting to open byte stream device: 'compress::4::/opt/bin/Sybase/dumps/dmp090100.dmp::00' Backup Server: 6.28.1.1: Dumpfile name 'pubs2002580BD27 ' section number 1 mounted on byte stream 'compress::4::/opt/bin/Sybase/dumps/dmp090100.dmp::00' Backup Server: 4.58.1.1: Database pubs2: 394 kilobytes DUMPed. Backup Server: 4.58.1.1: Database pubs2: 614 kilobytes DUMPed. Backup Server: 3.43.1.1: Dump phase number 1 completed. Backup Server: 3.43.1.1: Dump phase number 2 completed. Backup Server: 3.43.1.1: Dump phase number 3 completed. Backup Server: 4.58.1.1: Database pubs2: 622 kilobytes DUMPed. Backup Server: 3.42.1.1: DUMP is complete (database pubs2).
The compression_level must be a number between 0 and 9. The compress option does not recognize numbers outside this range, and treats them as part of the file name while it compresses your files using the default compression level. For example, the following syntax creates a file called 99::pubs2.cmp, which is compressed with the default compression level of 1:
dump database pubs2 to "compress::99::pubs2.cmp"
In general, the higher the compression numbers, the smaller your archives are compressed into. However, the compression result depends on the actual content of your files.
Table 28-6 shows the compression levels for the pubs2 database. These numbers are for reference only; the numbers for your site may differ depending on OS level and configuration.
Compression levels |
Compressed file size |
---|---|
No compression/Level 0 |
630K |
Default compression/Level 1 |
128K |
Level 2 |
124K |
Level 3 |
121K |
Level 4 |
116K |
Level 5 |
113K |
Level 6 |
112K |
Level 7 |
111K |
Level 8 |
110K |
Level 9 |
109K |
The higher the compression level, the more CPU-intensive the process is.
For example, you may not want to use a level-9 compression when archiving your files. Instead, consider the trade-off between processing effort and archive size. Compression level 6 provides optimal CPU usage, producing an archive that is 60 percent to 80 percent smaller than a regular uncompressed archive. Sybase recommends that you initially use compression level 6, then increase or decrease the level based on your performance requirements.
For complete syntax information about dump database and dump transaction, see the Reference Manual.