Hi All,
Could any one please suggest what is the best way to enable data compression on tables and indexes where the database size is huge.
I'm currently working on a project where in I have to enable data compression on all tables and indexes across the environment. While performing this task on one of the server where the database size is around 400GB, I'm seeing that it is consuming lot of resources and taking a lot of time as well, so I had to stop my operation in between.
Later I have found the list of tables on which the data compression is not enabled within a database and started executing below query indivudually on each table, but even while running the below command against the single table alone which is of size around 2GB, it was taking more than 4 hours to complete and as the resource cosumption was high and the business hours started i had to stop the query in between.
EXEC sp_MSforeachtable 'ALTER TABLE dbalog REBUILD WITH (DATA_COMPRESSION = PAGE);'
I request you to please suggest the best possible way we can use to enable data compression on tables and indexes.
Thanks in Advance.