Saturday, May 24, 2025

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>

No comments:

Post a Comment

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Oracle 19c to PostgreSQL 15 Migration: Step-by-Step Production Guide (Ora2Pg + DMS)

Production-oriented migration approach for a complex Oracle 19c to PostgreSQL 15 workload , covering assessment, schema and code conversion,...