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>

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>

How to register database in recovery catalog ?

[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:07:56 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> register database ;


database registered in recovery catalog

starting full resync of recovery catalog

full resync complete


RMAN>

How to create recovery catalog ?

 


[oracle@orcl ~]$

[oracle@orcl ~]$ sqlplus "/as sysdba"


SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 24 14:41: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> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 DEMOPDB1                       MOUNTED

SQL> alter pluggable database demopdb1 open read write ;


Pluggable database altered.


SQL> show con_name


CON_NAME

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

CDB$ROOT

SQL>





SQL> alter session set container =demopdb1;


Session altered.




SQL> create tablespace rcat datafile '/u01/app/oracle/oradata/DB2/rcat.dbf' size 15M;


Tablespace created.


SQL>



SQL>

SQL> CREATE USER rcatowner IDENTIFIED BY oracle_4U

TEMPORARY TABLESPACE temp

DEFAULT TABLESPACE rca  2    3  t

QUOTA UNLIMIT  4  ED ON rcat;


User created.




SQL> grant recovery_catalog_owner to rcatowner;


Grant succeeded.


SQL>



[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 14:54:57 2025

Version 19.3.0.0.0


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


RMAN> connect catalog rcatowner/oracle_4U@demopdb1


connected to recovery catalog database


RMAN> create catalog;



recovery catalog created


RMAN>

RMAN>




How to create tablespace in oracle database ?

 

SQL>

SQL>  create tablespace rcat datafile '/u01/app/oracle/oradata/DB2/rcat.dbf' size 15M;


Tablespace created.


SQL>

How to drop tablespace in oracle database ?

 



SQL> DROP TABLESPACE rcat INCLUDING CONTENTS AND DATAFILES;


Tablespace dropped.


SQL>

How backup database using rman keep forever ?

 


RMAN> backup database keep forever ;


Starting backup at 24-MAY-25


using channel ORA_DISK_1

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

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

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

RMAN-03002: failure of backup command at 05/24/2025 14:12:06

RMAN-06522: KEEP FOREVER option is not supported without the recovery catalog


RMAN>




RMAN> backup database keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:04

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:06

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:07

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

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

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

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

RMAN-03002: failure of backup command at 05/24/2025 14:13:08

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes


RMAN>



RMAN> backup database keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:04

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:06

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:07

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

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

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

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

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

RMAN-03002: failure of backup command at 05/24/2025 14:13:08

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes


RMAN>


RMAN>


RMAN> backup database format '/u01/app/oracle/%U' keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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/2n3q8ulb_1_1 tag=TAG20250524T141402 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/2o3q8um4_1_1 tag=TAG20250524T141402 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/2p3q8umj_1_1 tag=TAG20250524T141402 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/2q3q8un3_1_1 tag=TAG20250524T141402 comment=NONE

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

current log archived


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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=20 RECID=15 STAMP=1201961707

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/2r3q8unc_1_1 tag=TAG20250524T141402 comment=NONE

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


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current SPFILE in backup set

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/2s3q8und_1_1 tag=TAG20250524T141402 comment=NONE

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


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

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/2t3q8unf_1_1 tag=TAG20250524T141402 comment=NONE

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

Finished backup at 24-MAY-25


RMAN>

Oracle 26 ai database free

 https://www.oracle.com/in/database/26ai/ Oracle 26 ai release  Oracle AI Database Free Want to get hands-on with Oracle AI Database 26ai—ab...