Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL2012SP1, simple recovery, transaction log full, can't add another, won't grow


SQL2012SP1, simple recovery, transaction log full, can't add another, won't grow

Author
Message
f242337
f242337
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 34
SUMMARY:

I have many databases with full transaction logs. They are already in SIMPLE recovery model,
and I cannot add a new log or truncate the existing one, because the transaction log is full due to 'CHECKPOINT'


DETAILS:

(Examining just one of the problematic databases)

I have a SQL Server 2012 SP1 database with a full transaction log.

This database has one data file (750MB) and one log file (850MB)

Compatibility level = SQL Server 2012 (110)

Recovery Model is Simple
Under Recovery Options, Page Verify=CHECKSUM and Target Recovery Time=0

I had 5G of free disk (which should have been enough), and I added more, so now I have 25G free.

My log file growth is set to: "By 10 percent, Limited to 2097152 MB "
(I can't change it - if I try I get an error because the transaction log is full)

I can't do a backup - get an error because the transaction log is full due to 'CHECKPOINT'

I can't add another log file - get an error because the transaction log is full due to 'CHECKPOINT'

Verifying that file#2 is my log file

SELECT file_id, name FROM sys.database_files;



I can't do a truncate only shrink successfully:

DBCC SHRINKFILE (2, TRUNCATEONLY);


- get an error because my log is out of space - with a cascade error that the transaction log is full due to 'CHECKPOINT'

DBCC CHECKDB mostly just gives errors because the transaction log is full due to 'CHECKPOINT'

I can't change the recovery model to full - get an error because the transaction log is full due to 'CHECKPOINT'

I can't change the recovery model to bulk-logged - get an error because the transaction log is full due to 'CHECKPOINT'

From sys.databases,

is_read_only=0, state=0, state_desc=ONLINE, is_in_standy=0
is_cleanly_shutdown=0, is_supplemental_logging_enabled=0
is_read_committed_snapshot_on=0
recovery_model=3, recovery_model_desc=SIMPLE
is_fulltext_enabled=1
is_published=0, is_subscribed=0, is_merge_published=0, is_distributed=0, is_sync_with_backup=0
is_broker_enabled=1, log_reuse_wait=1, log_reuse_wait_desc=CHECKPOINT

I tried doing a manual CHECKPOINT (using the CHECKPOINT cmd in MgmtStudio) and got errors:



(1 row(s) affected)
Msg 5901, Level 16, State 1, Line 3
One or more recovery units belonging to database 'MYDATABASENAME' failed to generate a checkpoint. This is typically caused by lack of system resources such as disk or memory, or in some cases due to database corruption. Examine previous

entries in the error log for more detailed information on this failure.
Msg 9002, Level 17, State 1, Line 3
The transaction log for database 'MYDATABASENAME' is full due to 'CHECKPOINT'.



SELECT count(*) FROM fn_dblog (NULL, NULL);



4,521,289

That seems like a lot !?

My ERRORLOGs are full of errors about full transaction logs. I have many databases with this same issue - I've just focused on one, for testing.


DBCC OPENTRAN
gives me no open transactions


However,


select * from sys.dm_tran_database_transactions where database_id = MYDBID



gives me 6 rows, of which 4 have null begin times



I tried using

select request_session_id, * from sys.dm_tran_locks where resource_database_id = MYDBID and resource_subtype = 'BULKOP_BACKUP_LOG'



and killing those sessions, but they always come back immediately
Tommy Bollhofer
Tommy Bollhofer
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1166 Visits: 3359
Is it possible there are any uncommitted distributed transactions? What is the initial file size for the log file? Is the recovery interval value for the database set at the default of 0? Have you tried issuing a CHECKPOINT? Try with a duration of 5 or 10; i.e. CHECKPOINT 5

Tommy

Follow @sqlscribe
f242337
f242337
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 34
Tommy Bollhofer (5/14/2013)
Is it possible there are any uncommitted distributed transactions?


I ran "DBCC OPENTRAN" and got an empty response (detailed in post above). Sad

Is there something else possibly worth checking?


What is the initial file size for the log file?


The "initial file size" is 849MB now (I estimated it at 850MB in post above). As there are a couple hundred VLFs, it was no doubt small originally. I don't know the original setting.

Is the recovery interval value for the database set at the default of 0?


If you mean the "Target Recovery Time (Seconds)", that is still 0, as specified in post above. If you mean, can I change it from 0, I tried to change it to 2, but it fails with the (locally popular) message that the transaction log is full. Sad

If you mean something else, please excuse my ignorance and point me in a direction, and I'll go look.


Have you tried issuing a CHECKPOINT? Try with a duration of 5 or 10; i.e. CHECKPOINT 5


I tried it with no duration and got errors (detailed in post above).

If I try it with a checkpoint_duration of 5, (i.e., "CHECKPOINT 5"), I get the same error. Sad
f242337
f242337
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 34
Looking at


SELECT * FROM sys.dm_exec_requests where command like '%LOG%' or command like '%CHECKPOINT%' or wait_type like '%LOG%'


I see a CHECKPOINT command with a wait_type of LOGMGR_RESERVE_APPEND, and some other lines. I am suspicious that if I just had more knowledge, I could deduce something useful from the information in that view.
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21075 Visits: 18259
There is a fix for a similar issue in CU2 for SP1. Even if you did not upgrade these databases, I would try that CU.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

patrickmcginnis59 10839
patrickmcginnis59 10839
SSC Eights!
SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)

Group: General Forum Members
Points: 872 Visits: 5090
So this particular release and situation will not allow you to increase the existing log file size when it gets full?

to properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21075 Visits: 18259
I have not run into that bug with this release (2012 SP1). But it appears that it is out there and there is potential for it.
But it is safe to assume that since there is a fix for it in a CU, that you could end up in a situation where you will not be able to release log space without the CU.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

patrickmcginnis59 10839
patrickmcginnis59 10839
SSC Eights!
SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)SSC Eights! (872 reputation)

Group: General Forum Members
Points: 872 Visits: 5090
SQLRNNR (5/14/2013)
I have not run into that bug with this release (2012 SP1). But it appears that it is out there and there is potential for it.
But it is safe to assume that since there is a fix for it in a CU, that you could end up in a situation where you will not be able to release log space without the CU.


The reason I asked about just increasing the log size is that it was my understanding that increasing the log file size would add log space instead of trying to release existing log space (as they're probably in use), so I was seeing if my understanding was incorrect. Wouldn't be the first time!

to properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21075 Visits: 18259
patrickmcginnis59 10839 (5/14/2013)
SQLRNNR (5/14/2013)
I have not run into that bug with this release (2012 SP1). But it appears that it is out there and there is potential for it.
But it is safe to assume that since there is a fix for it in a CU, that you could end up in a situation where you will not be able to release log space without the CU.


The reason I asked about just increasing the log size is that it was my understanding that increasing the log file size would add log space instead of trying to release existing log space (as they're probably in use), so I was seeing if my understanding was incorrect. Wouldn't be the first time!


Operations of that nature are one at a time. So if a checkpoint is in progress, it has to complete in order for the file growth to be able to happen. The checkpoint (in laymans terms) releases log space. The file growth would be adding space.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Tommy Bollhofer
Tommy Bollhofer
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1166 Visits: 3359
FYI, I believe this was the fix SQLRNNR was referring too -

http://support.microsoft.com/kb/2509302

CU2 for SP1 available via -

http://support.microsoft.com/kb/2790947

Tommy

Follow @sqlscribe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search