Recovery Manager [RMAN] is a very powerful tool when it comes to Backup, Restore or recovering your database.

Today we will see Configuration of RMAN and how we can set them.

Let’s start from scratch.

1: Connecting to RMAN

To connect with rman we need to specify a target database name, username and password.

[oracle@dbatesting admin]$ rman target sys/oracle@orcl

Recovery Manager: Release 12.2.0.1.0 - Production on Sat Dec 29 20:51:53 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1523095627)

RMAN>

Or if we have set an environment variable for target database we can simply connect RMAN using following command it will be connected using OS credentials.

[oracle@dbatesting admin]$ export ORACLE_SID=orcl
[oracle@dbatesting admin]$ rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Sat Dec 29 20:52:56 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1523095627)

RMAN>

2. Let’s check the available configuration of RMAN using SHOW ALL command

RMAN> show all;

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 5;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 10 DAYS;
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/appndb/oracle/product/12.2.0.1/db_1/dbs/snapcf_orcl.f'; # default

RMAN>

3. We can see all available configuration in the above output.

Lets us start with retention policy.

Now, what is retention policy ??

It means till when or what number of backups we can keep.

We can set a retention policy by two methods :

1. Recovery Window : If we set it to 5 days till 5 days backup will be kept and after that backup will become obsolete . So if space pressure occurs in fast recovery area RMAN can delete those obsolete backups.

2.Retention Policy: Number of backups kept in the fast recovery area after that backup will become obsolete.

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

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;
new RMAN configuration parameters are successfully stored

RMAN> configure retention policy to redundancy 5;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 5;
new RMAN configuration parameters are successfully stored

RMAN>

In the above output, we can see I have set retention policy to 5 redundancy. That means 5 full back-ups will be kept safe in the fast recovery area. After that first backup will become obsolete , so when we will take 6th backup if space pressure occurs in fast recovery area rman can delete the first backup.

4. In show, all output we have seen control file autobackup is off.

RMAN> configure controlfile autobackup on;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN>

As we have set it on, every time backup is taken using RMAN, SPFILE and controlfile will be automatically backed up.

5.Clear RMAN configuration to default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN configuration parameters are successfully reset to default value

RMAN>

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.