Does log shrink would affect any process happenning

  • I use the following script to shrink the logs, just wondering if it cause any problems doing it while some process happening on the database (like an update).

    USE XXXt;

    GO

    -- Truncate the log by changing the database recovery model to SIMPLE.

    ALTER DATABASE XXX

    SET RECOVERY SIMPLE;

    GO

    -- Shrink the truncated log file to 1 MB.

    DBCC SHRINKFILE (XXX_log, 1);

    GO

    -- Reset the database recovery model.

    ALTER DATABASE XXX

    SET RECOVERY FULL;

    GO

  • Well, that's a nice example of database abuse....

    Yes, that'll have multiple effects.

    First you've broken the log chain of the database and lost the ability to do point in time restore.

    The re-grow of the log (and it will have to regrow immediately) will slow down every data modification in your database.

    Stop shrinking your log and manage it properly.

    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
  • WE CAN SHRINK LOG FILE IN SIMPLE RECOVERY MODEL WHEN THERE IS NO NEED OF IN TIME RECOVERY.

    IF THAT IS TEST SERVER THEN OK.

    IF PRODUCTION THEN THIS PRACTICE IS WRONG.

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

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