Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    India
    Posts
    11

    Unanswered: Size of LDF file

    I have one database in which MDF file size is 120 MB while LDF file has expanded to 10GB. How can i reduce the size of LDF file.
    Pankaj Garg

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: Size of LDF file

    Originally posted by pankajgarg
    I have one database in which MDF file size is 120 MB while LDF file has expanded to 10GB. How can i reduce the size of LDF file.
    there are many ways to truncate the transaction log.
    If your recovery model is set to FULL, you should start backing up the transaction log. If you do not need to restore to a point in time, then change the recovery model to SIMPLE. To check your recovery model, just go to the properties of the database in Enterprise Manager. Check under Options for recovery model.


    You will also need to shrink the file in order to gain the disk space back. Look up DBCC SHRINKFILE in BOL.


    You can also delete the transaction log file by deattching the database, delete the .ldf and reattach the database again.
    make sure u take a backup first.
    regards,
    harshal.

  3. #3
    Join Date
    Sep 2003
    Location
    India
    Posts
    11

    Re: Size of LDF file

    Originally posted by harshal_in
    there are many ways to truncate the transaction log.
    If your recovery model is set to FULL, you should start backing up the transaction log. If you do not need to restore to a point in time, then change the recovery model to SIMPLE. To check your recovery model, just go to the properties of the database in Enterprise Manager. Check under Options for recovery model.


    You will also need to shrink the file in order to gain the disk space back. Look up DBCC SHRINKFILE in BOL.


    You can also delete the transaction log file by deattching the database, delete the .ldf and reattach the database again.
    make sure u take a backup first.
    regards,
    harshal.
    Thanks It solved my problem
    Pankaj Garg

  4. #4
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    In case you are using sql server 2000 ... open em ... right click on database ... all tasks ... shrink database ... shrink file button ..

    But all this after you have taken a backup.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  5. #5
    Join Date
    Feb 2004
    Posts
    2
    But if you changed recovery from full to simple,
    don't forget to change it back to full under Options

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •