+ Post New Thread
Results 1 to 2 of 2
How do you do....it? Thread, SQL log files not truncating in Technical; I've got a SQL 2005 server (for Sage mainly); I'm pretty sure I've set up the backup job correctly, followed ...
  1. #1
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    948
    Thank Post
    544
    Thanked 128 Times in 106 Posts
    Rep Power
    60

    SQL log files not truncating

    I've got a SQL 2005 server (for Sage mainly); I'm pretty sure I've set up the backup job correctly, followed by a shrink database task, but the ldfs are still 400MB+

    This is the SQL generated by the shrink task - any ideas why the logs aren't shrinking each time?

    Code:
    USE [Sage200_DemoData]
    GO
    DBCC SHRINKDATABASE(N'Sage200_DemoData', 10, TRUNCATEONLY)
    GO
    USE [S200_CPSLive_TC]
    GO
    DBCC SHRINKDATABASE(N'S200_CPSLive_TC', 10, TRUNCATEONLY)
    GO
    USE [S200_CPS_GoLiveFinal]
    GO
    DBCC SHRINKDATABASE(N'S200_CPS_GoLiveFinal', 10, TRUNCATEONLY)
    GO
    USE [s200_CPS_0405]
    GO
    DBCC SHRINKDATABASE(N's200_CPS_0405', 10, TRUNCATEONLY)
    GO
    USE [s200_CPS_0506]
    GO
    DBCC SHRINKDATABASE(N's200_CPS_0506', 10, TRUNCATEONLY)
    GO
    USE [s200_CPS_0607]
    GO
    DBCC SHRINKDATABASE(N's200_CPS_0607', 10, TRUNCATEONLY)
    GO
    USE [s200_CPS_0708]
    GO
    DBCC SHRINKDATABASE(N's200_CPS_0708', 10, TRUNCATEONLY)
    GO
    USE [s200_CPS_0908]
    GO
    DBCC SHRINKDATABASE(N's200_CPS_0908', 10, TRUNCATEONLY)
    GO
    USE [Cartmel0910]
    GO
    DBCC SHRINKDATABASE(N'Cartmel0910', 10, TRUNCATEONLY)
    GO
    USE [Cartmel1011]
    GO
    DBCC SHRINKDATABASE(N'Cartmel1011', 10, TRUNCATEONLY)
    GO
    USE [Terms]
    GO
    DBCC SHRINKDATABASE(N'Terms', 10, TRUNCATEONLY)

  2. #2
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    948
    Thank Post
    544
    Thanked 128 Times in 106 Posts
    Rep Power
    60
    Sorted it - you have to do a specific transaction log backup immediately before truncating the LDF

SHARE:
+ Post New Thread

Similar Threads

  1. MSSQL Log Files are MASSIVE!!!!
    By Sam_Brown in forum Enterprise Software
    Replies: 11
    Last Post: 5th July 2011, 09:29 AM
  2. RM CC3 Log Files
    By soapyfish in forum Windows Server 2000/2003
    Replies: 11
    Last Post: 23rd June 2011, 01:07 PM
  3. Replies: 23
    Last Post: 12th October 2010, 02:59 PM
  4. sql 2008 shrink log file
    By ful56_uk in forum Windows Server 2008
    Replies: 2
    Last Post: 26th May 2010, 07:45 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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