Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Shrink DB using Maintenance Plan does not affect the log file size

Shrink DB using Maintenance Plan does not affect the log file size

Scheduled Pinned Locked Moved Database
databasehelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    obarahmeh
    wrote on last edited by
    #1

    Dear All, I need to reduce the log file size... I've created a maintenance plan for shrinking the DB in my local machine, I've created every thing ok and scheduled it to work daily. and when I right click and then execute, the dialog displays successful process, but when I check the DB Log, it still huge size (about 20 Gb). I do not know why the log file size still huge after shrinking the DB. Any help, plz???

    Kind Regards OBarahmeh

    B 1 Reply Last reply
    0
    • O obarahmeh

      Dear All, I need to reduce the log file size... I've created a maintenance plan for shrinking the DB in my local machine, I've created every thing ok and scheduled it to work daily. and when I right click and then execute, the dialog displays successful process, but when I check the DB Log, it still huge size (about 20 Gb). I do not know why the log file size still huge after shrinking the DB. Any help, plz???

      Kind Regards OBarahmeh

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Did you try gogole search?[^]


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      O 1 Reply Last reply
      0
      • B Blue_Boy

        Did you try gogole search?[^]


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        O Offline
        O Offline
        obarahmeh
        wrote on last edited by
        #3

        Ok, I've found the solution: USE yourDB; GO -- Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE yourDB SET RECOVERY SIMPLE; GO -- Shrink the truncated log file to 1 MB. DBCC SHRINKFILE (yourDB_Log, 1); GO -- Reset the database recovery model. ALTER DATABASE yourDB SET RECOVERY FULL; GO

        Kind Regards OBarahmeh

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups