RMAN Backup Concepts

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

One section Backup :

backup set >> backup pieces. ( Default one backup piece).

multisection backup :

backup set >> Multiple backup pieces >> one file section per piece.

The MAXOPENFILES parameter of ALLOCATE CHANNEL or CONFIGURE CHANNEL defines


how many datafiles RMAN can read from simultaneously.

The FILESPERSET parameter of the BACKUP command determines how many datafiles to put
in each backup set.

Number of files in each backup set = min(MAXOPENFILES, FILESPERSET)=min(8,64)=8.

(the channel simultaneously writes blocks from 8 datafiles into each backup piece.)

The control file autobackup file name has a default format of %F for all device types, so that
RMAN can determine the file location and restore it without a repository. You can specify a
different format with the CONFIGURE CONTROLFILE AUTOBACKUP FORMAT command, but
all autobackup formats must include the %F variable. If you do not use the default format, then
during disaster recovery you must specify the format that was used to generate the
autobackups. Otherwise, RMAN cannot restore the autobackup.
Backup Output options :

1- Device Type :
BACKUP DATABASE DEVICE TYPE DISK;

2- Backup Set or Copy :


BACKUP AS COPY DEVICE TYPE DISK DATABASE;
BACKUP AS BACKUPSET DATABASE;
BACKUP AS BACKUPSET DEVICE TYPE DISK DATABASE;
BACKUP AS BACKUPSET DEVICE TYPE SBT DATABASE;

3- Format :
BACKUP DATABASE FORMAT "/disk1/backup_%U"; # specifies a location on the file
system.

RUN { ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT


'/disk1/%d_backups/%U'; ALLOCATE CHANNEL disk2 DEVICE TYPE DISK FORMAT
'/disk2/%d_backups/%U'; ALLOCATE CHANNEL disk3 DEVICE TYPE DISK FORMAT
'/disk3/%d_backups/%U'; BACKUP AS COPY DATABASE; }

You can distribute backups in this manner by default in the future, by configuring
channels as follows:

CONFIGURE DEVICE TYPE DISK PARALLELISM 3; CONFIGURE DEFAULT DEVICE


TYPE TO DISK; CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT
'/disk1/%d_backups/%U'; CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT
'/disk2/%d_backups/%U'; CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT
'/disk3/%d_backups/%U'; BACKUP AS COPY DATABASE;

4- Backup Tags.
BACKUP AS BACKUPSET COPIES 1 DATAFILE 7 TAG mondaybkp;
Backing Up a Whole Database with RMAN :

1. Start RMAN and connect to a target database and a recovery catalog (if used). 2. Ensure the
database is mounted or open. 3. Issue the BACKUP DATABASE command at the RMAN
prompt. The simplest form of the command requires no options or parameters:

BACKUP DATABASE;

The following example backs up the database, switches the online redo logs, and includes
archived logs in the backup:

BACKUP DATABASE PLUS ARCHIVELOG;

Backing Up Tablespaces and Datafiles with RMAN:

1. Start RMAN and connect to a target database and a recovery catalog (if used). 2. If the
database instance is not started, then either mount or open the database. 3. Run the BACKUP
TABLESPACE command or BACKUP DATAFILE command at the RMAN prompt. The following
example backs up the users and tools tablespaces to tape:

BACKUP DEVICE TYPE sbt TABLESPACE users, tools;

The following example uses an SBT channel to back up data files 1 through 4 and a data file
copy stored at /tmp/system01.dbf to tape:

BACKUP DEVICE TYPE sbt DATAFILE 1,2,3,4 DATAFILECOPY '/tmp/system01.dbf';

Backing Up Control Files with RMAN :

If the CONFIGURE CONTROLFILE AUTOBACKUP command is set to ON (by default it is


OFF), then RMAN automatically backs up the control file and server parameter file after every
backup and after database structural changes.

Manual Backup :
1. Start RMAN and connect to a target database and a recovery catalog (if used). 2. Ensure the
target database is mounted or open. 3. Execute the BACKUP command with the desired control
file clause. The following example backs up tablespace users to tape and includes the current
control file in the backup:

BACKUP DEVICE TYPE sbt TABLESPACE users INCLUDE CURRENT CONTROLFILE;

The following example backs up the current control file to the default disk device:

BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/tmp/control01.ctl';

The following example backs up the control file copy created in the previous example to tape:

BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/tmp/control01.ctl';

BACKUP DEVICE TYPE sbt CONTROLFILECOPY '/tmp/control01.ctl';

Backing Up Server Parameter Files:(Manually)

1. Start RMAN and connect to a target database and a recovery catalog (if used). 2. Ensure the
target database is mounted or open. The database must have been started with a server
parameter file. If the instance is started with a client-side initialization parameter file, then RMAN
issues an error if you execute BACKUP ... SPFILE. 3. Execute the BACKUP ... SPFILE
command. The following example backs up the server parameter file to tape:

BACKUP DEVICE TYPE sbt SPFILE;

Backing Up Archived Redo Logs with RMAN :

An effective way of backing up archived redo logs is the BACKUP ... PLUS ARCHIVELOG
command, which causes RMAN to do the following:

1. Runs the ALTER SYSTEM ARCHIVE LOG CURRENT statement.

2. Runs BACKUP ARCHIVELOG ALL. If backup optimization is enabled, then RMAN skips logs
that it has already backed up to the specified device.

3. Backs up the rest of the files specified in the BACKUP command

4. Runs the ALTER SYSTEM ARCHIVE LOG CURRENT statement.


5. Backs up any remaining archived logs generated during the backup. If backup optimization is
not enabled, then RMAN backs up the logs generated in Step 1 plus all the logs generated
during the backup.

To delete archived redo logs after a backup:

1. Start RMAN and connect to a target database and a recovery catalog (if used).

2. Ensure that the target database is mounted or open.

3. Run the BACKUP command with the DELETE INPUT clause. Assume that you run the
following BACKUP command:

BACKUP DEVICE TYPE sbt ARCHIVELOG ALL DELETE ALL INPUT;

In this case, RMAN backs up only one copy of each log sequence number in these archiving
locations. RMAN deletes all copies of any log that it backed up from both the fast recovery area
and the other archiving destinations. If you had specified DELETE INPUT rather than DELETE
ALL INPUT, then RMAN would have only deleted the specific archived redo log files that it
backed up. For example, RMAN would delete the logs in /arc_dest1 if these files were used as
the source of the backup, but leave the contents of the /arc_dest2 intact

You might also like