INF: Recoverability and Transaction Log DumpsID: Q72783
|
The following information describes how to preserve recoverability while using the DUMP TRANSACTION command to shrink the transaction log.
In the past, some Microsoft documentation has advised that after each
full database dump, a transaction dump with truncate only should be
executed to remove all inactive transactions from the log, thereby
reducing its size. The following is a brief explanation of why this
could cause problems during database recovery.
Whenever a dump is created, a checkpoint location is established in
the transaction log along with a pointer to the last active
transaction. Transactions that are currently executing at the time of
a database dump will not be preserved, but will only be applied to the
database after the dump of the affected data pages has occurred.
During recovery, any active transaction that was not completely
recorded in the transaction log will be rolled back, removing it from
the database.
Subsequently dumping the transaction log with truncate only will
remove all inactive transactions from the log, including any that
completed after the last database dump was initiated. If you later
created a normal transaction dump, all inactive transactions recorded
prior to the last active transaction would again be truncated to
reduce the size of the log.
Below is an illustration of what can happen if the following is
created:
Last
Active Checkpoint
---|--------|-------- 1. Database Dump
Last
Deleted Active Checkpoint
xxxxxxxxxxxxxxxxxx|--------|-------- 2. Transaction
Dump
(truncate
only)
Saved/ Last
Deleted Active Checkpoint
xxxxxxxxxxxxxxxxxx|xxxxxxxxxxxx|---------|-------- 3. Transaction
Dump
Last Last
Active Checkpoint Active Checkpoint
---|--------|xxxxx|------------|---------|-------- 4. Reapplied
Database
^^^^^ Dump (1) and
Missing Transactions Transaction
could lead to data Dump (3)
corruption during
recovery
Keywords : kbother SSrvGen SSrvServer
Version : 4.2 | 4.2
Platform : OS/2 WINDOWS
Issue type :
Last Reviewed: March 11, 1999