RMAN Backups in A RAC Environment: Edward Whalen Performance Tuning Corporation
RMAN Backups in A RAC Environment: Edward Whalen Performance Tuning Corporation
RMAN Backups in A RAC Environment: Edward Whalen Performance Tuning Corporation
Speaker Qualifications
Edward Whalen, CTO and Founder of Performance Tuning Corporation Author for Oracle Press and Microsoft Press Teaches classes on Oracle and RAC implementation and performance tuning Field consultant working with this technology on a daily basis
Objectives
At the end of this module the student will understand the following tasks and concepts. Understand the basic functionality of the Oracle Recovery Manager. Understand how to perform basic backup and recovery operations using RMAN.
RMAN Backups for RAC 3
RAC Review
Real Application Clusters (RAC)
One database Multiple Instances accessing this database All datafiles, controlfiles, redo log files and unto files are shared
Clustered Filesystem ASM
ASM Review
Automatic Storage Management
Small Oracle instance Diskgroups made up of multiple disks Managed via SQL*Plus, Grid Control or DB Control Looks like raw devices to the OS
Intro to RMAN
Oracle Recovery Manager
Used to back up Oracle databases Used to back up Archive Log files Used to delete Archive Log files Used to back up Control files Can back up spfiles Necessary for backing up ASM
RMAN Features
Backup and Restore Client Complete or Partial Backups Full or Incremental Backups Automatically tracks new tablespaces and data files
RMAN Features
Detects corrupted blocks and reports them
Does unused block compression Employs binary compression for disk backups Can test backups without restoring them
RMAN Features
Can backup to tape (media manager) Can backup to disk
Can compress backup Two compression types
10
Cons
DBA loses some control Backup is not immediately available
RMAN Backups for RAC 11
Cons
Takes a lot of disk space
12
Backup Recommendations
DBA is responsible for doing backups to disk
Compressed disk backup
Sys Administrators take disk backups and back them up to tape on a scheduled basis Both are tested on a regular basis
RMAN Backups for RAC 13
14
RMAN Metadata
Stores Backup Metadata
Stored scripts Backup settings History
RMAN Metadata
Recovery Catalog Control files
19
20
Allows you to restore a database from a previous incarnation (period before RESETLOGS) Easier to handle the loss of a control file Allows creation of reports on the target database at previous points in time Maintains consistent RMAN channel configuration default values
RMAN Backups for RAC 23
Accessing RMAN
Must be invoked by an account with SYSDBA privileges Beware!
Linux has two RMANs
rman (default path) is reverse man $ORACLE_HOME/bin/rman is the recovery manager
24
Invoking RMAN
With a recovery catalog
$ORACLE_HOME/bin/rman TARGET / CATALOG user/passwd@service
Example
$ORACLE_HOME/bin/rman TARGET / CATALOG sys/ora123@cat $ORACLE_HOME/bin/rman TARGET sys/pwd@rac1 CATALOG sys/ora123@cat
Example
$ORACLE_HOME/bin/rman TARGET SYS/ora123@orcl
RMAN Backups for RAC 25
26
27
28
29
RMAN Information
The show command displays information about the RMAN configuration
show all displays everything
RMAN Configuration
Configure Devices
sbt device is the media manager
Veritas Legato Tivoli
Configure Channels
Used to perform the backups
33
Configuring Devices
Setup default devices
Configure media manager
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
34
Configuring Channels
Channel is the device path to the backup media With a disk device, this is the path
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT /u03/oracle/backup/ora_df%U'; Many options available
37
38
39
41
Performing Backups
There are a number of different ways to do backups
BACKUP DATABASE BACKUP TABLESPACE USERS; BACKUP INCREMENTAL LEVEL 0 DATABASE; BACKUP CURRENT CONTROLFILE; BACKUP SPFILE
42
SPFILE Backups
RMAN backups are great Create pfiles as a backup for the spfile
CREATE PFILE=/u01/initRAC.ora FROM SPFILE=+DATADG/; Useful for resetting parameters The ASM instance must be up
43
44
45
46
47
Cons
I/Os are all going to the same storage More load on the system(s)
48
Restore Backup
Restore to one node
Apply archive logs from all nodes as requested
49
Crosscheck Backup
Crosscheck synchronizes backup pieces on disk with information in the RMAN metadata It is a good idea to crosscheck backups and copies before deleting them
CROSSCHECK BACKUP; CROSSCHECK COPY;
50
51
52
Note: In Oracle 11g an archive log needed for Data Guard will not be deleted.
RMAN Backups for RAC 53
54
Performing Restores
First preview the restore
RESTORE DATABASE PREVIEW; RESTORE TABLESPACE users PREVIEW; RESTORE DATAFILE 3 PREVIEW;
Preview allows you to see a report before the restore takes place
55
Performing Restores
Performing the Restore
RESTORE DATABASE; RESTORE TABLESPACE users; RESTORE DATAFILE 3;
56
Validating Backups
Backups can be validated with restore validate
RESTORE DATABASE VALIDATE; RESTORE CONTROLFILE VALIDATE; RESTORE TABLESPACE users VALIDATE; RESTORE ARCHIVELOG ALL VALIDATE;
57
58
Duplicate Database
Creates a database with a New DBID
60
3.
Backup Primary Connect to Primary and Auxiliary (standby) Duplicate Database for Standby
61
62
63
2.
64
66
Summary
RMAN Concepts RMAN Functionality 10g New Features
67
68