Oracle RMAN 11g Backup and Recovery (83 page)

RMAN in Oracle Database 11
g
Release 2 offers several different compression options to choose from:

■ DEFAULT

■ LOW

■ MEDIUM

■ HIGH

The DEFAULT compression type is the same compression that was available starting with Oracle Database 10
g
Release 1 and does not require a license. The LOW, MEDIUM, and HIGH

levels of compression offer you the ability to control the overall impact of compression on the system. LOW offers some compression with minimal CPU impact, whereas MEDIUM and HIGH

offer incrementally better compression with incrementally higher performance impacts. If you use any compression other than DEFAULT, you must purchase a separate license from Oracle.

You can configure compression as a default value by using the RMAN
configure
command (discussed in Chapter 3). Here is an example of configuring default compression in an Oracle 11
g
Release 2 Database:

Configure compression algorithm 'DEFAULT';

Configure compression algorithm 'HIGH';

Configure compression algorithm 'MEDIUM';

Configure compression algorithm 'LOW';

Configure compression algorithm clear;

You could configure compression as a default in earlier Oracle Database 10
g
and 11
g
Release 1.

Each is done in a slightly different way. Please reference the Oracle documentation for more information on how to enable compression for the version of the database that you are running.

238
Part II: Setup Principles and Practices

Tags and Restore Points

Tags and restore points provide similar functionality in Oracle Database 11
g
and earlier versions.

Both can be used to recover a database to a given point in time. Point-in-time (or incomplete) recovery is discussed in more detail in Chapter 14. In this section we will look at tags and restore points in more detail.

Tags

Each backup in Oracle can be assigned a tag. A tag is a name of no more than 30 characters that is associated with a specific backup and can be referenced during restore operations to indicate a specific backup to be used. This applies to full backups, tablespace backups, datafile backups, incremental backups, and even backup copies (all of which will be discussed in this chapter).

Here is an example of assigning a tag to a full backup:

backup database tag 'test backup';

In this example, we used the
tag
parameter to identify this backup. Each tag should be unique, and RMAN will allocate a tag to each backup set by using a default naming convention if one is not assigned. The same tag can be applied to multiple backups, and the latest backup will be restored by default.

Restore Points

While a tag is associated with a specific backup, a restore point is associated with a specific point-in-time. RMAN does not provide a command to create a restore point. You can use the RMAN
sql
command to issue the SQL
create restore point
command as seen here: SQL "Create restore point Charlie one";

You can also create a restore point from the SQL*Plus point with the
create restore point
command as seen in this example:

SQL>Create restore point Charlie one;

If you create backups using the
keep
option, you can also create a restore point during that backup. See the section on the
keep
option later in this chapter for more information on creating restore points when using the
keep
option.

Restore points can be referenced during RMAN restores in lieu of other point-in-time restore methods (such as time-based restores). We will discuss using restore points for recovery in more detail in Chapter 14.

Limiting Backup Impacts

To assist you in reducing the overall I/O impact of an RMAN backup on other processes, RMAN

offers the
duration
parameter of the
backup
command. The
duration
parameter is like an alarm clock; if the backup runs longer than the duration specified, RMAN will cancel the backup. Here is an example of using the
backup duration
command:

backup duration 00:30 database;

One thing that makes the
duration
parameter a bit less usable is that you cannot use the
backup database plus archivelog
command. The
duration
parameter also helps you to throttle

Chapter 11: RMAN Backups
239

your backups. When defining a duration, you can indicate that RMAN should try to minimize either of the following:

■ The time that the backup takes to run

■ The I/O load that the backup consumes

If you try to minimize the time that the backup runs, RMAN will back up at full speed. This is the default setting. Another feature when you use the default
minimize time
parameter is that RMAN will prioritize the datafiles that are backed up. Those that were backed up recently will have a lower priority than those that have not been backed up recently.

You can also tell RMAN to try to spread out the backup I/O over the duration window that you have established, thus eliminating the overall impact that the backup has on the system: backup duration 00:30 minimize time database;

backup duration 00:30 minimize load database;

Finally, with the
duration
parameter, you can indicate how RMAN should treat backups that fail the
backup duration
time restriction. When you use the
partial
parameter, if the backup is terminated because it has exceeded the
duration
parameter, RMAN will not treat it as a failed backup. Thus, remaining commands in any
run
block will continue to be executed. This is handy if you have subsequent
backup
commands like archived redo log backups. Regardless of the setting of
partial
, Oracle will consider any backup set that has been completed successfully to be usable even if the entire backup process did not complete.

Limiting the Size of a Backup Set

The following example builds on our previous example by adding a new parameter,
maxsetsize
: backup database maxsetsize 50m tag 'test backup';

Using this parameter, we have limited the maximum size of the backup set to 50MB. This is handy if your tape has a size limit or if your disks can only handle datafiles that are a certain size.

Oracle will split the backup into multiple backup sets, each no larger than the
maxsetsize
parameter that you defined.

The
maxsetsize
parameter can also lead to a problem in that it limits the overall size of an individual backup set. Thus, if you have a datafile in your backup set that is larger than the defined limit, the backup will fail, as shown in the next example (some output has been removed for brevity):

RMAN> set maxcorrupt for datafile 1 to 10;

RMAN> run

2> {

3> allocate channel c1 device type disk format 'd:\backup\robt\robt %U'; 4> allocate channel c2 device type disk format 'd:\backup\robt\robt %U'; 5> backup maxsetsize 50m tag 'test backup' database;

6> }

allocated channel: c1

Other books

Pendant of Fortune by Gold, Kyell
Domme By Default by Tymber Dalton
The Real Me by Herrick, Ann
Chasing William by Therese McFadden
A Cure for Night by Justin Peacock
The Strength of the Wolf by Douglas Valentine