Using RMAN For Backup and Recovery
Using RMAN For Backup and Recovery
About Me...
Robert G. Freeman
Burleson Consulting
[email protected] or [email protected]
Books:
Portable DBA: Oracle
Oracle10g Database New Features
RMAN Backup and Recovery - Oracle Press
Oracle9i New Features - Oracle Press
Oracle 7.3 to 8 Upgrade Exam Cram - Coriolis
Oracle 8 to 8i Upgrade Exam Cram Coriolis
Mastering Oracle8i Database Administration - Sybex
Recoverability
Oracle offers Recovery Manager
(RMAN) as a solution to backing up
your database.
RMAN Architecture
Backup Sets
Consist of one or more backup set pieces.
Each channel creates a different backup set.
A given channel can create more than one backup
sets
Overall size of a backup set can be limited.
Tape
The Multi-Media Management Layer (MML) API allows
vendors to write interfaces between RMAN and their
products.
MML must be used to backup to tape or other backup
devices.
Several Vendors have written MML interfaces. Some
vendors include:
Veritas Netbackup, Legato Networker
Tivoli Storage Manager, HP OmniBack
The Multi-Media
Management (MML) Layer
Oracle RMAN API that allows backups to various storage
devices.
Represented in the form of a library that you install in
$ORACLE_HOME/bin or the searchable path (generally
windows/system32 in a Windows environment).
Libobk.o (UNIX, name varies by OS)
orasbt.dll (Windows)
Oracle comes with Legato Single Server version (LSSV)
which allows you to backup to a local tape device.
No network storage, or OS backups are supported in
LSSV.
The Multi-Media
Management (MML) Layer
Once the MML is configured
On UNIX platforms you can use
sbttest to test RMAN and the MML
layer.
Loadsbt.exe is available from Oracle
support for Windows platforms.
Setting Up RMAN
RMAN doesn't require a great deal of setup (Unless you are
using the MML layer).
If you are using Shared Server (MTS) then you must
configure a dedicated connection.
Configure the database in ARCHIVELOG mode if online
backup and recovery is required.
You will need to configure your Multi-Media Management
Layer according to the vendors directions.
You can use a privileged account to perform backups (SYS or
SYSTEM) or create a special account.
Configure RMAN defaults (9i and later).
Setup RMAN
Setup RMAN
Setup RMAN
Setup RMAN
Log_archive_start=TRUE
Log_archive_dest_1=
location=d:\oracle\oraarc\mydb mandatory
Log_archive_dest_2=
location=z:\oracle\oraarc\mydb optional
Log_archive_min_succeed_dest=1
Log_archive_format=robt_%s_%t.arc
Db_file_recovery_dest=z:\oracle\dbrecover
Db_file_recovery_dest_size=2GB
Setup RMAN
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
Setup RMAN
Setup RMAN
Setup RMAN
Setup a Privileged Account
Setup RMAN
Setup a Privileged Account
Setup RMAN
Using RMAN
Setup RMAN
Using RMAN
Setup RMAN
Using RMAN
You can have RMAN will show you a list of valid parameters,
just use an incorrect command line parameter:
C:>rman ?
Argument
Value
Description
-------------------------------------------------------------target
quoted-string connect-string for target database
catalog
quoted-string connect-string for recovery catalog
nocatalog
none
if specified, then no recovery catalog
cmdfile
quoted-string name of input command file
log
quoted-string name of output message log file
.
.
.
.
Setup RMAN
Setup RMAN
Setup RMAN
Setup RMAN
Setup RMAN
Setup RMAN
Note that you have to use Oracle Net (or NET8) for at
least one of the connections. You can use it for both if
you prefer.
Once this step is complete, the recovery catalog is ready
for use.
Setup RMAN
Setup RMAN
Setup RMAN
Configuration Examples:
Setup RMAN
Configuration Examples:
Setup RMAN
Setup RMAN
Setup RMAN
Key
-----4
4
5
5
Completion Time
-----------------02-JUN-02
02-JUN-02
02-JUN-02
02-JUN-02
Filename/Handle
-------------------D:\ORACLE\O912\DBASE\0ADQ1RV0_1_1
D:\ORACLE\O912\DBASE\0ADQ1RV0_1_2
Setup RMAN
Setup RMAN
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=D:\BACKUP\ROBT\BACKUP_05DQ1NJ7_1_1 recid=1 stamp=463527534
deleted backup piece
backup piece handle=D:\ORACLE\O912\DATABASE\08DQ1P0T_1_1 recid=2 stamp=463529047
deleted backup piece
backup piece handle=D:\ORACLE\O912\DATABASE\07DQ1P0R_1_1 recid=3 stamp=463528990
deleted backup piece
backup piece handle=D:\ORACLE\O912\DATABASE\0ADQ1RV0_1_1 recid=4 stamp=463532002
shutdown
startup mount
backup database;
alter database open;
backup
Mon
0
Tue
2
Wed
2
Thr
1
Fri
2
Sat
2
Sun
2
Mon
0
Tue
2
Wed
2
Thr
1
Fri
2
Sat
2
Sun
2
Cumulative Backups
Backup incremental level=0 cumulative database;
Backup incremental level=1 cumulative database;
Backup incremental level=2 cumulative database;
Startup mount;
Restore database until SCN 10000;
Recover database until SCN 10000;
Alter database open resetlogs;
Startup mount;
Restore database until sequence 100 thread
Recover database until sequence 100 thread
Alter database open resetlogs;
Database Incarnations
Inc Key DB Name DB ID
------- -------- ---------------1
RECOVER 2539725638
2
RECOVER 2539725638
3
RECOVER 2539725638
4
RECOVER 2539725638
CUR
--NO
NO
NO
YES
Reset SCN
---------1
315881
316061
316908
Reset Time
---------09-JUN-02
24-JUN-02
24-JUN-02
25-JUN-02
TY
-B
B
B
B
B
B
B
B
LV
-F
A
F
F
A
F
F
A
S
A
A
A
A
A
A
A
A
Device Type
----------DISK
DISK
DISK
DISK
DISK
DISK
SBT_TAPE
DISK
Completion Time
--------------14-JUL-02
14-JUL-02
14-JUL-02
14-JUL-02
14-JUL-02
14-JUL-02
16-JUL-02
16-JUL-02
#Pieces
------1
1
1
1
1
1
1
1
#Copies
------1
1
1
1
1
1
1
1
Tag
--TAG20020714T202940
TAG20020714T203012
TAG20020714T203012
TAG20020714T203754
TAG20020716T160403
RMAN Summary
RMAN is a robust backup and recovery product
RMAN is free, and is supported by Oracle
RMAN can do offline or online backups and
recovery.
RMAN is feature rich.
RMAN is easy to use.
RMAN provides robust reporting facilities
The RMAN Recovery Catalog is a nice optional
addition.
RMAN is being used more and more.
RMAN Summary
If you are considering RMAN, my
book contains step by step
instructions on setup, backup and
recovery as well as other RMAN
operations.
Thanks for coming!
Please fill out your evaluations!