Post Transaction Log Full

  • I had a development database set to 'simple' recovery model which ran into a full transaction log error while executing a 'delete' query. I was able to resolve the issue by increasing the size of the X-action log, running a manual checkpoint. I then re-ran the query and it completed successfully.

    My question is about the last step - I re-ran the query. I did that because I understood that when the transaction log became full, not all the rows I intended to delete were actually deleted, and had to re-run to actually complete the deletion. Is this correct, or was this unnecessary ?

  • Your transaction would have been rolled back. Re-issuing the command would have been the right thing to do.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (5/5/2013)


    Your transaction would have been rolled back.

    Even though I ran the checkpoint? Would you mind elaborating? Thanks a lot!

  • Running the checkpoint has nothing to do with the transaction rollback caused by the error you encountered. Rollback would have been automatic

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • A transaction is an atomic operation, it completes entirely or not at all. A single-statement delete is a single transaction, no matter how many rows are deleted and as such must succeed or fail as a single operation. If the delete ran out of log space and failed, the entire delete would have to have rolled back.

    A manual checkpoint was probably not required, wouldn't have allowed the log to be reused with an active transaction in it. What most likely happened is that the log autogrow didn't happen fast enough and the delete failed and rolled back. Next automatic checkpoint the log was cleared and when you re-ran the delete there was enough space because the log had grown.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the explanation guys. Much appreciated.

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

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