Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

How to create a RMAN Catalog & register in Oracle Database 12c(12.2.0.0)

Posted by Mir Sayeed Hassan on October 4th, 2021

How to create a RMAN Catalog & register in Oracle Database 12c(12.2.0.0)

Overview of recovery catalog

The recovery catalog contains metadata about RMAN operations for each registered target database. therefore when RMAN is connected to a recovery catalog, the RMAN obtains its metadata exclusively from the catalog db, to perform this operation you need to have a dedicated user along with dedicated tablespace assign to them.

Below category which includes of metadata, such as

– Datafile copies
– Datafile & archived redo log backup sets & backup pieces
– Archived redo logs & its copies
– Database structure such as tablespaces and datafiles
– Stored scripts
– RMAN configuration setup

Check the status of database

[oracle@mirtdb~]$ sqlplus / as sysdba
SQL> show pdbs

CON_ID     CON_NAME     OPEN MODE    RESTRICTED
------------------------------------------------
2          PDB$SEED     READ ONLY       NO
3          ORAPDB       READ WRITE      NO
SQL> select instance_name,version, open_mode from v$database, v$instance;

INSTANCE_NAME      VERSION       OPEN_MODE
------------------------- -----------------
ORASID            12.2.0.1.0    READ WRITE

Create a tablespace

SQL> create tablespace recovery_catalog datafile '/u02/app/oracle/oradata/ORCL/recovery_catalog.dbf'
size 100M autoextend on extent management local uniform size 1M;

Tablespace created.

Create a dedicated user to assign for recovery_catalog

SQL> create user rcat identified by rcat default tablespace recovery_catalog quota unlimited on recovery_catalog;
User created.

Grant Appropriate Privileges to user rcat

SQL> grant recovery_catalog_owner to rcat;
Grant succeeded.

Verify the privileges

SQL> select privilege from dba_sys_privs where grantee = 'RECOVERY_CATALOG_OWNER';

PRIVILEGE
----------------------------------------
CREATE TABLE
ALTER SESSION
CREATE VIEW
CREATE TYPE
CREATE SYNONYM
CREATE CLUSTER
CREATE TRIGGER
CREATE SESSION
CREATE PROCEDURE
CREATE DATABASE LINK
CREATE SEQUENCE

11 rows selected.

To connect to the catalog, create an entry in TNSNAMES.ORA FILE as shown below

[oracle@e01ca809437f ~]$ cd /u01/app/oracle/product/12.2.0/dbhome_1/admin/ORASID
[oracle@e01ca809437f ORASID]$ pwd
/u01/app/oracle/product/12.2.0/dbhome_1/admin/ORASID
[oracle@e01ca809437f ORASID]$ ls

listener.ora sqlnet.ora tnsnames.ora xdb_wallet
[oracle@e01ca809437f ORASID]$ cat tnsnames.ora
ORASID = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORASID.localdomain) ) )
ORAPDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORAPDB.localdomain) ) )

Edit the tnsnames.ora file & enter the below command

CDBRCAT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORASID.localdomain) ) )

Verify

[oracle@e01ca809437f ORASID]$ cat tnsnames.ora

ORASID = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORASID.localdomain) ) )
ORAPDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORAPDB.localdomain) ) )
CDBRCAT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORASID.localdomain) ) )
[oracle@e01ca809437f ORASID]$ rman target / catalog rcat@CDBRCAT

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Oct 4 09:23:44 2021
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORASID (DBID=2930506103)
recovery catalog database Password: rcat
connected to recovery catalog database
Note: Provide the user rcat password: rcat

Create a RMAN Catalog

RMAN> create catalog tablespace recovery_catalog;
recovery catalog created
RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

Verify

[oracle@mirtdb ORASID]$ sqlplus rcat@CDBRCAT

SQL> set linesize 200
SQL> select * from rc_database;

DB_KEY   DBINC_KEY  DBID         NAME       RESETLOGS_CHANGE#   RESETLOGS FINAL_CHANGE#
-----------------------------------------------------------------------------------------------
1          2      2930506103    ORASID       52994787             04-OCT-21

=====Hence tested & verified in our test env=====