It is important to understand that SQL Server database on compressed volumes are not supported. This blog will help you understand the differences between SQL 2000 and SQL 2005 w.r.t compressed drives.
SQL 2000
In SQL Server 2000, you could create a new database with its .mdf and .ldf files located on NTFS or FAT compressed drives. The interface doesn’t restrict you from doing this.
However, it is NOT a good idea and is NOT supported. For more details, refer to KB 231347.
SQL 2005
As opposed to SQL 2000, SQL 2005 doesn’t even allow you to place data and log files of Read/Write databases on compressed volumes. Let’s examine two scenarios.
· Let’s create a database called Compressed_DB with .mdf and .ldf files located on a compressed file system (E drive in my case here). You will get an error:
Create failed for Database 'Compressed_DB'. (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The file "E:\Compressed_DB.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5118)
This is because a read/write database’s primary .mdf and .ldf files cannot be created on a compressed volumes in SQL 2005.
Restore failed for Server '<servername>'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: The file "e:\Db.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed. (Microsoft.SqlServer.Smo)
A word about Read-Only file-groups/Read-Only databases in SQL 2005
However, there are special scenarios in which SQL 2005 allows you to store the data and log files on compressed drives.
For more information on read-only filegroups, refer to the BOL here.
In Conclusion
Because of performance overhead and database recovery issues (as described in KB 231347), it is not a good idea to run SQL Server databases on compressed drives.
Moreover, such installations are NOT supported.
Hope this helps!
POSTED BY : Sanchan Saxena