VMware vSphere

 View Only
  • 1.  Shrink database log file

    Posted Jan 28, 2008 11:14 AM

    Hi,

    The log file of my VC is getting huge about 19Gb right now. I am not familiar enough with SQL 2005 to reduce its size. I have try to shrink from SQL Server Management Studio but the size of the vc_log.ldf is staying the same.

    Any help greatly appreciated.



  • 2.  RE: Shrink database log file

    Posted Jan 28, 2008 12:57 PM

    You need to setup a backup job in sql and a scrinck job.. You can use the wizard in "server mgmt studio" - "Management" - "Maintenance plan."

    Try it out.



  • 3.  RE: Shrink database log file

    Posted Jan 28, 2008 02:19 PM

    Just made a maintenance plan to shrink the logs. Db size went from 20GB to 27GB....Now VC is not starting anymore....



  • 4.  RE: Shrink database log file

    Posted Jan 28, 2008 02:37 PM

    So you made a backup job first, then a shrink ?

    What is about the size of the logs did that change. ?

    So what made VC stop running... Did you stop it or did it crash ?



  • 5.  RE: Shrink database log file

    Posted Jan 28, 2008 02:40 PM

    My bad...forgot the backup job first. If i understand you correctly the logs will shrink only if i make a backup before?

    VC stopped during the maintenance plan apparently, once the sql server restarted i could logon again.



  • 6.  RE: Shrink database log file

    Posted Jan 28, 2008 02:56 PM

    As far as i know you should be able to scrink it anyway... as long as the "recovery model" for you database is NOT set to FULL...

    I would recommend "simple" if you remember to do backup on a regular basis. This should also keep the log smaller.

    You can set this option on the database properties and then options.

    But in the end a scrink job should not be able to crash you database. And SQL should not restart because it is doing a scrink hmm strange....



  • 7.  RE: Shrink database log file

    Posted Jan 28, 2008 03:37 PM

    The recovery model is set to bulk-logged.

    Would it be a good idea to set the db to auto-shrink?

    I still dont get why the logs are expanding when i shrink them!!!



  • 8.  RE: Shrink database log file
    Best Answer

    Posted Jan 29, 2008 08:56 AM


  • 9.  RE: Shrink database log file

    Posted Jan 29, 2008 09:28 AM

    Cool, setting the recovery model to siple and the shrink did it!

    Thanks for the help.