You are on page 1of 35

Backup and Recovery

Backup Types
Logical

Cold

Hot

Physical
With

Without
Issues

Protect
Protect the
the database
database from
from numerous
numerous types
types of
of failures
failures
Increase
Increase Mean-Time-Between-Failures
Mean-Time-Between-Failures (MTBF)
(MTBF)
Decrease
Decrease Mean-Time-To-Recover
Mean-Time-To-Recover (MTTR)
(MTTR)
Minimize
Minimize data
data loss
loss
Categories of Failures
Statement
Statement failure
failure No Recovery
Needed

Logic
Logic error
error inin an
an application
application
Attempt
Attempt to to enter
enter bad
bad data
data into
into the
the table
table
Attempt
Attempt an an operation
operation with
with insufficient
insufficient
privileges
privileges
Attempt
Attempt an an INSERT
INSERTor or UPDATE
UPDATE to to aa table,
table,
causing
causing an an extent
extent to
to be
be allocated,
allocated,
but
but with
with insufficient
insufficient free
free space
space
left
left in
in the
the tablespace
tablespace
Categories of Failures
Statement
Statement failure
failure No Recovery
Needed
User
User process
process failure
failure PMON

The
The user
user performed
performed an an abnormal
abnormal disconnect
disconnect in
in
the
the session.
session.
The
The users
users session
session was
was abnormally
abnormally terminated.
terminated.
The
The users
users program
program raised
raised an
an address
address
exception
exception terminating
terminating the
the session.
session.
Categories of Failures
Statement
Statement failure
failure Recovery
Needed
User
User process
process failure
failure IMP Utility
User
User error
error

Accidental
Accidental DROP
DROPTABLE;
TABLE;
Accidental
Accidental TRUNCATE
TRUNCATE TABLE;
TABLE;
Accidental
Accidental DELETE
DELETE // UPDATE;
UPDATE;
Categories of Failures
Statement
Statement failure
failure No Recovery
Needed
User
User process
process failure
failure PMON SMON
User
User error
error
Instance
Instance failure
failure

HardWare
HardWare Problem
Problem on
on CPU
CPU // RAM
RAM
Categories of Failures
Statement
Statement failure
failure
User
User process
process failure
failure Recovery
Needed
User
User error
error Physical
Instance
Instance failure
failure
Media
Media failure
failure
HardWare
HardWare Problem
Problem on
on I/O
I/O Device
Device
Requirements for Strategy
Business
Business requirements
requirements
Evolutionary
Evolutionary process
process
Technical
Technical requirements
requirements
Hardware,
Hardware, software,
software, man
man power
power and
and time
time
Database
Database configurations
configurations
Transaction
Transaction volume
volume
Frequency
Frequency of
of backups
backups
Operational
Operational requirements
requirements
7-day
7-day // 24-hour
24-hour operations
operations
Testing
Testing and
and validating
validating backups
backups
Physical Backup Methods

No archive Archive
mode mode

Physical backup
ARCHIVELOG

Online redo log files


Group 1 Group 2 Archived log
file
053 052
ARC0 052

/disk1/archive/arch%s.arc
053 052
LOG_ARCHIVE_DEST
LOG_ARCHIVE_FORMAT
Enabling ARCHIVELOG
Mode
1 Shutdown normal or immediate

2 Startup mount 4 Alter database open

Init.ora Control
file

3 Alter database ARCHIVELOG 5 Shutdown normal or


immediate
6 Full database backup
SHUTDOWN IMMEDIATE;

Physical Closed Database Backup

Data files Control Redo log Password Parameter


files files file files

HOST cp <files> /backup/

Online or
offline
storage
STARTUP OPEN;
Advantages of Physical Closed
Database Backups

Conceptually
Conceptually simple
simple
Easy
Easy to
to perform
perform
Require
Require little
little operator
operator interaction
interaction
Physical Opened Database
Backup (1)
Online
redo
log files
Control
files
Online or
offline
storage
Parameter
files Archived redo
log files
HOST cp <files> /backup/

Pwd file
Physical Opened Database
All tablespace data Backup (2) Individual data
files file
SQL>
SQL> alter
alter tablespace
tablespace <name>
<name> begin
begin backup;
backup;

Online or
offline
storage
Data files
HOST cp <files> /backup/

SQL>
SQL> alter
alter tablespace
tablespace <name>
<name> end
end backup;
backup;
Advantages of Physical Opened
Database Backups

Maintains
Maintains high
high database
database availability
availability
Can
Can be
be done
done at
at aa tablespace
tablespace or
or data
data file
file level
level
Supports
Supports nonstop
nonstop business
business operations
operations
1 1 Archived log file

ARC0

Redo log
files
Data files

Control
file
2 1 Archived log file

ARC0
2 1
Redo log
files
Data files

Control
file
3 3 Archived log file

ARC0
2 1 2
Redo log
files
Data files

Control
file
4 3 Archived log file

ARC0
4 1 2
Redo log
files 3
Data files

Control
file
5 5 Archived log file

ARC0
4 1 2
Redo log
files 3 4
Data files

Control
file

Control
file
Data files
6 5 Archived log file

ARC0
6 1 2
Redo log
files 3 4
Data files
5

Control
file

Control
file
Data files
9 9 Archived log file

ARC0
8 1 2
Redo log
files 3 4
Data files
5 6

9 7 8
Control
file

Control
file
Data files
1 Shutdown

2 Startup Mount

3 O.S. Restore From Hot or Cold Physical BackUp DataFile (s)

9 9 4 Recover DataFile (s) Automatic


9
5 8 4a Applyed Archived Logs #5 #6 #7
9 Redo log
files
4b Applyed On Line Logs #8 #9
Data files
5 Alter DataBase Open
9

Control 6 Shutdown Immediate


file
7 New Cold Physical BackUp

8 Startup Open
S.C.N. System Change Number

Data files
Control file RedoRecord
Header

1 Incremental Time Stamp

2 Unique Identified Committed Version D.B.

Log file #

Log file Low SCN #

Higth SCN #
Logical Backup Methods

Oracle Export and Import


Utilities
An
An interactive
interactive dialog
dialog
The
The export
export page
page ofof the
the Data
Data Manager
Manager within
within
Enterprise
Enterprise Manager
Manager
The
The command
command line
line interface,
interface, by
by specifying
specifying
parameters
parameters
These
These utilities
utilities enable
enable you
you to
to do
do the
the following:
following:

Archive
Archive historical
historical data
data
Save
Save table
table definitions
definitions (with
(with or
or without
without data)
data) to
to protect
protect
from
from user
user error
error failure
failure
Move
Move data
data between
between machines
machines and
and databases
databases or
or versions
versions
of
of the
the Oracle
Oracle server
server
Transport
Transport tablespaces
tablespaces between
between databases
databases
Formato
Binario
Proprietario

Data Exp File *.dmp


Base

Data
Imp
Base
Export Concepts
Oracle Server

Generate SQL Two-Task SQL Buffer


commands common command cache
Analyze blocks
(TTC) processing manager

TTC Evaluating Buffer Read blocks


Dump file
buffer buffer cache

1 Full 2 Owner 3 Tables


Oracle9i Server
1a
IncType Complete
1b
IncType Cumulative
1c
IncType Incremental
KEYWORD DESCRIPTION (DEFAULT)
-----------------------------------------------------------------
USERID username/password
BUFFER size of data buffer

FILE output files (EXPDAT.DMP)


LOG log file of screen output
PARFILE parameter filename
FILESIZE maximum size of each dump file

COMPRESS import into one extent (Y)


CONSISTENT cross-table consistency (N)

GRANTS export grants (Y)


INDEXES export indexes (Y)
ROWS export data rows (Y)
CONSTRAINTS export constraints (Y)
TRIGGERS export triggers (Y)

FULL export entire DataBase (N)


OWNER list of owner usernames
TABLES list of table names

INCTYPE incremental export type


DIRECT direct path (N)
STATISTICS analyze objects (ESTIMATE)
Command-Line Method

>expscott/tigerfile=scott.dmpowner=scottgrants=Yrows=Y

Export Messages

Export:Release9.2.0.4.0ProductiononFriOct3009:35:3
(c)Copyright2003OracleCorporation.Allrightsreserved.
Connectedto:Oracle9iEnterpriseEditionRelease9.2.0.4.0
WiththePartitioningoption
PL/SQLRelease9.2.0.4.0Production
ExportdoneinWE8DECcharactersetandWE8DECNCHARcharact
.exportingpreschemaproceduralobjectsandactions
.exportingforeignfunctionlibrarynamesforuserSCOTT
.exportingobjecttypedefinitionsforuserSCOTT
AbouttoexportSCOTTsobjects...
.exportingdatabaselinks
.exportingsequencenumbers
.exportingclusterdefinitions
.abouttoexportSCOTTstablesviaConventionalPath...
..exportingtableBONUS0rowsexported
..exportingtableDEPT4rowsexported
..exportingtableEMP14rowsexported
IncType Complete
IncType Incremental -----> Exp IncType Generic
IncType Cumulative -----> Exp IncType Cumulative or Complete
Oracle Standby
Implementation

Fail over Solution


Disaster Recovery Solution (if remote)
Ease of implementation
Minimum impact on Production System
Read Only Standby Database
Overview of Managed Oracle Standby DB

Primary Instance Standby Instance

ARCH T.N.S.
Recovery proc DBWR
Redo log
Arc log Arc log

RFS

Primary DB Standby DB
Primary Standby
control file control file
1 Recovery Mode 3 Activate
2 ReadOnly Mode

You might also like