17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 14: Transactions and Locks<br />

Transaction 1<br />

Absolutely nothing would happen. The transaction has already been through a checkpoint and has been<br />

fully committed to the database. There is no need to do anything at recovery, because any data that is<br />

read into the data cache would already reflect the committed transaction.<br />

Transaction 2<br />

Even though the transaction existed at the time that a checkpoint was issued, the transaction had not been<br />

committed (the transaction was still going). Without that commitment, the transaction does not actually<br />

participate in the checkpoint. This transaction would, therefore, be rolled forward. This is just a fancy way<br />

of saying that we would need to read all the related pages back into cache, then use the information in<br />

the log to rerun all the statements that we ran in this transaction. When that’s finished, the transaction<br />

should look exactly as it did before the system failed.<br />

Figure 14-2<br />

Transaction 3<br />

432<br />

Transaction 1<br />

Checkpoint Checkpoint<br />

Transaction 2<br />

Transaction 5<br />

Checkpoint System Failure<br />

Transaction 3<br />

Transaction 4<br />

It may not look the part, but this transaction is exactly the same as Transaction 2 from the standpoint of<br />

what needs to be done. Again, because Transaction 3 wasn’t finished at the time of the last checkpoint, it<br />

did not participate in that checkpoint — just like Transaction 2 didn’t. The only difference is that Transaction<br />

3 didn’t even exist at that time, but from a recovery standpoint that makes no difference — it’s<br />

where the commit is issued that makes all the difference.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!