You are on page 1of 2

Lecture -11

Draw the Local Recovery Management Architecture and mention the function of a database buffer manager

Volatile storage
o Consists of the main memory of the computer system (RAM).
Stable storage
o Resilient to failures and loses its contents only in the presence of media failures (e.g., head
crashes on disks).

Implemented via a combination of hardware (non-volatile storage) and software (stable-write, stableread, clean-up) components

The database buffer manager keeps some of the recently accessed data in main
memory buffers. This is done to enhance access performance.
Typically, the buffer is divided into pages that are of the same size as the stable
database pages.
The part of the database that is in the database buffer is called the volatile database.
It is important to note that the LRM executes the operations on behalf of a
transaction only on the volatile database, which, at a later time, is written back to
the stable database.

When the LRM wants to read a page of data on behalf of some operation of a
transactionit issues a fetch command, indicating the page that it wants to read.

The buffer manager checks to see if that page is already in the buffer and if so,
makes it available for that transaction; if not, it reads the page from the stable
database into an empty database buffer.

There are a number of different algorithms by which the buffer manager may choose
the buffer page to be replaced

The buffer manager also provides the interface by which the LRM can actually force
it to write back some of the buffer pages. This can be accomplished by means of the
flush command, which specifies the buffer pages that the LRM wants to be written
back.

Lecture -08
Concurrency Control

1. Block diagram of Transaction State and describe the


Transaction State.

Transaction State

Active, the initial state; the transaction stays in this


state while it is executing
Partially committed, after the final statement has
been executed.
Failed, after the discovery that normal execution can
no longer proceed.
Aborted, after the transaction has been rolled back
and the database restored to its state prior to the start of the transaction. Two options after it has
been aborted:
o restart the transaction only if no internal logical error
o kill the transaction
Committed, after successful completion.

2. The system must detect and break deadlocks, how?

The system must detect and break deadlocks by:

Choosing one trans as a victim and rolling it back.


Timing out the trans and returning an error.
automatically restarting the transaction hoping not to get deadlock again.
Return an error code back to the victim and leaving it up to program to handle situation.