Pages

Saturday, April 29, 2017

RMAN Configurations

RMAN Configurations


-CONFIGURE RETENTION POLICY

It used with the 2 different options. Recovery Window or Redundancy

Redundancy: CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

If you set Redundancy to 1, RMAN will keep one backup. If you take second backup , RMAN will sign previous backup as obsolete. You can delete obsolete backup with “delete obsolete” command.

Recovery Windows: CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;

If you set Recovey windows to 3 days, RMAN will sign backups as obsolete older than 3 days.
For example, we have 4 backups. And our backup dates are 16 may, 18 may, 21 may and 23 may.

If we set Recovery window to 3 days, RMAN must sign 16may and 18 may backups as obsolete
(23may – 3 days=20may). But RMAN signs 18may backup as not obsolete. Because RMAN automatically detects backups. And 18may backup is needed for recovery of 20may.

-CONFIGURE DEFAULT DEVICE TYPE

Backup can be taken two different locations. Tape and Disk

For backing up to disk: CONFIGURE DEFAULT DEVICE TYPE TO DISK;

For backing up to tape: CONFIGURE DEFAULT DEVICE TYPE TO SBT;

-CONFIGURE CONTROLFILE AUTOBACKUP ON/OFF

Automatically backups the controlfile to fra. (If you dont set FRA then it puts backup of

controlfile to $ORACLE_HOME/dbs by default)

-CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’

By default, RMAN automatically names control file backups and  saves them into FRA. To configure RMAN  to write control file backups to the specific directory:  %F will generate a unique filename likes  c-‘IIIIIIIIII-YYYYMMDD-QQ’ . Here  ‘IIIIIIIIII’ is DBID, ‘YYYYMMDD’ is date and  ‘QQ’ is hexadecimal id. You can also backup controlfile to specific location. For example;

-CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘uo1/oradata/cf_%F’;

You can also reset configuration.

-CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK CLEAR;

-To change  the location of RMAN backups:

RMAN> configure channel device type disk format '/u01/app/oracle/oradata/orcl/backup/%U' maxpiecesize 8 G;


You can also write in RUN script.

RMAN> SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE sbt TO 'controlfile_%F';
RMAN> BACKUP AS COPY DATABASE;
RMAN> RUN {
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/tmp/%F.bck';
BACKUP AS BACKUPSET DEVICE TYPE DISK DATABASE;
}

Format Description

%a Specifies the activation id number of the database.
%A Specifies the activation id number of the database completed 0
%c Specifies the copy number of the backup piece within a set of duplexed backup pieces. The maximum value is 256.
%d Specifies the name of the database
%D Specifies the current day of the month in format DD
%e Specifies the archived log sequence number
%f Specifies the absolute file number
%F Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name
%h Specifies the archived redo log thread number
%I Specifies the DBID
%M Specifies the month in format MM
%n Specifies the name of the database. padded on the right with x characters to a total length of eight characters.
%N Specifies the tablespace name.
%p Specifies the piece number within the backup set
%r Resetlogs ID
%s Specifies the backup set number
%S Specifies the backup set number completed 0
%t Specifies the backup set time stamp.
%T Specifies the year, month, and day in format YYYYMMDD
%u Specifies an 8-character name constituted by compressed representations of the backup set or image copy number.
%U Specifies a system-generated unique file name.
%Y Specifies the year in this format: YYYY.

-CONFIGURE BACKUP OPTIMIZATION OFF/ON

If you set this configuration to ON then the backup command skips backing up files when the identical file has already been backed up. RMAN uses to determine whether a file is identical to a file that it is backed up with following criterias.

-CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET
Specifies number of channels which determines whether RMAN reads or writes in parallel. You must also specify DEVICE TYPE.

-CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3

The configure “datafile backup copies” used to specify how many copies of each backup piece
should be created on the specified device type for the datafile. In my example above, it will take backup 3 copy. It is known as mirror backup. You can specify 3 different location with FORMAT option.

BACKUP DEVICE TYPE DISK COPIES 3 DATAFILE 7 FORMAT
‘/tmp/%U’,’?/oradata/%U’,’?/%U’;

-CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1
The configure “archivelog backup copies” used to specify how many copies of each backup piece should be created on the specified device type for the arhive log files. You can specify 2 different location with FORMAT option.

-CONFIGURE MAXSETSIZE TO UNLIMITED

You can use the MAXSETSIZE parameter on the BACKUP and configure commands to set a limit for the size of backup sets. If you set maxsetsize less than backing up datafile size then you will get an error. Default value of this configuration is “unlimited”.

-CONFIGURE ENCRYPTION FOR DATABASE OFF/ON

Encrypted backups cannot be read if they are obtained by unauthorized users. This configuration specifies whether encryption will be used or not.

-CONFIGURE ENCRYPTION ALGORITHM ‘AES128’

-CONFIGURE COMPRESSION ALGORITHM ‘BASIC’ AS OF RELEASE ‘DEFAULT’ OPTIMIZE FOR LOAD TRUE

There are two compression method ZLIB and BZIP2. ZLIB consumes less cpu but the compression
rate is low. BZIP2 consumes more cpu but the compression rate is high.

-CONFIGURE COMPRESSION ALGORITHM ‘ZLIB’;

-CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

There are 3 compression level. LOW, MEDIUM and HIGH. HIGH level is not recommended because of suited for backups over slower networks. MEDIUM level is recommended.

-CONFIGURE ARCHIVELOG DELETION POLICY TO NONE

Specifies the archive log deletion policy.

In 10g you can set;

-CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO {ARCHIVERETENTION};

In 11g you can set;

-CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;

The archived log deletion policy also has option specific to Data Guard. For example, if you set archive log deletion policy to the “APPLIED ON STANDBY” then RMAN can delete logs after they have been applied at all mandatory remote destinations.

-CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

-CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE

You can use maxpiecesize channel parameter to set limits on the size of backup pieces. In my example below, I limit the backup piece size to 2G.

-CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 2G;

-CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/oracle/ora10g/dbs/snapcf_test11g.f’

RMAN needs a snapshot control file when resynchronizing with the recovery catalog or taking a backup of the current control file. The default location is platform specific and depends on the Oracle home of each target database. In Linux environment it locates in $ORACLE_HOME/dbs directory. You can change its location with this configuration.

No comments:

Post a Comment