Oracle RMAN 11g Backup and Recovery (45 page)

BOOK: Oracle RMAN 11g Backup and Recovery
7.45Mb size Format: txt, pdf, ePub

86
Part II: Setup Principles and Practices

Once we have configured a default device type, we can configure defaults for the specific type of backup that should occur when that device is used. For example, when doing backups to disk, we can opt to have Oracle back up the database by default using the standard Oracle backup set methodology, or we can have it default to using copies (which can only go to disk).

You can also indicate that backup sets should be compressed by default and indicate the degree of parallelism (which represents the number of channels that will be allocated for that backup).

Here are examples of configuring for these different options:

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET;

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;

CONFIGURE DEVICE TYPE DISK PARALLELISM 2;

One word about compression, which was a new feature of RMAN in Oracle Database 10
g.

Compression provides real compression of your Oracle backup sets, not unlike zip compression.

This can make your backup sets much smaller. Of course, the compression itself consumes resources and will make the backups take longer to complete or restore.

Now, let’s look at an example of configuring the number of channels to be allocated during an automated backup or recovery operation. Also in this example, we have set the default level of parallelism for disk operations to two. Thus, if you start an automated backup, two channels will be allocated to perform the backup in parallel.

CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT 'd:\backup\robt\backup %U';

CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT 'e:\backup\robt\backup %U';

NOTE

Generally, when setting the default level of parallelism, you should
set it to the number of tape drives you will be backing up to. When

using disks, some trial and error might be called for. Since disks have
multiple heads and may be stripped, it may be that multiple channels
will result in better throughput. Test parallelism to your disks and act
accordingly on the results.

Several options are available when configuring channels. With the
maxpiecesize
parameter, you can control the size of a backup set piece. You can control the maximum number of files that RMAN can open at one time with the
maxopenfiles
parameter. The
rate
parameter allows you to throttle RMAN and to control the rate at which a backup occurs in either bytes, kilobytes, megabytes, or gigabytes per second.

In this example, we put all these options to use. We limit channel 1 to creating each individual backup piece at a maximum size of 100MB, and we limit RMAN to opening a maximum of eight files on this channel. Finally, we have constrained the channel such that it cannot have a throughput of more than 100MB.

CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 100m maxopenfiles 8

rate 100MB;

Chapter 3: RMAN Setup and Configuration
87

NOTE

Don’t get confused about the difference between the
maxpiecesize
parameter and the
maxsetsize
parameter:
maxpiecesize
limits the size
of the individual backup set pieces and has no impact on the overall
cumulative size of the backup. The
maxsetsize
parameter, on the other
hand, can and will limit the overall size of your backup, so use it

carefully!

If we had wished to limit all channels, we could have issued the command slightly differently: CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 100m;

So, why might we want to change the maximum size that a given backup set piece can be?

First, we might have some specific file size limitations that we have to deal with. Tapes can only handle so much data, and some disk file systems have limits on how large a given datafile can be.

We might also want to set a tape device as the default device for all channels, along with some specific parameter settings. In this case, our
configure
command might look like this:

-- Note that we could have used the sign after the PARMS clause if

-- we preferred like this:

-- PARMS 'ENV (NB ORA CLASS RMAN rs100 tape).

-- This is true with many parameters.

CONFIGURE CHANNEL DEVICE TYPE sbt MAXPIECESIZE 100m

PARMS 'ENV (NB ORA CLASS RMAN rs100 tape)';

When using the
configure
command, you may find that you need to clear a given configuration so that you can use the default. To do this, use the
configure
command with the
clear
option. In this example, we are clearing out the default options set for default channel 1: CONFIGURE CHANNEL 1 DEVICE TYPE DISK CLEAR;

Configuring Backup Set–Related Settings

You may wish to configure a default maximum size for an entire backup set, in which case you would use this slightly modified syntax (it is followed by an example of resetting this value back to the default, which is unlimited):

CONFIGURE MAXSETSIZE TO 7500K;

CONFIGURE MAXSETSIZE CLEAR;

CAUTION

Other books

Treasures of the Snow by Patricia St John
For The Love Of Sir by Laylah Roberts
Awaken by Bryan, Michelle
Mission to America by Walter Kirn
More Than Allies by Sandra Scofield
The Wright Brother by Marie Hall
Circle of Fire by S. M. Hall