The log segment in my Sql Server database has filled up...

  • Hi Folks,

    I would like to know how can i dump or truncate the log segment in my environment because no transactions can go through until the situation is cleared up. I don't have experience on it...

    Thanks in advance,

    Dan

  • Firstly backup your database and try

    DBCC SHRINKFILE

        ('Databasename',TRUNCATEONLY)


    Andy.

  • Thanks Andy for your suggest.

    Can i make it in an SQL Query Analyzer screen?

  • ...the DBCC Shrinkfile?

  • Hi Dan,

    Again, first backup your database, then try this:

    Use Master

    GO

    -- Truncating the transaction log

    BACKUP LOG <Database Name>

    WITH

    TRUNCATE_ONLY

    Use <Database Name>

    GO

    -- Shrink Physical File:

    DBCC SHRINKFILE ('<Database Logical Filename>', TRUNCATEONLY)

     

  • Do sequencywise you will get solution

    First Take backup if possible

    USE (Database Name Which Having Problem)

    GO

    CHECKPOINT

    GO

    SELECT * FROM SYSFILES /* NOTE DOWN THE LOG FILE NAME*/

    GO

    DBCC SHRIKFILE(LOGFILE NAME)

    GO

  • Sorry about the typo.. I ment logfile not database.....


    Andy.

Viewing 7 posts - 1 through 6 (of 6 total)

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