Saturday, December 24, 2022

RMAN Duplicate Returns Error RMAN-05541: no archived logs found in target database

RMAN Duplicate Returns Error RMAN-05541: no archived logs found in target database (Doc ID 2789940.1)

Source DB: DEVDB
Source Server: oraclelab1.localdomain.com


Case1: RMAN Clone 

Target DB: TESTDB
Target Server: oraclelab3.localdomain.com


Case2: RMAN Restore Recover

Target DB: DEVDB
Target Server: oraclelab3.localdomain.com


High Level Steps:
1. Source DB backup
run {
allocate channel ch1 device type disk;
crosscheck backup;
crosscheck archivelog all;
backup as backupset database format '/u01/backup/Fullback_%T_%U'
plus archivelog format '/u01/backup/Archive_%T_%U';
backup current controlfile format '/u01/backup/Controlback_%T_%U';
release channel ch1;
}

2. Restore target as TESTDB using source backup via RMAN clone(Failed)
duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck;

3. Restore target as TESTDB using source backup with noredo option via RMAN clone(Successful)
duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck noredo;

4. Restore target as DEVDB using source backup via restore & recover (Successful)
restore controlfile from '/u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp';
alter database mount;
catalog start with '/u01/backup/';
restore database;
recover database;
alter database open RESETLOGS;

Logs:

[oracle@oraclelab1 ~]$ ps -ef|grep smon
oracle   14787 14648  0 09:34 pts/2    00:00:00 grep --color=auto smon
oracle   20976     1  0 Dec21 ?        00:00:02 ora_smon_DEVDB
[oracle@oraclelab1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Dec 23 09:46:42 2022
Version 19.17.0.0.0

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

connected to target database: DEVDB (DBID=1016989223)

RMAN> run {
allocate channel ch1 device type disk;
crosscheck backup;
crosscheck archivelog all;
backup as backupset database format '/u01/backup/Fullback_%T_%U'
plus archivelog format '/u01/backup/Archive_%T_%U';
backup current controlfile format '/u01/backup/Controlback_%T_%U';
release channel ch1;
}

using target database control file instead of recovery catalog
allocated channel: ch1
channel ch1: SID=50 device type=DISK

specification does not match any backup in the repository

validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_12_22/o1_mf_1_5_kt7v7s1g_.arc RECID=313 STAMP=1124104017
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_12_22/o1_mf_1_6_kt7v89jt_.arc RECID=314 STAMP=1124104033
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_12_22/o1_mf_1_7_kt93987h_.arc RECID=315 STAMP=1124145026
Crosschecked 3 objects



Starting backup at 23-DEC-22
current log archived
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=313 STAMP=1124104017
input archived log thread=1 sequence=6 RECID=314 STAMP=1124104033
input archived log thread=1 sequence=7 RECID=315 STAMP=1124145026
input archived log thread=1 sequence=8 RECID=316 STAMP=1124185607
channel ch1: starting piece 1 at 23-DEC-22
channel ch1: finished piece 1 at 23-DEC-22
piece handle=/u01/backup/Archive_20221223_5r1g3dg7_187_1_1 tag=TAG20221223T094647 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:03
Finished backup at 23-DEC-22

Starting backup at 23-DEC-22
channel ch1: starting full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kt65xq46_.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kt65xq4d_.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kt65xq4j_.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/DEVDB/datafile/users.dbf
channel ch1: starting piece 1 at 23-DEC-22
channel ch1: finished piece 1 at 23-DEC-22
piece handle=/u01/backup/Fullback_20221223_5s1g3dga_188_1_1 tag=TAG20221223T094650 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:15
Finished backup at 23-DEC-22

Starting backup at 23-DEC-22
current log archived
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=317 STAMP=1124185625
channel ch1: starting piece 1 at 23-DEC-22
channel ch1: finished piece 1 at 23-DEC-22
piece handle=/u01/backup/Archive_20221223_5t1g3dgq_189_1_1 tag=TAG20221223T094706 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-DEC-22

Starting backup at 23-DEC-22
channel ch1: starting full datafile backup set
channel ch1: specifying datafile(s) in backup set
including current control file in backup set
channel ch1: starting piece 1 at 23-DEC-22
channel ch1: finished piece 1 at 23-DEC-22
piece handle=/u01/backup/Controlback_20221223_5u1g3dgr_190_1_1 tag=TAG20221223T094707 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-DEC-22

Starting Control File and SPFILE Autobackup at 23-DEC-22
piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_12_23/o1_mf_s_1124185629_ktbby5gp_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-DEC-22

released channel: ch1

RMAN> exit


Recovery Manager complete.
You have new mail in /var/spool/mail/oracle
[oracle@oraclelab1 ~]$ cd /u01/backup/
[oracle@oraclelab1 backup]$ ll
total 2644292
-rw-r-----. 1 oracle oinstall  257409536 Dec 23 09:46 Archive_20221223_5r1g3dg7_187_1_1
-rw-r-----. 1 oracle oinstall       6656 Dec 23 09:47 Archive_20221223_5t1g3dgq_189_1_1
-rw-r-----. 1 oracle oinstall   10911744 Dec 23 09:47 Controlback_20221223_5u1g3dgr_190_1_1
-rw-r-----. 1 oracle oinstall 2439421952 Dec 23 09:46 Fullback_20221223_5s1g3dga_188_1_1
[oracle@oraclelab1 backup]$ scp * oracle@10.38.4.105:/u01/backup/
oracle@10.38.4.105's password:
Archive_20221223_5r1g3dg7_187_1_1                                                                                                   100%  245MB 153.1MB/s   00:01
Archive_20221223_5t1g3dgq_189_1_1                                                                                                   100% 6656     9.4MB/s   00:00
Controlback_20221223_5u1g3dgr_190_1_1                                                                                               100%   10MB  89.1MB/s   00:00
Fullback_20221223_5s1g3dga_188_1_1                                                                                                  100% 2326MB 145.4MB/s   00:16

[oracle@oraclelab1 backup]$ scp /u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_12_23/o1_mf_s_1124185629_ktbby5gp_.bkp oracle@10.38.4.105:/u01/backup/
oracle@10.38.4.105's password:
o1_mf_s_1124185629_ktbby5gp_.bkp                                                                                                    100%   10MB  72.9MB/s   00:00
[oracle@oraclelab1 backup]$

[root@oraclelab3 ~]# cd /u01/backup/
[root@oraclelab3 backup]# ll
total 2654980
-rw-r-----. 1 oracle oinstall  257409536 Dec 23 09:48 Archive_20221223_5r1g3dg7_187_1_1
-rw-r-----. 1 oracle oinstall       6656 Dec 23 09:48 Archive_20221223_5t1g3dgq_189_1_1
-rw-r-----. 1 oracle oinstall   10911744 Dec 23 09:48 Controlback_20221223_5u1g3dgr_190_1_1
-rw-r-----. 1 oracle oinstall 2439421952 Dec 23 09:48 Fullback_20221223_5s1g3dga_188_1_1
-rw-r-----. 1 oracle oinstall   10944512 Dec 23 09:48 o1_mf_s_1124185629_ktbby5gp_.bkp
[root@oraclelab3 backup]# rm Archive_20221223_5r1g3dg7_187_1_1 Archive_20221223_5t1g3dgq_189_1_1
rm: remove regular file ‘Archive_20221223_5r1g3dg7_187_1_1’? y
rm: remove regular file ‘Archive_20221223_5t1g3dgq_189_1_1’? y
[root@oraclelab3 backup]#
[root@oraclelab3 backup]# ll
total 2403592
-rw-r-----. 1 oracle oinstall   10911744 Dec 23 09:48 Controlback_20221223_5u1g3dgr_190_1_1
-rw-r-----. 1 oracle oinstall 2439421952 Dec 23 09:48 Fullback_20221223_5s1g3dga_188_1_1
-rw-r-----. 1 oracle oinstall   10944512 Dec 23 09:48 o1_mf_s_1124185629_ktbby5gp_.bkp
[root@oraclelab3 backup]#

[oracle@oraclelab3 ~]$ . oraenv
ORACLE_SID = [oracle] ? DEVDB
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0.0/dbhome_1
The Oracle base has been set to /u01/app/oracle
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 24 21:44:44 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB.ora';
ORACLE instance started.

Total System Global Area  268434280 bytes
Fixed Size                  8895336 bytes
Variable Size             201326592 bytes
Database Buffers           50331648 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Dec 24 21:44:59 2022
Version 19.3.0.0.0

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

connected to target database: DEVDB (not mounted)

RMAN>

RMAN> restore controlfile from '/u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp';

Starting restore at 24-DEC-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/DEVDB/controlfile/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/DEVDB/controlfile/control02.ctl
Finished restore at 24-DEC-22

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

RMAN> catalog start with '/u01/backup/';

Starting implicit crosscheck backup at 24-DEC-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 24-DEC-22

Starting implicit crosscheck copy at 24-DEC-22
using channel ORA_DISK_1
Crosschecked 4 objects
Finished implicit crosscheck copy at 24-DEC-22

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /u01/backup/

List of Files Unknown to the Database
=====================================
File Name: /u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp

RMAN> restore database;

Starting restore at 24-DEC-22
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kt65xq4d_.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kt65xq46_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kt65xq4j_.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/DEVDB/datafile/users.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/Fullback_20221223_5s1g3dga_188_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Fullback_20221223_5s1g3dga_188_1_1 tag=TAG20221223T094650
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 24-DEC-22

RMAN> recover database;

Starting recover at 24-DEC-22
using channel ORA_DISK_1

starting media recovery

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/24/2022 21:45:51
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 9 and starting SCN of 15182603 found to restore

RMAN>alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 12/24/2022 21:46:06
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> alter database open NORESETLOGS;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 12/24/2022 21:46:11
ORA-01588: must use RESETLOGS option for database open

RMAN> alter database open RESETLOGS;

Statement processed

RMAN> exit


Recovery Manager complete.
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 24 21:47:36 2022
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> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 ~]$

[oracle@oraclelab3 ~]$ . oraenv
ORACLE_SID = [DEVDB] ? TESTDB
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0.0/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 24 21:47:52 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';
ORACLE instance started.

Total System Global Area  268434280 bytes
Fixed Size                  8895336 bytes
Variable Size             201326592 bytes
Database Buffers           50331648 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 ~]$ rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Dec 24 21:48:20 2022
Version 19.3.0.0.0

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

connected to auxiliary database: TESTDB (not mounted)

RMAN> duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck;

Starting Duplicate Db at 24-DEC-22
searching for database ID
found backup of database ID 1016989223

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DEVDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DEVDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''TESTDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

Starting restore at 24-DEC-22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/TESTDB/controlfile/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/TESTDB/controlfile/control02.ctl
Finished restore at 24-DEC-22

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/24/2022 21:49:45
RMAN-05501: aborting duplication of target database
RMAN-05541: no archived logs found in target database

RMAN>
RMAN> duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck noredo;

Starting Duplicate Db at 24-DEC-22
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/24/2022 21:54:24
RMAN-05501: aborting duplication of target database
RMAN-05500: the auxiliary database must be not mounted when issuing a DUPLICATE command

RMAN> 
[oracle@oraclelab3 ~]$ ps -ef|grep smon
oracle   12247     1  0 21:44 ?        00:00:00 ora_smon_DEVDB
oracle   13074     1  0 21:49 ?        00:00:00 ora_smon_TESTDB
oracle   13422 12128  0 21:54 pts/0    00:00:00 grep --color=auto smon
[oracle@oraclelab3 ~]$
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 24 21:55:01 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';
ORACLE instance started.

Total System Global Area  268434280 bytes
Fixed Size                  8895336 bytes
Variable Size             201326592 bytes
Database Buffers           50331648 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 ~]$ rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Dec 24 21:55:24 2022
Version 19.3.0.0.0

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

connected to auxiliary database: TESTDB (not mounted)

RMAN> duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck noredo;

Starting Duplicate Db at 24-DEC-22
searching for database ID
found backup of database ID 1016989223

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DEVDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/backup/o1_mf_s_1124185629_ktbby5gp_.bkp';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DEVDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''TESTDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

Starting restore at 24-DEC-22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/TESTDB/controlfile/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/TESTDB/controlfile/control02.ctl
Finished restore at 24-DEC-22

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK

contents of Memory Script:
{
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_system_kt65xq4d_.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_kt65xq46_.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_kt65xq4j_.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/TESTDB/datafile/users.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 24-DEC-22
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/TESTDB/datafile/o1_mf_system_kt65xq4d_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_kt65xq46_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_kt65xq4j_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/TESTDB/datafile/users.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Fullback_20221223_5s1g3dga_188_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Fullback_20221223_5s1g3dga_188_1_1 tag=TAG20221223T094650
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 24-DEC-22

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=1124315820 file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_system_ktgb2565_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=1124315820 file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_ktgb2562_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=7 STAMP=1124315820 file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_ktgb256c_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=8 STAMP=1124315820 file name=/u01/app/oracle/oradata/TESTDB/datafile/users.dbf

contents of Memory Script:
{
   recover
   clone database
   noredo
    delete archivelog
   ;
}
executing Memory Script

Starting recover at 24-DEC-22
using channel ORA_AUX_DISK_1

Finished recover at 24-DEC-22
Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TESTDB'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''TESTDB'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area     268434280 bytes

Fixed Size                     8895336 bytes
Variable Size                201326592 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTDB" RESETLOGS NOARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/u01/app/oracle/oradata/TESTDB/onlinelog/o1_mf_1_kt660vd9_.log', '/u01/app/oracle/fast_recovery_area/TESTDB/onlinelog/o1_mf_1_kt660w91_.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/u01/app/oracle/oradata/TESTDB/onlinelog/o1_mf_2_kt660x40_.log', '/u01/app/oracle/fast_recovery_area/TESTDB/onlinelog/o1_mf_2_kt660xxn_.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/u01/app/oracle/oradata/TESTDB/onlinelog/o1_mf_3_kt660z4c_.log', '/u01/app/oracle/fast_recovery_area/TESTDB/onlinelog/o1_mf_3_kt660zz0_.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_system_ktgb2565_.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_temp_kt66119l_.tmp";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_ktgb2562_.dbf",
 "/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_ktgb256c_.dbf",
 "/u01/app/oracle/oradata/TESTDB/datafile/users.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/TESTDB/datafile/o1_mf_temp_kt66119l_.tmp in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_ktgb2562_.dbf RECID=1 STAMP=1124315845
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_ktgb256c_.dbf RECID=2 STAMP=1124315845
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/TESTDB/datafile/users.dbf RECID=3 STAMP=1124315845

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1124315845 file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_sysaux_ktgb2562_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1124315845 file name=/u01/app/oracle/oradata/TESTDB/datafile/o1_mf_undotbs1_ktgb256c_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=3 STAMP=1124315845 file name=/u01/app/oracle/oradata/TESTDB/datafile/users.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Cannot remove created server parameter file
Finished Duplicate Db at 24-DEC-22

RMAN>
RMAN> exit


Recovery Manager complete.
[oracle@oraclelab3 ~]$
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 24 22:00:15 2022
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>

Regards,
Mallik

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...