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 123»»»

SQL2012SP1, simple recovery, transaction log full, can't add another, won't grow Expand / Collapse
Author
Message
Posted Saturday, May 11, 2013 10:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 17, 2013 12:35 PM
Points: 16, 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

Post #1451836
Posted Tuesday, May 14, 2013 6:55 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, July 21, 2014 12:34 PM
Points: 1,157, Visits: 3,255
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

Post #1452546
Posted Tuesday, May 14, 2013 3:25 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 17, 2013 12:35 PM
Points: 16, 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).

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.

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.

Post #1452863
Posted Tuesday, May 14, 2013 3:33 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 17, 2013 12:35 PM
Points: 16, 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.
Post #1452865
Posted Tuesday, May 14, 2013 4:11 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 11:05 AM
Points: 21,349, Visits: 15,023
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


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 #1452872
Posted Tuesday, May 14, 2013 4:17 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 389, Visits: 2,318
So this particular release and situation will not allow you to increase the existing log file size when it gets full?
Post #1452874
Posted Tuesday, May 14, 2013 4:30 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 11:05 AM
Points: 21,349, Visits: 15,023
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


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 #1452876
Posted Tuesday, May 14, 2013 5:08 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 389, Visits: 2,318
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!
Post #1452883
Posted Tuesday, May 14, 2013 5:40 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 11:05 AM
Points: 21,349, Visits: 15,023
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


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 #1452885
Posted Tuesday, May 14, 2013 7:54 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, July 21, 2014 12:34 PM
Points: 1,157, Visits: 3,255
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

Post #1452898
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse