Beruflich Dokumente
Kultur Dokumente
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
LCG
Agenda
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Types of failures
Instance Failure
Usually connected with an Oracle process failure
Media Failure
Disk failure, storage array controller failure etc.
Block Corruption
Usually caused by bugs in Oracle software
Human error
In most cases accidentally deleted/updated data
Database user or DBA
Disaster
Fire, flood, earthquake, plane crash etc.
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
DBWR
Backup proc.
Server proc.
SGA
LGWR
Db file
RedoLog
Log archiver
Db file
Db file
Db file
Tapes
or
disks
system
RedoLog
Archived redo logs
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
RMAN architecture
Target
Database
RMAN Client
Target
Database
Target
Database
Auxiliary
Database
RMAN
Catalog
Schema
Catalog
Database
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Archivelog backups
Tablespace(s), datafile(s) backups
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Differential incremental
Cumulative incremental
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
RMAN Configuration
RMAN can be preconfigured
Configuration is stored in the control file and in the
recovery catalog (if used)
Can facilitate backup automation
Default
Recommended
on
Retention policy
to redundancy 1
Device type
to disk
to sbt
Backup optimization
off
off
none
sbt parms=...
Maxsetsize
unlimited
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
run {
crosscheck archivelog all;
backup tag some_tag_1D' incremental level 1
database format '%d_%T_%U_lvl1D'
plus archivelog format '%d_%T_%U_lvl1Darch';
delete noprompt force archivelog all completed before sysdate 2;
}
run {
backup maxsetsize 2047G tag ' DB_Copy_tag' device type disk incremental level
1 for recover of copy with tag DB_Copy_tag database;
recover device type disk copy of database with tag DB_Copy_tag until time
sysdate -2 ;
delete force noprompt backupset device type disk tag DB_Copy_tag
completed before sysdate -2;
}
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Requires:
Control file recovery (if its lost)
Datafile restore from a backup
Database recovery using incremental backups and/or
archived redo logs and online redo logs
startup mount
run {
allocate channel c1 device type disk|sbt;
allocate channel c2 device type disk|sbt;
restore database check readonly;
recover database;
alter database open;
}
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Requires
Spfile restore
Controlfile restore
Datafiles restore and recovery
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
set dbid=xxxxxxx
startup nomount;
run {
allocate channel c1 device type disk|sbt;
restore spfile to some_location from autobackup;
recover database;
alter database open resetlogs;
}
shutdown immediate;
startup nomount;
run {
allocate channel c1 device type disk|sbt;
restore controlfile from autobackup;
alter database mount;
}
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
run {
set until time = "to_date('24-AUG-2006 00:00:00','dd-mon-yyyy hh24:mi:ss')";
allocate channel c1 device type disk|sbt;
allocate channel c2 device type disk|sbt;
restore database check readonly;
recover database;
alter database open resetlogs;
}
Requires
Point in time recovery of the whole database (an
auxiliary instance is created)
Export/import of selected tablespaces schemas
or objects
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Single/multiple
datafile/tablespace recovery
Needed when
Single/multiple tablespaces or datafiles have been lost
SYSTEM tablespace is intact
Controlfiles and online redo logs are intact
Requires
To put offline datafiles and tablespaces being recovered
The database can be open and available to users
run {
sql alter tablespace users offline;
allocate channel c1 device type disk|sbt;
restore tablespace users;
recover tablespace users;
sql alter tablespace users online;
}
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Demo
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
Hands on preparation
https
://twiki.cern.ch/twiki/bin/view/PSSGroup/H
andsOnExercises
Please start a full backup of your database,
if possible use a tape system
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it
More info
Oracle Database 10g RMAN
Backup & Recovery (by
Mathew Hart and Robert G.
Freeman)
Oracle Documentation
Backup and Recovery Basics
Backup and Recovery
Advanced User's Guide
Backup and Recovery
Reference
CERN - IT Department
CH-1211 Genve 23
Switzerland
www.cern.ch/it