Mar 01

Build Your Own Oracle Infrastructure: Part 12 – Use Oracle Recovery Manager

Build Your Own Oracle Infrastructure: Part 12 –            Use Oracle Recovery Manager.


Recovery Manager or RMAN as it is more commonly known, is Oracle’s proprietary backup, restore and recovery solution for Oracle databases.

In Part 12, we’ll setup RMAN and run through some common and more interesting backup, restore and recovery scenarios.


These are the main tasks we’ll cover. Click the link you need:

Task #1: Create an RMAN Catalog.

Task #2: Execute RMAN Backups. (coming soon – I’m moving house)

Task #3: Execute RMAN Restores & Recoveries. (coming soon – I’m moving house)

Task #4: More Advanced Uses of RMAN. (coming soon – I’m moving house)

Task #5: RMAN Reporting. (coming soon – I’m moving house)


Task #1: Create an RMAN Catalog.

In most cases, using an RMAN catalog is useful. It’s not strictly necessary since database backups will be recorded in the database control files anyway. Like with most things there are pros and cons. For example, if you have more than a few databases, recording backup activity in one place is more efficient and convenient. However, if your RMAN catalog database is down then your backups will fail. So you have the added overhead of protecting your RMAN catalog database. In most cases you should treat it like any other production database.

To create an RMAN catalog, just follow these 3 simple steps:

Task #1, Step #1/3: Create a Database for the RMAN Catalog.

Since our infrastructure is small there’s no real need to fire up a separate database to host an RMAN catalog. Instead, we’ll create another PDB within the CDB (PADMIN) which is already running the OEM Management Repository PDB (EMPDBREPOS).

Note, running more than one PDB within a CDB requires the multitenant license. Plus in a production environment, you would more likely choose to have completely separate databases for the OEM Management Repository and the RMAN catalog anyway. What we’re doing here is for demonstration/educational purposes only. 

So let’s crack on and create another PDB:

[oracle@oraemcc ~]$ . oraenv
ORACLE_SID = [oracle] ? PADMIN
The Oracle base has been set to /u01/app/oracle

[oracle@oraemcc ~]$ sqlplus / as sysdba

SQL> show con_name


SQL> create pluggable database rmancat admin user rmancat_admin identified by rmancat_admin;
Pluggable database created.

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
EMPDBREPOS                     READ WRITE
RMANCAT                        MOUNTED

SQL> alter pluggable database rmancat open;
Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
EMPDBREPOS                     READ WRITE
RMANCAT                        READ WRITE

Next, we’ll quickly add the relevant TNS connect string to the tnsnames.ora file:

[oracle@oraemcc ~]$ vi $ORACLE_HOME/network/admin/tnsnames.ora

    (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))


Task #1, Step #2/3: Create the Recovery Catalog Owner (RCO).

[oracle@oraemcc ~]$ sqlplus system@rmancat

SQL> create tablespace rmancat_data;
Tablespace created.

SQL> create user rco identified by rco default tablespace rmancat_data
     quota unlimited on rmancat_data;
User created.

SQL> grant create session, resource, recovery_catalog_owner to rco;
Grant succeeded.


Task #1, Step #3/3: Create the Recovery Catalog.

For this step, we actually log into RMAN:

[oracle@oraemcc ~]$ rman

RMAN> connect catalog rco/rco@rmancat
connected to recovery catalog database

RMAN> create catalog tablespace rmancat_data;
recovery catalog created

That’s it! The RMAN recovery catalog is now ready to use.