Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Post Transaction Log Full Expand / Collapse
Author
Message
Posted Sunday, May 5, 2013 11:15 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 3:58 PM
Points: 44, Visits: 114
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 ?
Post #1449530
Posted Sunday, May 5, 2013 11:17 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:53 PM
Points: 21,617, Visits: 15,271
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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1449533
Posted Sunday, May 5, 2013 11:19 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 3:58 PM
Points: 44, Visits: 114
SQLRNNR (5/5/2013)
Your transaction would have been rolled back.


Even though I ran the checkpoint? Would you mind elaborating? Thanks a lot!
Post #1449534
Posted Sunday, May 5, 2013 11:22 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:53 PM
Points: 21,617, Visits: 15,271
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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1449536
Posted Sunday, May 5, 2013 12:00 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 42,747, Visits: 35,835
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 2008, MVP
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

Post #1449541
Posted Monday, May 6, 2013 8:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 3:58 PM
Points: 44, Visits: 114
Thanks for the explanation guys. Much appreciated.
Post #1449742
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse