In this article we will discuss RMAN - Recovery Manager in detail with its architecture, uses and different scenarios of RMAN backup and recovery.
This is tool provided by Oracle to handle backup and recovery of databases, this is always introduced as Superman for DBA's.
First we will understand Why RMAN?
As discussed RMAN is inbuilt functionality in oracle we can start it with just invoking RMAN client, you just need set environment variable like oracle home, path properly.
$ RMAN
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jun 3 07:05:16 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
RMAN>
Now connect with user having privileges SYSDBA or SYSBACKUP.
RMAN> connect target "sys/oracle"
or
RMAN> connect target "sys/oracle@db_name"
or
$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jun 3 07:05:09 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: TECH_DB(DBID=1900906862)
RMAN>
You will see couple of things once you connect using RMAN
-DBID - database identifier- very important in certain recovery scenarios, assigned at the time of database creation
-Output of RMAN session is printed on screen itself or in in-memory view V$RMAN_OUTPUT (only 32768 rows)
-Logfile can be generated using option log='logfile name'
RMAN Architecture
There are key entities for RMAN to start with, some of them are mandatory and other are optional
Mandatory

This is tool provided by Oracle to handle backup and recovery of databases, this is always introduced as Superman for DBA's.
First we will understand Why RMAN?
- RMAN provides a single backup standard for entire enterprise
- RMAN is supplied with database software and so for using it does not need any additional license
- Backups can be easily automated using RMAN scripts
- RMAN allows you to generate number of reports for backup management as listing of available backups, their status, availability and listing the files which need to be backed up through simple commands such as LIST, REPORT etc.
- RMAN enables us to secure incremental backup i.e. taking backup of only modified blocks rather than entire database every time.
- RMAN can use multiple server session to complete backup based on our uses of parallelism.
- RMAN has inbuilt compression technique to reduce size of backup
- RMAN backups can be used to do cross platform conversion of database
- Only RMAN offers detection and recovery of corrupted blocks without asking for any downtime.
- RMAN is completely supported by Exadata
- RMAN is RAC aware and allows full support to backup and recovery of clustered databases
- RMAN can be used along with third party solutions such as Tivoli and Netbackups as well.
As discussed RMAN is inbuilt functionality in oracle we can start it with just invoking RMAN client, you just need set environment variable like oracle home, path properly.
$ RMAN
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jun 3 07:05:16 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
RMAN>
RMAN> connect target "sys/oracle"
or
RMAN> connect target "sys/oracle@db_name"
or
$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jun 3 07:05:09 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: TECH_DB(DBID=1900906862)
RMAN>
You will see couple of things once you connect using RMAN
-DBID - database identifier- very important in certain recovery scenarios, assigned at the time of database creation
-Output of RMAN session is printed on screen itself or in in-memory view V$RMAN_OUTPUT (only 32768 rows)
-Logfile can be generated using option log='logfile name'
RMAN Architecture
There are key entities for RMAN to start with, some of them are mandatory and other are optional
Mandatory
- Target Database
- Target Controlfile
- RMAN Channels
Optional
- Recovery Catalog
- Oracle Secure Backup
- Media Management Library
- Auxiliary Database
- Cloud Control 12c
Lets discuss this entities one by one
Target Database
- This is database for which RMAN is supposed to perform all the tasks of backup and if needed recovery as well.
- The database to which RMAN would be connected and working for is the target database.
Target Controlfile
- By default RMAN maintains its entire backup history or metadata in controlfile of target database. Duration is controlled by parameter control_file_record_keep_time in parameter file (Default is 7 days).
RMAN Channels
- Communication interface between target database and auxiliary database
- By keeping multiple channels, it gives benefit like parallelism and load balancing
- A server session is allocated in target database for the channel
Auxiliary Database
- Database which is used when doing tasks such as creating a duplicate database , doing taplespace point in time recovery (TSPITR) and database conversion to different platform or creating standby database, RMAN requires connection to this database which is getting executed
Recovery Catalog
- As we know backup information is stored in target controlfile, but it will impact the storage space consumption of disk, to tide over this shortcoming; there is optional metadata storage that can be configured, called Recovery Catalog
- Recovery Catalog is actually schema that we have to create it and then within it configure recovery catalog
- This stores all the information related to backup and recovery.
- This is can be configured on same target database but this is not recommended as any incident with target database can be dangerous to loose this information as well.
- Can be stored information of multiple databases.
- RMAN first stores information in target controlfile and then transfers it to recovery catalog.

RMAN Client
- This is executable file that gets invoked by DBA. Using this we issues the statement which are executed within target database.
12c Cloud Control
- This is latest offering in family of Enterprise Manager (EM), This is optional in RMAN, but it is still worth being used
Media Management Library (MML)
- In order to take backup on tapes instead of disk, RMAN needs to interact with underlying tapes location and for that it requires drivers related to that tape driver, provided its manufacturer
- MML is API that oracle provides to its vendors who write an interface between API and their products
Oracle Secure Backup
- This is add on feature for RMAN
- Oracle Secure Backup contains an in built MML for RMAN and offers a unified management interface for not just the database but also the underlying mount points
Memory requirements for RMAN
- RMAN uses shared pool memory structure by default in order to keep metadata within instance before taking it to target controlfile.
- Specifically talking, large pool (defined by LARGE_POOL_SIZE) is configured for RMAN activities, it will minimize the burden on shared pool as it is already occupied of large number of pools.
RMAN Backup Formats
There are two formats of backup supported in RMAN
- Backup Set
- Image Copy
Backup Sets
- Backup set is logical structure, contains physical RMAN-specified file, which is considered as real backup of its source files i.e. datafile.
- We can also say that metadata related to the physical RMAN-specified backup is contained within a backup set
- By default RMAN perform backup in backup set format only
- There are number of files generated during backup, each file is called backup piece
- We can say backup piece is actual physical file, so in order to control its size we can use MAXPIECESIZE option during backup.
Image Copy
- This is similar to normal copy that we take using OS copy command with benefit that it will be logged in controlfile and managed by RMAN
- The difference between image copy and backup sets is that image copy backup will always contain all the blocks within file whether they are used or not.
Types of RMAN Backup
There are mainly two types of RMAN backup
- Full Backup
- Incremental Backup
- Cumulative Incremental Backup
- Differential Incremental Backup
- This is entire database backup, can be done at mount stage or open stage
- This backup includes datafiles, controlfiles and binary parameter file (spfile)
- RMAN uses only used blocks to be included in this backup
- For huge databases, it consumes large amount of storage, time and resources, so to avoid this we have incremental backups
Incremental Backup
- This type of backup is used to minimize time, resource and storage space, it will be secure backup of blocks those are modified since last backup done
- Its important to remember that a full database backup is not considered as valid level incremental backup
There are two levels used for incremental backups
- Level 0 (base level backup)
- Level 1 (incremental level backup)
Level 0
- Signifies parent backup in an incremental backup strategy and consider it as base of all subsequent incremental backups.
- This includes all blocks of source file in backup file at the time of backup being done
Level 1
- This type of backup is child of level 0 backup and would contain only blocks which are modified since last level 0 backup.
Types of Level 1 Backups
- Differential
- Cumulative
Differential Incremental Backup
- The main motive behind incremental backup is to save time, and it true for this differential backup as well
- This backup contains all the changed blocks from either level 0 or level 1
- Suppose we are taken level 0 backup on Sunday and we are taking differential incremental backup on subsequent days i.e. Monday to Saturday
- Some cons with differential backup is that, as there will large number of backups, it would take long time to to finish restore and recovery
Cumulative Incremental Backup
- Cumulative backups includes all the modified blocks since the last backup level 0 from the current level 1
- Storage occupied will be larger than differential backup but number of backup copies will be less so will be the restore and recovery time
- Block change tracking (10g and above)
- Multi-Section incremental Backup (12c)
This options will be discussed in later articles.
Different Scenarios and examples will be discussed in subsequent posts
[Also read Oracle : User Managed Backups, RMAN Disk Backup, RMAN single datafile backup and list backups]
Different Scenarios and examples will be discussed in subsequent posts
[Also read Oracle : User Managed Backups, RMAN Disk Backup, RMAN single datafile backup and list backups]
good
ReplyDelete