Advantages of SQL Server Backup Compression
Overview Of SQL Backup Compression in SQL Server
Compression is the process of reduction in bit number required for representing a data. At the database level, SQL server supports a new feature named as Backup Compression. The feature enables its user to create a backup file, whose size is smaller than the original backup file size. SQL server backup compressed file represents entire data of database in a compact form. Database in SQL server increases constantly and hence, users require a solution by which they can compress the backup file of SQL server.
Advantages of Compressing a Backup File in SQL Server
Basically, database backup compression feature in SQL server is a technique to convert an original database backup file of SQL server into another backup file, which has a smaller size than original file. Following are the advantages that explains the need to perform compression on backup file:
Reduces the Original File Size: The data of backup file is being processed in such a way that the size of compressed file is less than the original one. Therefore, such compressed files require less amount of storage space to archive the file.
Speed Up Transferring of Data: The compressed files require less time for transferring the backup file and hence, users will not have wait for long time for transferring large backup files.
Compression Without Any Data Loss: In SQL server, the application uses lossless compression techniques to compress the data in such a way that no data gets lost during the procedure. In other words, the data of uncompressed backup file and compressed backup file is identical.
Ease in Accumulating Database: After compressing large database backup file, it will be easy for computer users to store large amount of data at one place without any trouble.
Minimizes the Resource Utilization: By compressing backup file, one can minimize the consumption of resource i.e. minimize CPU utilization. Hence, this may increase the performance and speed of the server.
Measures to Perform An Effective SQL Server Backup Compression
After discussing all about backup compression in SQL server and its advantage, now we will learn how to perform the backup compression default server configuration in SQL server. Well, there exist two possible ways by which users can perform backup compression in SQL server. The first technique involves the configuration of backups with use of Compress Backup option, and the other technique is by configuring compression using T-SQL commands.
Solution 1: Compression Using T-SQL Commands
First execute the following script for starting server instance
Now activate an option to enable SQL server backup compression of a single backup file by executing following script:
To disk = N’ C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\back_compress.bak
The successful compression is dependent upon two factors and they are described below:
1. The type of data that your database (which is to be compressed) comprises of. For example: if your database backup file comprises of images with .jpg format, then the compression will not be of any use because there will be no difference in file size of the original backup file and compressed backup file.
2. If the source backup file is compressed/encrypted and user is performing compression on such file, then the compression will not be of so much benefit.
Solution 2: Compression Using Compress Backup Option
Another way of performing compression is by using settings of SQL server database. For doing so, perform right-click from your mouse on the instance name and open the Server Properties windows on your machine. From the properties screen, select Database Settings page and set the settings as per mentioned in following snapshot:
NOTE: One can determine the compression ratio by making use of two columns in backupset table of msdb database. Following T-SQL script will calculate the compression ratio of all backups, which are presently stored in backupset table:
In terms of performance and speed of SQL server, SQL server backup compression can provide users an enormous benefit. These benefits are thoroughly dependent on the database on which compression is to be performed. The main thing to take in consideration is to become aware of the advantages that are obtained from compression technique. Compression provides an ease to users to manage large amount of data with less storage space. Moreover, it is best concept for reducing the backup file size and hence, require less storage space to store and manage backup files of the server.