Checkpoints and the Transaction Log

  • I am trying to get a full understanding of checkpoints and logs. I am going to type my understanding of this and if I am incorrect, can someone please correct me? Thanks!

    It is easy with the database in simple recovery mode, so I wont go into it.

    Now, when in full recovery mode is where I am lost.

    A checkpoint, first, writes the dirty pages (pages which have been altered since being read into the buffer) back to the disk. This occurs whenever the recovery internal is met or when an alter database command is issued. It will look for the most current committed transaction and then take the MinLSN after that portion of the log and write everything before that MinLSN portion to the disk. It will not, however, truncate the log. (I assume is just reuses that space, but I am not sure).

    Now, when you run a BACKUP LOG statement in full recovery mode, it will backup the log up until that MinLSN and will then truncate the part of log from that portion of the log back.

    How far off am I?

    Michael

    P.S. I was not sure where to post it, so I also posted it under the "Backups" Topic

  • I'd say that you're pretty close to what happens with that, a backup log command will only go as far as the last committed transaction and then clear out everything before it.

  • I think you about have it, but I think it's just marked as truncated, or written to disk. The space will get resused eventually.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply