SQL Server 2014 table compression

techresearch7777777 1,881 Reputation points
2020-08-19T23:21:22.477+00:00

Hello, planning on running a SQL Agent Job to compress some Prod Tables which looks like will take a couple of hours to finish.

Is it correct to say that during this Tables (only) compression job just the target tables will be unavailable/locked and not the entire DB?

If yes will any Views that refer to these Tables also be unavailable/locked?

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,993 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. tibor_karaszi@hotmail.com 4,311 Reputation points
    2020-08-20T18:13:03.993+00:00

    I did a test and did a rebuild of a clustered index 4 times. 2 times offline and 2 times online. On both occasion, the online required about twice ad much space in the transaction log. Also, if you have users modifying the data while the index is being rebuilt, then you need space in tempdb for that.

    If you were on SQL Server 2019, you could do a resumable index rebuild. Stop it and truncate the log while it is paused.

    I, of course, assume full recovery model, since index rebuild is minimally logged in simple and bulk_logged.

    0 comments No comments

  2. techresearch7777777 1,881 Reputation points
    2020-08-20T22:11:47.287+00:00

    Thanks so much Tibor.

    We're using Simple Recovery.

    Please let me know if anything else I should take into consideration.

    Cheers.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.