Billal Hossain ID-M190305705 M.SC in Cse Jagnnath University
Billal Hossain ID-M190305705 M.SC in Cse Jagnnath University
Billal Hossain ID-M190305705 M.SC in Cse Jagnnath University
ID-M190305705
M.Sc In CSE
Jagnnath University
Introduction
Types of failure and Backup in Database
Recovery facilities:
• Backup Facilities
• Journalizing Facilities
• Checkpoint Facility
• Recovery Manager
Backup and recovery procedures protect your
database against data loss and reconstruct the data,
should loss occur.
The reconstructing of data is achieved through
media recovery, which refers to the various
operations involved in restoring, rolling forward,
and rolling back a backup of database files.
A backup is a safeguard against unexpected data
loss and application errors.
Backups are divide into:
Physical backups
Logical backups
Physical backups:
Copies of physical database files.
Two ways to perform physical backup:
Recovery Manager (RMAN) utility.
Operating system utilities.
Logical backups:
Contain logical data (for example, tables and stored
procedures)
Extract with an Oracle utility (Export utility) and stored
in a binary file.
Logical backups used to supplement physical
backups.
There are two types of backups:
Image copies: exact duplicate of a datafile, control
file, or archived log.
restore them as-is without performing additional
processing by using either operating system utilities or
RMAN.
Backup sets: backup in a proprietary format that
consists of one or more physical files called backup
pieces.
contain more than one database file, and it can also be
backed up using special processing
Mechanism for restoring a database quickly
and accurately after loss or damage
A DBMS COPY utility that produces a backup
copy (save) of the entire database or a subset of
the database
Periodic backup (e.g. nightly, weekly)
Backups stored in secure, off-site location
Backup copy-used to restore the database
Cold backup–database is shut down during
backup
Hot backup–selected portion is shut down and
backed up at a given time
Incremental backups: record changes made
since the last full backup
Source: http://kb.acronis.com/content/1536
Source: http://kb.acronis.com/content/1536
Audit trail of transactions and database
updates/changes
In the event of failure: consistent database state can
be reestablished using the information in the
journals together with the most recent complete
backup
Two basic journals or logs:
Transaction log–record of essential data for each
transaction processed against the database
Transaction code, action, time, terminal no/user ID, input
data values , tables/records accessed & modified and the
old & new field values.
Database change log–images of updated data
Before-image–copy of a record before modification
After-image–copy of a record after modification
A facility by which the DBMS periodically refuses to
accept new transactions. The system is in a quiet state
and the database and transaction logs are synchronized
All transactions in progress are completed and journal
files are brought up-to-date
DBMS writes a special record (checkpoint record) to
the log file: snapshot of the state of the database
Checkpoint record contains information necessary to
restart the system
Any dirty data blocks (pages of memory that contain
changes that have not yet been written out to disk) are
written from memory to disk storage
Automatically or response to commands in user
application programs
A module of the DBMS that restores the
database to a correct condition when a failure
occurs and then resumes processing user
requests.
Type of restart used depends on the nature of
failure.
Disk Mirroring–switch between identical
copies of databases
Restore/Rerun–reprocess transactions
against the backup
Transaction Integrity–commit or abort all
transaction changes
Backward Recovery (Rollback)–apply before
images
Forward Recovery (Roll Forward)–apply
after images (preferable to restore/rerun)
Database must be mirrored switch to an
existing copy of the database
2 copies of the database must be kept &
updated simultaneously
Media failure occurs: processing switch to the
duplicate copy
Allows fastest recovery
BEGIN TRANSACTION
.
.
UPDATE
INSERT
.
.
COMMIT