Oracle RMAN 11g Backup and Recovery (44 page)

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

Configure the Database to Use the Password File

By default, an Oracle database is not configured to use the password file (unless you have used the ODBCA to create your database). To configure the database, edit the parameter file (init.ora) in your favorite editor. The parameter we are interested in is REMOTE_LOGIN_PASSWORDFILE.

This parameter can be set to one of three values in Oracle Database 11
g
:


none
The default value. In this case, Oracle will ignore the password file, and only local privileged logins will be recognized for sysdba access.


shared
This parameter indicates that multiple databases can use the same password file.

When in this mode, only the SYS user account password can be stored.


exclusive
This parameter indicates that the password file is used by only one database.

In this mode, the password file can contain passwords for several privileged Oracle accounts. This is the recommend mode of operation, particularly when running RMAN.

If you wish to connect RMAN to your database from a remote client, you must use this parameter setting.

If you are using an SPFILE instead of a text-based parameter file, then use the
alter system
command to modify this parameter setting:

alter system set REMOTE LOGIN PASSWORDFILE EXCLUSIVE scope spfile;

Finally, the REMOTE_LOGIN_PASSWORDFILE parameter is not dynamic, so you cannot change it with the database up and running. Instead you will have to change the SPFILE (using the
scope=spfile
parameter of the
alter system
command) and then shut down the database and restart it.

Setting the CONTROL_FILE_RECORD_KEEP_TIME

Parameter

When configuring your database for RMAN, you should consider how long you wish backup records to be stored in the control file. This includes records of full database backups and of specific datafile, control file, parameter file, and archive log backups. The database parameter CONTROL_FILE_RECORD_KEEP_TIME is defined in days (the default is
7
). Thus, by default, Oracle will maintain RMAN backup and recovery records for seven days. You can set this parameter to any value between 0 and 365 days.

Chapter 3: RMAN Setup and Configuration
83

This parameter can have a number of operational database impacts. First, it directly impacts the size of the database control file, because as RMAN backups occur, records relating to these backups are stored in the control file. As records are saved in the control file, the control file might well run out of space. In this case, Oracle will expand the control file to accommodate the storage of the required number of backup records. Setting this parameter to
0
will disallow any control file growth, but has the negative effect of making the RMAN backup history retention period uncertain.

We suggest that you set CONTROL_FILE_RECORD_KEEP_TIME to a value no less than your selected database backup retention period. Otherwise, you risk having database backups available on your backup media without related backup records available in the control file. This can cause serious complications if you need to recover these older backups for some reason!

CAUTION

There are a number of places where incorrectly set file retention

can cause your backup’s retention strategy to fail. These include

incorrectly setting CONTROL_FILE_RECORD_KEEP_TIME, RMAN

retention policies, or retention policies on your tape vendor products.

Make sure all retention policies are aligned so you don’t wake up

someday and find you are unable to restore your backups.

Configuring RMAN Default Settings

RMAN allows you to perform automated database backup and recovery, as you will see in later chapters. To support this feature, RMAN allows you to define default values for a number of settings, such as channel configuration. In this section, we look at the configuration of default RMAN settings. Of course, if you can configure something, you will want to be able to change that configuration, and even to remove it completely if required. We will look at that, too. So, what will be the benefit of all of this configuration work? It will make the process of actually doing backups much easier in the end. First, we will quickly examine the
configure
command in RMAN and all that it provides us. Then, we will look at several of the different defaults you might want to configure by using the
configure
command.

Throughout this section, we use a number of terms that you might not yet be familiar with because they are covered in later chapters. Many of the terms were introduced in Chapter 2, though others may not be quite clear to you yet. That’s okay, because to use RMAN, none of the default configuration options are really required. We suggest that you skim this section to get a feel for the various default values that you can set, and then, after you have read later chapters, return here and reread this section. At that point, you will be ready to decide what defaults you want to apply to your Oracle database.

Introducing the configure Command

RMAN provides the
configure
command, which allows you to define default values to be applied when executing backup and recovery sessions. Using the
configure
command, RMAN allows you to make changes to the default values of the various parameters that are persistent until cleared or changed again. The ability to customize default configuration settings allows you to execute

84
Part II: Setup Principles and Practices

automated RMAN operations. The following are several of the different settings that you can configure:

■ A default device type, such as disk or SBT (system backup tape), to use for RMAN jobs.

■ The number of channels that are automatically allocated when performing automated backup and restore jobs.

■ A tablespace exclusion policy to configure specific tablespaces to be excluded during full database backup operations.

■ The maximum size for any given backup piece and the size of any backup set when doing an automated backup.

■ Backup optimization to default to ON or OFF. Backup optimization eliminates duplicate backups of identical datafiles (for example, those associated with read-only tablespaces) and archived redo logs.

■ The default filename for the snapshot control file (refer to Chapter 2 for more details on the snapshot control file).

■ The default for automated backups of the control file to ON or OFF, as well as the default format for the control file backup output files and the default device on which to create these backups.

■ The default filenames for files of an auxiliary database.

■ A default retention policy, which determines which backups and copies are eligible for deletion because they are no longer needed.

■ The default encryption value and the associated encryption algorithm.

■ The default compression algorithm to use if compression is to be used.

■ A deletion policy for archived redo logs.

Each configurable setting has a default value assigned to it. The defaults are stored in the database control file (as are any configured values). This is true even if you are connecting to a recovery catalog. You can see the currently configured values for the various RMAN parameters by using the
show
command. Any nondefault RMAN-configured settings are also listed in the V$RMAN_CONFIGURATION database view. Here are some examples of the
show
command’s use: show default device type;

show maxsetsize;

show retention policy;

show all;

Configuring Various RMAN Default Settings

This section looks at setting RMAN defaults. First, let’s look at configuration of channel default settings. You can configure channels in different ways. You can configure defaults for all channels with the
configure channel device type
command, or configure defaults for specific default channels with the
configure channel
n
device type
command.

Chapter 3: RMAN Setup and Configuration
85

You can clear channel defaults for all channels with the
configure channel device type clear
command, and clear channel defaults for specific default channels with the
configure channel
n

device type clear
command.

When you allocate a channel with the
allocate channel
command, you can specify the assigned names to the channels that you allocate. For example, the
allocate channel d1 device
type disk
command will create a channel called d1. When automated channels are allocated, Oracle assigns default names to these channels. These default names depend on the type of default device used. The following table provides an example of the default name format that will be used.

Device Type

Default Name Format

Example

Disk

ORA_DISK_
n

ORA_DISK_1

ORA_DISK_2

Tape

ORA_SBT_TAPE_
n

ORA_SBT_TAPE_1

ORA_SBT_TAPE_2

The number of channels that are automatically allocated depends on the default level of parallelism defined (which we will discuss later in this chapter).

When you issue the
configure
command, Oracle displays the previous configuration settings, followed by the new configuration setting. Now, let’s look at some of the ways that you can use the
configure
command to automate the backup and restore process with RMAN.

Examples of Using the configure Command

This section presents some examples of using the
configure
command to define default values. In this section, we cover a number of topics revolving around the
configure
command, including:

■ Configuring channel default settings

■ Using the format string

■ Configuring default automated backups of the control file and the SPFILE

■ Configuring default retention policies

■ Configuring default levels of encryption

■ Configuring archive log deletion policies

Configuring Channel Default Settings

Let’s start with an example of configuring the default backup/restore device to tape or to disk. In this case, all channels assigned to backups will be allocated to disk:

CONFIGURE DEFAULT DEVICE TYPE TO SBT;

CONFIGURE DEFAULT DEVICE TYPE TO DISK;

When default device types are configured, Oracle will use that default channel unless you override the default using the
backup device type
parameter. Maintenance channels for
delete
commands and auxiliary channels for duplicate operations will also be automatically allocated.

Other books

El imán y la brújula by Juan Ramón Biedma
Rococo by Adriana Trigiani
The Tree Shepherd's Daughter by Gillian Summers
Panther Mystery by Charles Tang, Charles Tang
These Things Happen by Kramer, Richard