Documente Academic
Documente Profesional
Documente Cultură
LCG
www.cern.ch/it
Agenda
CERN - IT Department CH-1211 Genve 23 Switzerland
Types of failures and backups in Oracle RMAN Architecture Manual vs. RMAN backups On-tape backups with RMAN RMAN Configuration RMAN backup strategies RMAN backups at Tier0 Exemplary recovery scanarios Demo
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
www.cern.ch/it
www.cern.ch/it
SGA
Backup proc.
LGWR
RedoLog
Log archiver
Db file
RedoLog
www.cern.ch/it
RMAN architecture
Target Database
Target Database
Auxiliary Database
Catalog Database
www.cern.ch/it
Differential incremental
www.cern.ch/it
www.cern.ch/it
www.cern.ch/it
On-tape backups with RMAN (2) Many vendors of Media Management software provide MMLs Most popular are:
Tivoli Storage Manager Veritas NetBackup EMC NetWorker
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
Recommended
on
to recovery window of 31 days disk|sbt prallelism 2 ... to sbt off sbt parms=... depends on your database size
www.cern.ch/it
The SHOW ALL command lists all RMAN configuration settings To clear a given settings append CLEAR at the end of the CONFIGURE command
CERN - IT Department CH-1211 Genve 23 Switzerland
www.cern.ch/it
RMAN backup strategies RMAN allows many types of backups It possible to build own backup strategy that suits given database best There are also Oracle recommended backup strategies:
Incremental backup strategy: level 0 backups + level 1 backups (cumulative and/or differential) and archivelog backups inbetween. Incrementally updated database copy: 1 backup as copy of the whole database + incremental backups used to update the copy + archived redo logs.
CERN - IT Department CH-1211 Genve 23 Switzerland
www.cern.ch/it
www.cern.ch/it
www.cern.ch/it
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; }
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
The most typical recovery in case of systems implementing SAME approach If done after a disaster it has to be preceded by:
Hardware configuration OS and Oracle software installation Re-creation or restore from non-RMAN backup of listener.ora, tnsnames.ora and other important configuration files ASM instance and diskgroup configuration (if needed) MML installation and configuration ...
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; } 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; } LCG 3D Workshop, Bologna, June 2007 - 20
www.cern.ch/it
Requires
Point in time recovery of the whole database (an auxiliary instance is created) Export/import of selected tablespaces schemas or objects
www.cern.ch/it
Can be done with an open database Only the table(s) containing corrupted blocks are not available Database corruptions can be discovered with RMAN backup validate database command Corrupted blocks can be found in V$DATABASE_BLOCK_CORRUPTION
ORA-01578: ORACLE data block corrupted (file # 19, block # 44) ORA-01110: data file 19: d:\oracle\oradata\data\mydb_maintbs_01.dbf run { allocate channel c1 device type disk|sbt; blockrecover datafile 19 block 44; }
CERN - IT Department CH-1211 Genve 23 Switzerland
www.cern.ch/it
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
www.cern.ch/it
Hands on preparation
https://twiki.cern.ch/twiki/bin/view/PSSGroup /HandsOnExercises Please start a full backup of your database, if possible use a tape system
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
www.cern.ch/it