Saturday, May 24, 2025

How to create Virtual Private catalog and enable the VPD (virtual private database ) feature in rman catalog with upgrade ?

[oracle@orcl ~]$

[oracle@orcl ~]$ sqlplus sys/sys@demopdb1 as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 24 15:45:25 2025

Version 19.3.0.0.0


Copyright (c) 1982, 2019, Oracle.  All rights reserved.



Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0


SQL> @$ORACLE_HOME/rdbms/admin/dbmsrmanvpc.sql vpd rcatowner


Checking the operating user... Passed


The VPC user schemas of the following catalogs: VPD, RCATOWNER are going to be upgraded to a new VPD model


----------------------------------------

Removing old VPC views in the base catalog of RCATOWNER...

========================================

UPGRADE STATUS:

The VPC user schemas of these catalogs: RCATOWNER

have been successfully upgraded to the new VPD model!


Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:46:39 2025

Version 19.3.0.0.0


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


connected to recovery catalog database


RMAN> upgrade catalog ;


recovery catalog owner is RCATOWNER

enter UPGRADE CATALOG command again to confirm catalog upgrade


RMAN> upgrade catalog ;


RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-20516: cannot upgrade the catalog when other RMAN sessions are connected to catalog


RMAN> upgrade catalog ;


recovery catalog owner is RCATOWNER

enter UPGRADE CATALOG command again to confirm catalog upgrade


RMAN> upgrade catalog ;


recovery catalog upgraded to version 19.03.00.00.00

DBMS_RCVMAN package upgraded to version 19.03.00.00

DBMS_RCVCAT package upgraded to version 19.03.00.00.


RMAN>

How to execute stored script in rman catalog database ?

 

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:24:12 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database

RMAN>


RMAN>


RMAN> run {

2> execute script db_plus_arc_bkp;

3> }


executing script: db_plus_arc_bkp



Starting backup at 24-MAY-25

current log archived

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=37 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=17 RECID=12 STAMP=1201940579

input archived log thread=1 sequence=18 RECID=13 STAMP=1201956550

input archived log thread=1 sequence=19 RECID=14 STAMP=1201956572

input archived log thread=1 sequence=20 RECID=15 STAMP=1201961707

input archived log thread=1 sequence=21 RECID=16 STAMP=1201966425

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp tag=TAG20250524T153347 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

Finished backup at 24-MAY-25


Starting backup at 24-MAY-25

using channel ORA_DISK_1

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33sq62z_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00: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=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FACECCE69615207E0630400040AB366/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33sqyrs_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/33E6395D57264163E0630400040A2C41/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33srh8y_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

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=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FAC79D13BBE3BB3E0630400040A98FA/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33srxtp_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

Finished backup at 24-MAY-25


Starting backup at 24-MAY-25

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=22 RECID=17 STAMP=1201966510

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153511_n33ssj1p_.bkp tag=TAG20250524T153511 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backup at 24-MAY-25


Starting Control File and SPFILE Autobackup at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_24/o1_mf_s_1201966514_n33ssnvx_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 24-MAY-25


RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

using channel ORA_DISK_1

Deleting the following obsolete backups and copies:

Type                 Key    Completion Time    Filename/Handle

-------------------- ------ ------------------ --------------------

Archive Log          154    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_17_n330h31n_.arc

Archive Log          155    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_18_n33j24vq_.arc

Archive Log          156    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_19_n33j2wbt_.arc

Archive Log          157    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_20_n33o3c4t_.arc

Archive Log          194    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_21_n33spson_.arc

Backup Set           199    24-MAY-25

  Backup Piece       200    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp


Do you really want to delete the above objects (enter YES or NO)? YES

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_17_n330h31n_.arc RECID=12 STAMP=1201940579

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_18_n33j24vq_.arc RECID=13 STAMP=1201956550

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_19_n33j2wbt_.arc RECID=14 STAMP=1201956572

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_20_n33o3c4t_.arc RECID=15 STAMP=1201961707

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_21_n33spson_.arc RECID=16 STAMP=1201966425

deleted backup piece

backup piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp RECID=42 STAMP=1201966428

Deleted 6 objects



RMAN>

How to create stored script using recovery catalog and replace the script if needed ?

 


[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:24:12 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database


RMAN> list script names;


List of Stored Scripts in Recovery Catalog


        No scripts in recovery catalog


RMAN> create script db_plus_arc_bkp

2> {

3> backup database plus archivelog ;

4> }


created script db_plus_arc_bkp


RMAN> list script names;


List of Stored Scripts in Recovery Catalog



    Scripts of Target Database DB1


       Script Name

       Description

       -----------------------------------------------------------------------

       db_plus_arc_bkp


RMAN> print script db_plus_arc_bkp;


printing stored script: db_plus_arc_bkp

{

backup database plus archivelog ;

}


RMAN> replace script db_plus_arc_bkp

2> {

3> backup database plus archivelog ;

4> delete obsolete ;

5> }


replaced script db_plus_arc_bkp


RMAN> print script db_plus_arc_bkp;


printing stored script: db_plus_arc_bkp

{

backup database plus archivelog ;

delete obsolete ;

}


RMAN>

How to manually resync oracle database with catalog database ?

 [oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:11:11 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database


RMAN> resync catalog ;


starting full resync of recovery catalog

full resync complete


RMAN>