SHRINK LOG FILE IN SIMPLE RECOVERY MODEL.

  • HELLO,

    I consider my self as newbie in the DBA field, and this is my first topic in the forums.

    I took a .bak file in order to restore a db.When the restore completed,i came up with a

    a DB operating in SIMPLE RECOVERY MODEL and with a LOG file about 8GB.Since the data is not crucial

    I AM TAKING full BCK EVERY 8 HOURS.

    THE LOG FILE HAS MANY VLF, SINCE THE AUTOGROWTH POLICY WAS THE DEFAULT (1mb 10%) ,AND MANY OF THEM ARE INACTIVE.

    WHAT IS THE RECOMMNED WAY TO SHRINK THE LOG FILE PHYSICAL SIZE.

    JUST EXECUTE THE SHRINK FILE COMMAND ON THE LOG FILE?

    AND IS IT SAFE TO CHANGE THE LOG FILE SIZE AUTOGROWTH PROPERTY AFTER HE SHRINK OPREATION?

    THANKS IN ADVANCE

  • Firstly, DONT TYPE IN CAPS, its extremely rude 😉

    To shrink the log file the first step you have accomplished, setting recovery to simple. Next issue the following

    DBCC SHRINKFILE (Logfilename, 1)

    Post back any output

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (1/26/2014)


    Firstly, DONT TYPE IN CAPS, its extremely rude 😉

    To shrink the log file the first step you have accomplished, setting recovery to simple. Next issue the following

    DBCC SHRINKFILE (Logfilename, 1)

    Post back any output

    Perry thanks for the reply,

    My db is already on simple recovery so i will run the command

  • For more info on the log, take a read through this http://www.sqlservercentral.com/articles/Administration/64582/

    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

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

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