Post Transaction Log Full

  • Like2SQL

    SSCommitted

    Points: 1662

    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 ?

  • SQLRNNR

    SSC Guru

    Points: 281243

    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

  • Like2SQL

    SSCommitted

    Points: 1662

    SQLRNNR (5/5/2013)


    Your transaction would have been rolled back.

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

  • SQLRNNR

    SSC Guru

    Points: 281243

    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

  • Gail Shaw

    SSC Guru

    Points: 1004474

    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
  • Like2SQL

    SSCommitted

    Points: 1662

    Thanks for the explanation guys. Much appreciated.

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

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