May 5, 2013 at 11:15 am
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 ?
May 5, 2013 at 11:17 am
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
May 5, 2013 at 11:19 am
SQLRNNR (5/5/2013)
Your transaction would have been rolled back.
Even though I ran the checkpoint? Would you mind elaborating? Thanks a lot!
May 5, 2013 at 11:22 am
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
May 5, 2013 at 12:00 pm
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
May 6, 2013 at 8:44 am
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