KEMBAR78
Database backup and recovery | PDF
Advanced Database Systems
The Need for Database
Backup
Backup can be performed in any of
the several ways:
Use SQL to create backup tables
and copy data into them.
Use an implementation-defined
mechanism that backs up the
* Property of STI
Page 1 of 8
Database Backup and Recovery
mechanism that backs up the
whole database or portions of
it.
Using DBMS installation
Advanced Database Systems
Log File
The DBMS maintains a special file
called log file to keep track of
database transactions.
It may contain the following:
Transaction identifier
Type of log record
* Property of STI
Page 2 of 8
Database Backup and Recovery
Type of log record
Identifier of data item affected
by the database action
Before-image of the data item
which means its value before
change.
After-image of the data item
which means the value after
change
Log management information
Advanced Database Systems
Checkpointing
Checkpointing is the point of
synchronization between the
database and the transaction log
file.
Checkpoints involve the following
operations:
* Property of STI
Page 3 of 8
Database Backup and Recovery
operations:
Writing all log records in main
memory to secondary storage
Writing the modified blocks in
the database buffers to
secondary storage
Writing a checkpoint record to
the log file.
Advanced Database Systems
The Need for Recovery
There are many different types of
failure that can affect database
processing.
Some causes of failures are as
follows:
System crashes
* Property of STI
Page 4 of 8
Database Backup and Recovery
System crashes
Media failures
Application software errors
Natural physical disasters
Carelessness
Sabotage
Advanced Database Systems
The Need for Recovery
A DBMS should provide the
following facilities to assist with
recovery:
A backup mechanism
A logging facilities
* Property of STI
Page 5 of 8
Database Backup and Recovery
A logging facilities
A checkpoint facility
A recovery manager
Advanced Database Systems
Recovery Techniques
The recovery technique that must
be selected is dependent on the
extent of the damage that has
occurred to the database.
If the database has been
extensively damaged, for
* Property of STI
Page 6 of 8
Database Backup and Recovery
extensively damaged, for
example a disk head crash has
occurred and destroyed the
database.
If the database has not been
physically damaged but has
become inconsistent.
Advanced Database Systems
Recovery Techniques
Using the Deferred Update
In the deferred update protocol,
the updates are not written to the
database until after a transaction
has reached its commit point.
In this protocol, the log file is used as
follows:
* Property of STI
Page 7 of 8
Database Backup and Recovery
follows:
Write the transaction start record
to the log.
Write a log record containing the
entire log data specified
previously.
Write a transaction commit log
record.
If the transaction aborts, ignore
the log records for the transaction
and do not perform the writes.
Advanced Database Systems
Recovery Techniques
Using the Immediate Update
In the immediate update protocol,
the updates are applied to the
database as they occur without
waiting to reach the commit point.
In this protocol, the log file is used as
follows:
* Property of STI
Page 8 of 8
Database Backup and Recovery
follows:
Write the transaction start record
to the log.
Write a record containing the
necessary data to the log file.
Write the update to the database
buffers.
Write a transaction commit record
to the log

Database backup and recovery

  • 1.
    Advanced Database Systems TheNeed for Database Backup Backup can be performed in any of the several ways: Use SQL to create backup tables and copy data into them. Use an implementation-defined mechanism that backs up the * Property of STI Page 1 of 8 Database Backup and Recovery mechanism that backs up the whole database or portions of it. Using DBMS installation
  • 2.
    Advanced Database Systems LogFile The DBMS maintains a special file called log file to keep track of database transactions. It may contain the following: Transaction identifier Type of log record * Property of STI Page 2 of 8 Database Backup and Recovery Type of log record Identifier of data item affected by the database action Before-image of the data item which means its value before change. After-image of the data item which means the value after change Log management information
  • 3.
    Advanced Database Systems Checkpointing Checkpointingis the point of synchronization between the database and the transaction log file. Checkpoints involve the following operations: * Property of STI Page 3 of 8 Database Backup and Recovery operations: Writing all log records in main memory to secondary storage Writing the modified blocks in the database buffers to secondary storage Writing a checkpoint record to the log file.
  • 4.
    Advanced Database Systems TheNeed for Recovery There are many different types of failure that can affect database processing. Some causes of failures are as follows: System crashes * Property of STI Page 4 of 8 Database Backup and Recovery System crashes Media failures Application software errors Natural physical disasters Carelessness Sabotage
  • 5.
    Advanced Database Systems TheNeed for Recovery A DBMS should provide the following facilities to assist with recovery: A backup mechanism A logging facilities * Property of STI Page 5 of 8 Database Backup and Recovery A logging facilities A checkpoint facility A recovery manager
  • 6.
    Advanced Database Systems RecoveryTechniques The recovery technique that must be selected is dependent on the extent of the damage that has occurred to the database. If the database has been extensively damaged, for * Property of STI Page 6 of 8 Database Backup and Recovery extensively damaged, for example a disk head crash has occurred and destroyed the database. If the database has not been physically damaged but has become inconsistent.
  • 7.
    Advanced Database Systems RecoveryTechniques Using the Deferred Update In the deferred update protocol, the updates are not written to the database until after a transaction has reached its commit point. In this protocol, the log file is used as follows: * Property of STI Page 7 of 8 Database Backup and Recovery follows: Write the transaction start record to the log. Write a log record containing the entire log data specified previously. Write a transaction commit log record. If the transaction aborts, ignore the log records for the transaction and do not perform the writes.
  • 8.
    Advanced Database Systems RecoveryTechniques Using the Immediate Update In the immediate update protocol, the updates are applied to the database as they occur without waiting to reach the commit point. In this protocol, the log file is used as follows: * Property of STI Page 8 of 8 Database Backup and Recovery follows: Write the transaction start record to the log. Write a record containing the necessary data to the log file. Write the update to the database buffers. Write a transaction commit record to the log