TO CREATE A BACKUP WITH PASSWORD ENCRYPTION, FIRST SET THE ALGORITHM AND THE PASSWORD AND THEN MAKE THE BACKUP

192, or 256 bits. To create a backup with password encryption, first set the algorithm

and the password and then make the backup. For example,

set encryption algorithm 'aes256' identified by pa55word;backup as compressed backupset database format '/u01/mnt/backups/orcl_enc.bkp';

Before attempting to restore using the backup, set the password again:

set decryption identified by pa55word;

If the restore operation might require many backups encrypted using different

passwords, run a series of set decryption commands to specify them all.

EXAM TIP The default encryption requires a wallet and will be AES128.

Alternatively, a password or longer keys can be specified.

Configuring RMAN Defaults

The Recovery Manager is meant to be easy to use out of the box, but the defaults may

well not be appropriate for any one site. By configuring the defaults, RMAN’s operations

can be customized to your environment.

Figure 15-1 shows the use of the SHOW command, followed by three

CONFIGURE commands.

P AR T III

Figure 15-1 Use of SHOW and CONFIGURE to set defaults

The SHOW command displays RMAN’s configured defaults. In the figure, they

are all on their default values. These are hard-coded. To adjust these defaults, use the

CONFIGURE command. The first CONFIGURE command instructs RMAN to always

launch four channels when backing up to disk unless a different number of channels

is specified, and to always write out compressed backup sets unless some other form

of backup is specified. The second CONFIGURE command enables optimization. This

allows RMAN not to back up certain files if it considers that it already has sufficient

copies of the files. Optimization is related to the retention policy. The default retention

policy is 1, meaning that RMAN will attempt to have at least one copy of everything.

The third CONFIGURE command changes the retention policy to REDUNDANCY 3,

meaning that RMAN will attempt to keep three copies of everything. The result of the

configuration adjustments shown in Figure 15-1 could be seen by running SHOW

ALL again.

There are two possible retention policies that can be configured. A redundancy level

specifies a number of copies of files that should be kept. If set to 3, then when RMAN

makes a fourth backup of a file, it will consider the first backup to be redundant, and a

candidate for deletion. The alternative strategy is to set a recovery window:

RMAN> configure retention policy to recovery window of 90 days;

This command instructs RMAN always to keep backups of datafiles and archive logs

such that it could do a point-in-time recovery to any time in the last 90 days. This

requires at least one backup of every datafile that is at least 90 days old, plus all the

archive logs generated since then.

Backup optimization is really only applicable to archive logs and the datafiles of

read-only or offline tablespaces. If optimization is enabled, RMAN will not create

additional backups of files if it already has sufficient identical copies of the files to

meet its retention policy. Since online read-write datafiles are always changing, RMAN

will never consider that it has identical copies.

To return a configured setting to its out-of-the-box default, use the CLEAR

command, as in this example, which uses SHOW to check values, and CLEAR to

return them to default:

RMAN> show device type;RMAN configuration parameters for database with db_unique_name ORCL are:CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TOCOMPRESSED BACKUPSET;RMAN> configure device type disk clear;old RMAN configuration parameters:RMAN configuration parameters are successfully reset to default valueCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

Managing and Monitoring RMAN Backups

The RMAN executable provides commands for reporting on what backups have been

made and what backups are required. The same information can also be obtained

through the Database Control interface, or it is possible to query the RMAN repository

directly by querying various views that are populated from it. If you are using a

Recovery Catalog, this is another source of information. RMAN can also physically

remove backups from tape and disk.

The LIST, REPORT, and DELETE Commands

As a general rule, LIST tells you about backups that have been made, whereas REPORT

tells you what needs to be backed up. The following table shows some examples of LIST:

Command FunctionRMAN> list backup; List all your backup sets.RMAN> list copy; List all your image copies.RMAN> list backup of database; List all your whole database backup sets, whether full or incremental.RMAN> list backup of datafile 1;List the backup sets that include datafile 1 RMAN> list backup of tablespace and the backups that include the USERS users;tablespace.RMAN> list backup of List all archive log backup set backups. Use this archivelog all;command or the next to investigate backups of archive logs.RMAN> list copy of archivelog List all image copies of archive logs generated from time='sysdate - 7';in the last seven days.RMAN> list backup of archivelog List all backup sets containing archive logs of from sequence 1000 until log switch sequence numbers 1000–1050.sequence 1050;

To change the format of the dates and times in the output of LIST, set the

environment variable NLS_DATE_FORMAT before launching the RMAN executable.

For example, on Unix,

$ export NLS_DATE_FORMAT=dd-mm-yy hh24:mi:ss

or on Windows,

C:\> set NLS_DATE_FORMAT=dd-mm-yy hh24:mi:ss

will change the date/time display to the European standard.

The REPORT command interrogates the target database to determine what needs

to be backed up. This requires contrasting the physical structure of the database and

the archived logs that have been generated with the backup sets and copies as recorded

in the repository, and applying a retention policy. The retention policy can be that

configured as a default, or it can be specified as part of the REPORT command. This

table shows some examples:

RMAN> report schema; List the datafiles (but not the controlfile or archived logs) that make up the database.RMAN> report need backup; Apply the configured retention policy and list all the datafiles and archive log files that need at least one backup to conform to the policy.RMAN> report need backup List all objects that haven’t been backed up for three days 3;days. Use this command or the next to ignore the configured retention policy.List all files of which there are not at least three redundancy 3;backups.

RMAN has a retention policy. This is a database-wide setting, which controls how

many backups of each file RMAN will attempt to keep.

The REPORT OBSOLETE command takes things a step further: it contrasts the

RMAN backups that have been taken with the retention policy and lists all those that

can be deleted because they are no longer required. This command works in conjunction