Session – 16 RECOVERY CONTROL - 1 Matakuliah

advertisement
Matakuliah
Tahun
Versi
: M0184 / Pengolahan Data Distribusi
: 2005
:
Session – 16
RECOVERY CONTROL - 1
OBJECTIVE
• The importance role of Log file for
recovery plan
• Checkpoint
Log File
• Function : recorded all operation on the
DB that carried out by all transaction.
• One log file for each DBMS which is
shared by all transaction under the control
of DBMS
• In DDB environment, each site will have its
own separate log.
• Another purpose of log file is for
performance monitoring and auditing
Log File contains information :
• Transaction identifier
• Type of log record, that is, which of the list of DB
actions listed above it is recording
• Identifier of data object affected by the DB action
(insert, delete and update)
• Before-image of the data object, that is the value
before update
• After-image of data object, that is its value after
update
• Log management and information such as
pointer to previous log record for that transaction
Log File
• Log files were traditionally stored on
magnetic tape, because tape was a more
reliable form of stable storage than
magnetic disk and was cheaper
• Now, the log file can be stored on-line on a
fast direct access storage device to be
able to recover quickly from minor failures
Local Recovery Manager
Local Transaction Manger
Local Scheduler
Local Recovery Manager
DB Buffer Manager
Database Buffer
DB
Log Buffer
Log File
Main memory
Secondary
storage
Checkpoint
• How far back in the log to go in order to
identify transaction which might have
redone ?
• To limit its search, the recovery manager
takes periodic checkpoint and on
recovery it only has to go back as far as
the last checkpoint
• Two Approach : synchronous and
asynchronous
Synchronous Checkpoint
• System stops accepting any new
transaction until all executing transaction
have finished.
TC5
TC4
TC1
Synchronous
checkpoint
Failure
Asynchronous Checkpoint
• System processing is allowed to continue
uninterrupted by the checkpoint
TC5
TC4
TC3
TC2
TC1
Asynchronous
checkpoint
Failure
Asynchronous Checkpoint
The following action are carried out at an
synchronous checkpoint :
• A list of all transaction currently active in the
system is written to the log
• The address of the checkpoint record in the log is
written to special file known as the restart file
• All buffers are forcewritten to both the log and the
BD
Download