Recovery Catalog: RMAN metadata is stored in a different database instead of the control file. That database works as a repository.
Follow the given steps to create a recovery catalog database
Step 1: Connect to the target database which you want to use as a recovery catalog.
Here in my case, I am using pdb as a recovery catalog
SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- RCATLOG READ WRITE SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 RPDB1 MOUNTED SQL> alter pluggable database rpdb1 open; Pluggable database altered.
Step 2: Change your session to the pdb database
SQL> alter session set container=rpdb1; Session altered. SQL> show con_name CON_NAME ------------------------------ RPDB1
Step 3: We need to create a tablespace which we need to store backup information of registered databases.
SQL> show parameter db_create_file_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_create_file_dest string /u02/oradata SQL> CREATE TABLESPACE TBS_RCAT DATAFILE SIZE 100M; Tablespace created.
Step 4: Create a user who will work as a recovery catalog owner
SQL> CREATE USER RCATOWN IDENTIFIED BY "rcat" DEFAULT TABLESPACE TBS_RCAT QUOTA UNLIMITED ON TBS_RCAT; User created.
Step 5: RECOVERY_CATALOG_OWNER role is needed for the user to create catalog database
SQL> GRANT RECOVERY_CATALOG_OWNER TO RCATOWN; Grant succeeded. SQL>
Step 6: Create TNS entry in tnsnames.ora for pdb database
Rpdb1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = Rpdb1) ) )
Step 7: Connect RMAN to pdb database with catalog clause
[oracle@localhost admin]$ rman catalog rcatown/rcat@rpdb1 Recovery Manager: Release 12.2.0.1.0 - Production on Thu Jan 3 10:58:40 2019 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to recovery catalog database
Step 8: Apply to create catalog database command
RMAN> create catalog; recovery catalog created RMAN>
Step 9: Connect RMAN with target and catalog clause
[oracle@localhost admin]$ rman target sys/oracle@demo catalog rcatown/rcat@rpdb1 Recovery Manager: Release 12.2.0.1.0 - Production on Thu Jan 3 10:59:59 2019 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: DEMO (DBID=3740643610) connected to recovery catalog database RMAN>
Step 10: Register target database and check the structure of the database using report schema
RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete RMAN> report schema; Report of database schema for database with db_unique_name DEMO List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 800 SYSTEM YES /u02/oradata/DEMO/datafile/o1_mf_system_g2v3h4nx_.dbf 3 460 SYSAUX NO /u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3kjm5_.dbf 4 70 UNDOTBS1 YES /u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3lxr9_.dbf 5 250 PDB$SEED:SYSTEM NO /u02/oradata/DEMO/datafile/o1_mf_system_g2v3ot3x_.dbf 6 330 PDB$SEED:SYSAUX NO /u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3ot3q_.dbf 7 5 USERS NO /u02/oradata/DEMO/datafile/o1_mf_users_g2v3lywc_.dbf 8 100 PDB$SEED:UNDOTBS1 NO /u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3ot45_.dbf 9 260 PDB:SYSTEM YES /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_system_g2v4j0j1_.dbf 10 350 PDB:SYSAUX NO /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_sysaux_g2v4j0p1_.dbf 11 100 PDB:UNDOTBS1 YES /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_undotbs1_g2v4j0p2_.dbf 12 5 PDB:USERS NO /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_users_g2v4mrlj_.dbf 13 100 PDB:TBS_RCAT NO /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_tbs_rcat_g2v5zj00_.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 33 TEMP 32767 /u02/oradata/DEMO/datafile/o1_mf_temp_g2v3ok6v_.tmp 2 64 PDB$SEED:TEMP 32767 /u02/oradata/DEMO/datafile/temp012019-01-03_09-56-19-606-AM.dbf 3 64 PDB:TEMP 32767 /u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_temp_g2v4j0p3_.dbf RMAN>
Step 11: Optionally you can take backup with recovery catalog if you want
RMAN> backup database; Starting backup at 03-JAN-19 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=33 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3h4nx_.dbf input datafile file number=00003 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3kjm5_.dbf input datafile file number=00004 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3lxr9_.dbf input datafile file number=00007 name=/u02/oradata/DEMO/datafile/o1_mf_users_g2v3lywc_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/backupset/2019_01_03/o1_mf_nnndf_TAG20190103T110348_g2v7oxyc_.bkp tag=TAG20190103T110348 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00010 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_sysaux_g2v4j0p1_.dbf input datafile file number=00009 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_system_g2v4j0j1_.dbf input datafile file number=00011 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_undotbs1_g2v4j0p2_.dbf input datafile file number=00013 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_tbs_rcat_g2v5zj00_.dbf input datafile file number=00012 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_users_g2v4mrlj_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E8758AC5ED126B4E055000000000001/backupset/2019_01_03/o1_mf_nnndf_TAG20190103T110348_g2v7rm8g_.bkp tag=TAG20190103T110348 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00006 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3ot3q_.dbf input datafile file number=00005 name=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3ot3x_.dbf input datafile file number=00008 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3ot45_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E872A11804F1BADE055000000000001/backupset/2019_01_03/o1_mf_nnndf_TAG20190103T110348_g2v7spyz_.bkp tag=TAG20190103T110348 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36 Finished backup at 03-JAN-19 Starting Control File and SPFILE Autobackup at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/autobackup/2019_01_03/o1_mf_s_996577588_g2v7tx8g_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 03-JAN-19
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