Comp1638 L9
Comp1638 L9
Recovery
T.Simmonds 2
Objectives
Discuss Backup and Recovery
Describe different types of failure in the
database
Preparing a database for recoverability
Discuss details of instance recovery
Develop backup strategy
Logical and physical backups
Perform backups
The database recovery process from a backup
T.Simmonds 3
Database Backup and
Recovery
Part1
T.Simmonds 7
Backup and Recovery Issues
Oracle Database maintains three types of files that
are important for backup and recovery:
datafiles
contain user and system data
redo log files
contain logs of database changes
control files
small files that store the SCN and the name, contents, and
locations of various files used by a database.
control files are frequently updated by a database, and they
must be available for a database to be operational
T.Simmonds 8
What can go wrong?
Database recovery techniques depend on the
type of failure.
Following types of failures can occur in the
database:
Statement failure
User process failure
Network failure
User error
Media failure
Instance failure
T.Simmonds 9
Database Backup and
Recovery
Part2
Possible solutions:
Work with users to validate and correct data
Provide appropriate object or system privileges
Work with developers to correct program errors
T.Simmonds 11
User process failure
A user process may fail for any number of reasons:
User exits abnormally
A user’s session is abnormally terminated
The terminal rebooting
The program causing an error that
terminates the session
Possible solutions:
This type of problem is beyond the DBA’s control
PMON will roll back the transaction, terminate the server
process and release the PGA to the operating system
Watch for multiple occurrences which might indicate other
problems
T.Simmonds 12
Network failure
Potential network problems:
Listener fails
Network Interface Card (NIC) fails
Network connection fails
Possible solutions:
Configure a backup listener and connect-time
failover
Configure multiple network cards
Configure a backup network connection
Work together with the network administrators
T.Simmonds 13
User error
Users errors used to be the worst errors to manage
User errors are not errors as far as database is
concerned:
User commits unwanted changes
User drops the table
Possible solutions:
To prevent them from occurring in the first place
software design
user training
correct privileges
Flashback technology
T.Simmonds 14
Media failure
A media failure occurs when Oracle Database is unable to
write to a physical file.
This may occur because of a disk head crash or other disk
failure, because needed devices are not powered on, or because
a file is corrupt.
Media failure means
damage to disks, and therefore the files on them
user error when system or database administrator accidently deleted files
loss any of on line redo log files, data files or control file
Possible solutions:
Prevention and protection
protect control file and online redo log files through multiplexing
protect archive log files
good backup strategy
T.Simmonds 18
Database Backup and
Recovery
Part3
T.Simmonds 20
Backup Overview
Backup and recovery is one of the most
important aspects of a database management
A backup strategy provides
a safeguard against data loss
A backup is a copy of data from
your database that can be used to
reconstruct that data.
Backups can be divided into logical and physical
backups, both of which have a number of options
available
T.Simmonds 21
Logical Backups
Logical backups of a database contains logical data
such as tables and stored procedures.
Logical backups exported from a database with an
Oracle export utility and stored in a binary file, for later
re-importing into a database using the corresponding
import utility.
The records are read independently of their physical location.
Export file will contain the commands necessary to
completely re-create all the chosen objects and data.
Data Pump Import utility is used to import the data.
T.Simmonds 22
Physical Backups
Physical backups are the foundation of any sound
backup and recovery strategy
A physical backup involves copying the files that
constitute the database (datafiles, control files, and
archived redo logs)
Logical backups are a useful supplement to
physical backups but are not sufficient protection
against data loss without physical backups
An effective backup strategy must be based on
physical backups
T.Simmonds 23
Physical Backup Options
Backup strategies:
Whole: A backup of the control file and all datafiles that belong to a
database
Partial: A portion of the database
Backup types:
Full: A non-incremental RMAN backup
Incremental: Only information that has changed since some previous
backup
Backups modes:
Offline: Consistent, also referred to as cold backup
Online: Inconsistent, also referred to as hot backup
Backups storage:
Image copies: Duplicate data and log files in OS format
Backup sets: Binary, compressed files in Oracle proprietary format
T.Simmonds 24
Backup Tools
Backups can be performed by using:
Recovery Manager (RMAN)
is the recommended method of backing up your Oracle
database
Oracle Secure Backup
complements RMAN existing functionality by adding
backup to tape and network backup capabilities
User-managed backup
is based on scripts that a DBA must write
Carried out with OS commands
is being phased out
T.Simmonds 25
The Database Recovery Process
Reconstructing the contents of all or part of a
database from a backup typically involves two
phases:
retrieving a copy of the datafile from a backup,
reapplying changes to the file since the backup
from the archived and online redo logs, to bring
the database to a desired SCN since the backup
(usually, the present).
T.Simmonds 26
Essentials
Discuss Backup and Recovery
Describe different types of failure in the
database
Preparing a database for recoverability
Discuss details of instance recovery
Develop backup strategy
Logical and physical backups
Perform backups
The database recovery process from a backup
T.Simmonds 27