Log shipping & DBCC SHRINKFILE ('Database', 13) is it safe

  • Hi All,

    Just a simple question I think. I just want to bring confidence to what Iā€™m doing.

    I have removed 10GB of data. This data is not coming back. And so, I now want to reduce the size of the database. I am log shipping, and that poses a concern. As far as I have read and understand using the following command will have no affect on log shipping. Is this correct?

    I'm shrinking my database file to 85GB

    DBCC SHRINKFILE ('MyDatabase', 85000)

    Thanks in advance

    Russell MOrgan

  • If it helps, I had firstly "TESTED" my approach and it did work. The primary and the remote databases were shrunk and log shipping restores to the secondary continued. The only thing to consider is the backlog of transaction logs waiting to be restored whilst a database of 100 GB is shrunk to 85GB; I would need to extend the length of time I keep my transactions logs for. šŸ˜€

  • It's safe in that it won't break the log shipping. You will need to schedule an index rebuild afterwards, as shrink can severely fragment indexes.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Of course

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply