The
recovery-management component of a database system implements the support for
atomicity and durability.
The
shadow-database
scheme that have a only one transaction is
active at a time and data base is simply a file on the disk.A pointer called db_pointer said points to the current
consistent copy of the database.All updates are made on a shadow
copy
of the database, and db_pointer is made to point to the updated
shadow copy only after the transaction reaches partial commit and all the updated
pages have been flushed to disk.
In case transaction fails, old consistent
copy pointed to by db_pointer can be used, and the shadow copy
can be deleted.Transaction
said to be committed at the point where the updated.Db-pointer is written to the disk.If
transaction fails at any time before the db – pointer is updated , the old
content of the data base are not affected
We
can abort the transaction by just deleting the new copy of the data baseOnce
the transaction has been committed , all the updates that is performed are in
the data base pointed to by db – pointer.Thus
either all the updates of the transaction are reflected or none of the effects
are reflected, regardless of the transaction failure.
ABOUT System failure:
If
the system fails at any time before the updated pointer is written to the disk.When
system restart , it will read db – pointer and will thus see the
original content of the data base and none of the effect of the transaction
will be visible on the data base
If
the system fails after the db- pointer has been update on the
disk.Before
the pointer is updated all the upgrade pages of the new database were written
to the disk.It
will read db- pointer and will thus see the
contents of the data base after all the updates performed by the transaction.
Thus
atomicity and durability of the transaction are ensured by the shadow copy
Assumes
disks to not fail.Useful
for text editors, but extremely inefficient for large databases: executing a
single transaction requires copying the entire
database.
Will see better schemes.
Multiple
transactions are allowed to run concurrently in the system. Advantages are:
increased
processor and disk utilization, leading to better transaction throughput: one transaction can be using the
CPU while another is reading from or writing to the disk
reduced
average response time for transactions: short transactions
need not wait behind long ones.
Concurrency control schemes – mechanisms to achieve isolation, i.e., to control the
interaction among the concurrent transactions in order to prevent them from
destroying the consistency of the database