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

Checkpoint - Log Backups Expand / Collapse
Author
Message
Posted Saturday, October 13, 2012 1:01 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:21 AM
Points: 1,379, Visits: 2,694
Hello All

I've been doing some research and testing on the topic of the Checkpoint process

I understand that the job of the checkpoint process is to write dirty pages to disk and it also writes an entry in the log indicating that all transactions before that point are written to disk, reducing database recovery time when the database starts up. Thanks http://sqlinthewild.co.za/index.php/2009/06/26/the-lazy-writer-and-the-checkpoint/

My question is, if I run a transaction against my database and I run a log backup before the checkpoint process starts, does that transaction form part of the active or inactive portion of the log?

In other words, does a checkpoint process have to run to declare the transaction complete and part of the inactive portion of the log?

Thanks

Post #1372457
Posted Saturday, October 13, 2012 2:29 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 @ 2:09 PM
Points: 40,193, Visits: 36,597
Active. The log records are still needed by something, in this case the checkpoint.

A VLF is only inactive when none of the log records in it are needed for anything.



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 #1372465
Posted Saturday, October 13, 2012 2:50 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:21 AM
Points: 1,379, Visits: 2,694
GilaMonster (10/13/2012)
Active. The log records are still needed by something, in this case the checkpoint.

A VLF is only inactive when none of the log records in it are needed for anything.


Thanks

I was trying to figure out why after running a log backup the fn_dblog(null,null) command still returns entries in the log.

I did notice that if I issue a checkpoint command and then take the log backupm the fn_dblog(null,null) only shows the checkpoint entries.

What would happen in a case where the recovery interval was set to something like every 5 hours, wouldn't that be harmful to the log?

Thanks
Post #1372469
Posted Saturday, October 13, 2012 4:24 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:21 AM
Points: 1,379, Visits: 2,694
GilaMonster (10/13/2012)
Active. The log records are still needed by something, in this case the checkpoint.

A VLF is only inactive when none of the log records in it are needed for anything.


Would it be correct to say that in order for a transaction to be cleared from the log through a log backup, the transaction has to be commited and there has to be a checkpoint ?

Is this right?

Thanks

Post #1372476
Posted Sunday, October 14, 2012 1:57 AM


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 @ 2:09 PM
Points: 40,193, Visits: 36,597
For a VLF to be marked inactive by a log backup, none of the log records within that VLF must be needed for anything. Anything includes checkpoint, active transaction, replication, mirroring, CDC and a few other things.


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 #1372485
Posted Sunday, October 14, 2012 4:28 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 8:21 AM
Points: 1,379, Visits: 2,694
GilaMonster (10/14/2012)
For a VLF to be marked inactive by a log backup, none of the log records within that VLF must be needed for anything. Anything includes checkpoint, active transaction, replication, mirroring, CDC and a few other things.


Thanks
Post #1372492
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse