Forum Stats

  • 3,757,136 Users
  • 2,251,200 Discussions
  • 7,869,738 Comments

Discussions

Two questions on RMAN

VitaminD
VitaminD Member Posts: 112 Bronze Badge
edited Sep 17, 2021 10:19AM in Recovery Manager (RMAN)

DB version: 19c 

OS : RHEL 7.9 




The below shown WMSDEVP database is cloned from WMSPROD database every month end.


Question1. What exactly does the below list incarnation of database; output show ?


$ rman target / catalog rmanuser/tigress#[email protected]_tns

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Sep 14 16:49:24 2021
Version 19.9.0.0.0

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

connected to target database: WMSDEVP (DBID=958044447)
connected to recovery catalog database

RMAN> list incarnation of database;


List of Database Incarnations
DB Key Inc Key DB Name DB ID      STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
614010197 614010634 WMSDEVP 941982456    PARENT 424507033781 11/10/2020 13:13:07
614010197 614010198 WMSDEVP 941982456    CURRENT 449803688862 10/03/2021 16:25:38
624450816 624451257 WMSDEVP 950472293    PARENT 424507033781 11/10/2020 13:13:07
624450816 624450817 WMSDEVP 950472293    CURRENT 466387289357 15/06/2021 22:42:56
633175183 633175636 WMSDEVP 958044447    PARENT 424507033781 11/10/2020 13:13:07
633175183 633175184 WMSDEVP 958044447    CURRENT 479389309452 10/09/2021 14:05:25

RMAN>


Question2. Now that the cloning is complete, I have been asked to remove older incarnations by running dbms_rcvcat.unregisterdatabase procedure.

But, which of the below should I choose to remove ?


Connected to the RMAN catalog via SQL Plus


sqlplus rmanuser/tigress#[email protected]_tns

SQL> SELECT db_key, dbid, name, RESETLOGS_TIME FROM rc_database WHERE name = 'WMSDEVP' ;

  DB_KEY    DBID NAME   RESETLOGS_TIME
---------- ---------- -------- -----------------
 633175183 958044447 WMSDEVP 10-SEP-2021 14:05
 614010197 941982456 WMSDEVP 10-MAR-2021 16:25
 624450816 950472293 WMSDEVP 15-JUN-2021 22:42


SQL> select 'exec dbms_rcvcat.unregisterdatabase('||db_key||','||dbid||');' from rc_database where name like '%WMSPR%' order by db_key ;

'EXECDBMS_RCVCAT.UNREGISTERDATABASE('||DB_KEY||','||DBID||');'
------------------------------------------------------------------------------------
exec dbms_rcvcat.unregisterdatabase(614010197,941982456);
exec dbms_rcvcat.unregisterdatabase(624450816,950472293);
exec dbms_rcvcat.unregisterdatabase(633175183,958044447);

SQL>