Configure Rman

If you want to set up quickly a running rman configuration, only follow these 4 steps, you have to write it in your rman prompt. It is also possible to launch some rman commands within files. Like that, you can launch regulary some rman command, check result and finally re-launch command. So, this can be done with a shell scripts of course.

Quick configuration of Rman

Set type of backup

RMAN> configure device type disk backup type to compressed backupset;

It will make backup'ed files in a compressed format, and hence reduce space used for the backup.

Backup automaticaly your controlfile

RMAN> configure controlfile autobackup on;

Specify the formatting and where to put the backup'ed controlfile

RMAN> configure controlfile autobackup format for device type disk to '/my/dir/for/controlfile/cf-%F';

See below for more information about the tag %F .

Specify the formatting and where to put the backup'ed datafiles

RMAN> configure channel device type disk format '/opt/oracle/rman-backup/bkp_%t_%s_%p';

See below for more information about the tags : %t, %s and %p.

Specify the formatting, max size and where to put the backup'ed datafile

You can specify a maximum size for each backup'ed file. Otherwise, your backup'ed files will perhaps grow too much for you file system and you will get an error. Or simply, put a maximum size to be able to transport it on a cd or dvd and get archived. Really useful as you might guess !
So, how this can be done, like that :

rman> configure channel device type disk maxpiecesize = 100m format '/opt/oracle/bkp_%t_%s_%p';

More information can be find here : oracle doc

If you want more informations, about these commands, you can read the next section.

More informations about commands

As you known now, rman create some file for your backup, you can choose between raw file, or not. Actually, a raw file is only a copy of the datafile that you want to be copied. I would prefer to not use raw file, as it needs more place to backup on the hard disk, and it isn't the most efficient way to do a backup.

By default, rman backup the file in this directory :

$ORACLE_BASE/flash_recovery_area

check this variable "ORACLE_BASE" to find where is the directory!
As I said earlier on this page, we can tell to rman where to put the backup'ed files with this command :

RMAN> configure channel device type disk format '/opt/oracle/rman-backup/bkp_%t_%s_%p';

The important thing are within the simple quote, there, I defined a directory :

/opt/oracle/rman-backup/

and a format for the backuped files (what will be the name of file ) :

bkp_%t_%s_%p

where

represent a timestamp


This will only apply to your backup'ed datafile, and not your backup'ed controlfile as you specify an other formatting for this.

As you probably known, the controlfile is really important for oracle, so there is an option to allow you to back it up, whenever you backup something, just in case of…
To enable it, just do that :

RMAN> configure controlfile autobackup on;

So, by instance if you only backup a specific datafile, with this option set, it will also create a new backup of your controlfile.
The next step, is to tell where to backup this controlfile, you can do it :
RMAN> configure controlfile autobackup format for device type disk to '/my/dir/for/controlfile/cf-%F';

As in the previous, command, I defined a directory where to put the backup'ed file :

/my/dir/for/controlfile/

and how we will format the name of our backup'ed file with :

cf-%F

So, when you will do a backup, the backup of your controlfile will looks something like that :

cf-2188860340-20080305-02

You notice that :

%F

was replaced with :

2188860340-20080305-02

This number has a special meaning for oracle, it's made up of three part :

represent our DBID

Actually, I don't known what the hexadecimal number is, if anyone has an answer, could he send me an e-mail ?

External links

More information about description of formatting a file with rman, go here.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License