Friday, August 19, 2022

How to copy password file from ASM to FS

How to copy password file from ASM to FS:


Oracle Doc:
https://docs.oracle.com/database/121/OSTMG/GUID-A0A00173-DA44-43B2-92D4-72FF89ACB2A6.htm
ASMCMD Giving Errors on KFOD ( kfod.bin: No such file or directory ) (Doc ID 2022397.1)

1. Copy ASM password file to FS:


Environmental details:
+ASM1: node1.localdomain.com
+ASM2: node2localdomain.com

. oraenv 
+ASM1/+ASM2

Get the ASM password file location:
srvctl config asm

asmcmd
pwget --asm

Copy ASM password file from ASM to FS:
pwcopy '+DATA/node-clu/PASSWORD/orapwasm' '/tmp/orapwasm'

[oracle@node1 ~]$ . oraenv
ORACLE_SID = [RAC12C1] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@node1 ~]$ asmcmd
ASMCMD> pwget --asm
+DATA/node-clu/PASSWORD/orapwasm
ASMCMD> exit
[oracle@node1 ~]$ srvctl config asm
ASM home: <CRS home>
Password file: +DATA/node-clu/PASSWORD/orapwasm
Backup of Password file: +DATA/node-clu/PASSWORD/orapwasm_backup
ASM listener: LISTENER
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM
[oracle@node1 ~]$ asmcmd
ASMCMD> cd +DATA/node-clu/PASSWORD/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   JUN 02 23:00:00  N    orapwasm => +DATA/ASM/PASSWORD/pwdasm.399.1106349459
ASMCMD> exit
[oracle@node1 ~]$ 

ASMCMD> pwcopy '+DATA/node-clu/PASSWORD/orapwasm' '/tmp/orapwasm'
copying +DATA/node-clu/PASSWORD/orapwasm -> /tmp/orapwasm
ASMCMD>

2. Copy Database password file to FS:


Environmental details:
RAC12C1: node1
RAC12C2: node2

. oarenv
RAC12C1/RAC12C2

Get the Database password file location:
srvctl config database -d RAC12C

asmcmd
pwget --dbuniquename RAC12C

Copy Database password file from ASM to FS:
pwcopy '+DATA/RAC12C/PASSWORD/pwdrac12c' '/tmp/orapwRAC12C'

[oracle@node1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? RAC12C1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@node1 ~]$ asmcmd
/u01/app/oracle/product/12.2.0.1/dbhome_1/bin/kfod: line 22: /home/oracle/%ORACLE_HOME%/bin/kfod.bin: No such file or directory
Use of uninitialized value $clus_mode in concatenation (.) or string at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5605.
Use of uninitialized value $clus_mode in scalar chomp at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5607.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5640.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5690.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5690.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5690.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5769.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5803.
Use of uninitialized value $clus_mode in string eq at /u01/app/oracle/product/12.2.0.1/dbhome_1/lib/asmcmdbase.pm line 5803.
ASMCMD> exit
[oracle@node1 ~]$

Above error can be fixed using Oracle document 2022397.1
ASMCMD Giving Errors on KFOD ( kfod.bin: No such file or directory ) (Doc ID 2022397.1)

[oracle@node1 ~]$ grep OHOME /u01/app/oracle/product/12.2.0.1/dbhome_1/bin/kfod
OHOME=%ORACLE_HOME%
[oracle@node1 ~]$

Solution:
From:
    OHOME=%ORACLE_HOME%
To:
    OHOME=$ORACLE_HOME

[oracle@node1 ~]$ grep OHOME /u01/app/oracle/product/12.2.0.1/dbhome_1/bin/kfod
OHOME=$ORACLE_HOME
[oracle@node1 ~]$

[oracle@node1 ~]$ asmcmd
ASMCMD> pwget --dbuniquename RAC12C
+DATA/RAC12C/PASSWORD/pwdrac12c
ASMCMD> exit
[oracle@node1 ~]$ srvctl config database -d RAC12C
Database unique name: RAC12C
Database name: RAC12C
Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1
Oracle user: oracle
Spfile: +RECO/RAC12C/PARAMETERFILE/spfile.659.1071585343
Password file: +DATA/RAC12C/PASSWORD/pwdrac12c
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: RECO,DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: oinstall
OSOPER group: oinstall
Database instances: RAC12C1,RAC12C2
Configured nodes: node1,node2
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
[oracle@node1 ~]$ asmcmd
ASMCMD> 

ASMCMD> cd +DATA/RAC12C/PASSWORD/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   SEP 01     2021  N    pwdrac12c => +DATA/RAC12C/PASSWORD/pwdrac12c.291.1082076973
PASSWORD  UNPROT  COARSE   SEP 01     2021  Y    pwdrac12c.291.1082076973
PASSWORD  UNPROT  COARSE   MAR 13     2021  Y    pwdrac12c.292.1067048971
ASMCMD> pwd
+DATA/RAC12C/PASSWORD
ASMCMD> pwcopy '+DATA/RAC12C/PASSWORD/pwdrac12c' '/tmp/orapwRAC12C'
copying +DATA/RAC12C/PASSWORD/pwdrac12c -> /tmp/orapwRAC12C
ASMCMD> exit
[oracle@node1 ~]$ ls -l /tmp/orapwRAC12C
-rw-r----- 1 oracle oinstall 6144 Aug 19 21:09 /tmp/orapwRAC12C
[oracle@node1 ~]$ 

Regards,
Mallik

Thursday, August 18, 2022

Filesystem to ASM restore or RMAN clone easy way to clone databases

Filesystem to ASM restore or RMAN clone easy way to clone databases:


Source:
DB: DEVDB
OH: /u01/app/oracle/product/19.0.0.0/dbhome_1
Hostname: oraclelab1.localdomain.com
Storage: FS (Filesystem)

Target:
DB: DEVDB / TESTDB
OH: /u01/app/oracle/product/19.0.0.0/dbhome_1
Hostname: oraclelab2.localdomain.com
Storage: ASM (Automatic Storage Management)

High Level Steps:

1. Prechecks on Source and Target Servers:
2. Take Source database backup and copy them to target:
3. Restore or clone the Target database on target server:

1. Prechecks on Source and Target Servers:

Source:
ps -ef|grep smon

. oraenv
DEVDB
/u01/app/oracle/product/19.0.0.0/dbhome_1
env |grep ORA

Target:
ps -ef|grep smon

2. Take Source database backup and copy them to target:

Source:
rman target /
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
crosscheck backup;
crosscheck archivelog all;
DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 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;
release channel ch2;
}

cd /u01/backup
ls -l

scp * oracle@targetserver:/u01/backup

Target:
cd /u01/backup
ls -l

. oraenv
+ASM
/u01/app/19.0.0.0/grid

asmcmd -p lsdg

3. Restore or clone the Target database on target server:

Option1:
Using Restore and Recover method:

. oraenv
DEVDB
/u01/app/oracle/product/19.0.0.0/dbhome_1
env |grep ORA

sqlplus / as sysdba
startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB.ora';

rman target /
restore spfile from '/u01/backup/o1_mf_s_1112662593_khhyq9gx_.bkp'; (Optional)
restore controlfile from '/u01/backup/Controlback_20220818_1515ech5_37_1_1';
alter database mount;
catalog start with '/u01/backup/';
run {
restore database;
recover database;
}
alter database open resetlogs;

sqlplus / as sysdba
select name, open_mode from v$database;
select name from v$datafile;
select name from v$controlfile;
select member from v$logfile;

cd /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
cat initDEVDB.ora
*.db_name=DEVDB
*.db_unique_name=DEVDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/DEVDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/DEVDB/controlfile/control01.ctl','+RECO/DEVDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'

Option2:
RMAN Clone or RMAN duplicate database method:

. oraenv
TESTDB
/u01/app/oracle/product/19.0.0.0/dbhome_1
env |grep ORA

sqlplus / as sysdba
startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';

rman auxiliary /
duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck;

sqlplus / as sysdba
select name, open_mode from v$database;
select name from v$datafile;
select name from v$controlfile;
select member from v$logfile;

cd /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
cat initTESTDB.ora
*.db_name=TESTDB
*.db_unique_name=TESTDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA/TESTDB'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/TESTDB/controlfile/control01.ctl','+RECO/TESTDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'

Logs:

[oracle@oraclelab1 ~]$ ps -ef|grep smon
oracle    4467     1  0 Aug09 ?        00:00:05 ora_smon_DEVDB
oracle   14332 14251  0 00:50 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclelab1 ~]$ . oraenv
ORACLE_SID = [oracle] ? DEVDB
The Oracle base has been set to /u01/app/oracle
[oracle@oraclelab1 ~]$
[oracle@oraclelab1 ~]$ env |grep ORA
ORACLE_SID=DEVDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclelab1 ~]$

[oracle@oraclelab2 ~]$ ps -ef|grep smon
oracle     820     1  0 Aug10 ?        00:00:04 ora_smon_TESTCDB
oracle   13480     1  0 00:53 ?        00:00:00 ora_smon_DB
oracle   13519 13362  0 00:53 pts/0    00:00:00 grep --color=auto smon
oracle   28052     1  0 Aug02 ?        00:00:14 asm_smon_+ASM
[oracle@oraclelab2 ~]$ 

Backup:
rman target /
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
crosscheck backup;
crosscheck archivelog all;
DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 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;
release channel ch2;
}

[oracle@oraclelab1 backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 00:55:57 2022
Version 19.14.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;
allocate channel ch2 device type disk;
2> 3> 4> crosscheck backup;
crosscheck archivelog all;
5> 6> DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 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;
release channel ch2;
}7> 8> 9> 10> 11> 12>

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

allocated channel: ch2
channel ch2: SID=266 device type=DISK

crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Archive_20220809_0114nkpn_1_1_1 RECID=1 STAMP=1112265527
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Fullback_20220809_0314nkpo_3_1_1 RECID=2 STAMP=1112265528
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Fullback_20220809_0214nkpo_2_1_1 RECID=3 STAMP=1112265528
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Archive_20220809_0414nkq7_4_1_1 RECID=4 STAMP=1112265543
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0514nkq9_5_1_1 RECID=5 STAMP=1112265546
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265547_kh3tzmcg_.bkp RECID=6 STAMP=1112265547
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Archive_20220809_0814nkr3_8_1_1 RECID=7 STAMP=1112265571
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Archive_20220809_0714nkr3_7_1_1 RECID=8 STAMP=1112265571
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Fullback_20220809_0a14nkr4_10_1_1 RECID=9 STAMP=1112265572
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Fullback_20220809_0914nkr4_9_1_1 RECID=10 STAMP=1112265572
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Archive_20220809_0b14nkrj_11_1_1 RECID=11 STAMP=1112265587
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265591_kh3v0z9l_.bkp RECID=13 STAMP=1112265591
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0c14nkrl_12_1_1 RECID=12 STAMP=1112265590
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265727_kh3v57jc_.bkp RECID=15 STAMP=1112265727
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0e14nkvt_14_1_1 RECID=14 STAMP=1112265726
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265744_kh3v5s0q_.bkp RECID=17 STAMP=1112265745
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0g14nl0e_16_1_1 RECID=16 STAMP=1112265743
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265762_kh3v6bdm_.bkp RECID=19 STAMP=1112265762
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0i14nl10_18_1_1 RECID=18 STAMP=1112265761
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_09/o1_mf_s_1112265780_kh3v6wom_.bkp RECID=21 STAMP=1112265780
Crosschecked 11 objects

crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/Controlback_20220809_0k14nl1i_20_1_1 RECID=20 STAMP=1112265779
Crosschecked 10 objects


validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_09/o1_mf_1_9_kh3tyxp3_.arc RECID=1 STAMP=1112265527
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_09/o1_mf_1_10_kh3tzhrn_.arc RECID=2 STAMP=1112265543
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_09/o1_mf_1_11_kh3v0c1y_.arc RECID=3 STAMP=1112265571
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_09/o1_mf_1_12_kh3v0voq_.arc RECID=4 STAMP=1112265587
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_09/o1_mf_1_13_kh531h0f_.arc RECID=5 STAMP=1112306567
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_10/o1_mf_1_14_kh6owtq9_.arc RECID=6 STAMP=1112358643
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_11/o1_mf_1_15_kh9o2l93_.arc RECID=7 STAMP=1112456107
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_12/o1_mf_1_16_khf00w97_.arc RECID=8 STAMP=1112565621
Crosschecked 4 objects

validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/DEVDB/archivelog/2022_08_13/o1_mf_1_17_khgrn9mq_.arc RECID=9 STAMP=1112623586
Crosschecked 5 objects




Starting backup at 14-AUG-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=14 RECID=6 STAMP=1112358643
input archived log thread=1 sequence=15 RECID=7 STAMP=1112456107
input archived log thread=1 sequence=16 RECID=8 STAMP=1112565621
input archived log thread=1 sequence=17 RECID=9 STAMP=1112623586
channel ch1: starting piece 1 at 14-AUG-22
channel ch2: starting archived log backup set
channel ch2: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=1 STAMP=1112265527
input archived log thread=1 sequence=10 RECID=2 STAMP=1112265543
input archived log thread=1 sequence=11 RECID=3 STAMP=1112265571
input archived log thread=1 sequence=12 RECID=4 STAMP=1112265587
input archived log thread=1 sequence=13 RECID=5 STAMP=1112306567
channel ch2: starting piece 1 at 14-AUG-22
channel ch1: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Archive_20220814_0m153oh6_22_1_1 tag=TAG20220814T005606 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:07
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=18 RECID=10 STAMP=1112662566
channel ch1: starting piece 1 at 14-AUG-22
channel ch2: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Archive_20220814_0n153oh6_23_1_1 tag=TAG20220814T005606 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:07
channel ch1: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Archive_20220814_0o153ohd_24_1_1 tag=TAG20220814T005606 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-AUG-22

Starting backup at 14-AUG-22
channel ch1: starting incremental level 0 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_kh3nrlj4_.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf
channel ch1: starting piece 1 at 14-AUG-22
channel ch2: starting incremental level 0 datafile backup set
channel ch2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf
channel ch2: starting piece 1 at 14-AUG-22
channel ch1: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Fullback_20220814_0p153ohe_25_1_1 tag=TAG20220814T005614 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:15
channel ch2: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Fullback_20220814_0q153ohe_26_1_1 tag=TAG20220814T005614 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:15
Finished backup at 14-AUG-22

Starting backup at 14-AUG-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=19 RECID=11 STAMP=1112662589
channel ch1: starting piece 1 at 14-AUG-22
channel ch1: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Archive_20220814_0r153ohu_27_1_1 tag=TAG20220814T005629 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-AUG-22

Starting backup at 14-AUG-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 14-AUG-22
channel ch1: finished piece 1 at 14-AUG-22
piece handle=/u01/backup/Controlback_20220814_0s153ohv_28_1_1 tag=TAG20220814T005631 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-AUG-22

Starting Control File and SPFILE Autobackup at 14-AUG-22
piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_14/o1_mf_s_1112662593_khhyq9gx_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 14-AUG-22

released channel: ch1

released channel: ch2

RMAN> exit


Recovery Manager complete.
[oracle@oraclelab1 backup]$
[oracle@oraclelab1 backup]$ ll
total 2897660
-rw-r-----. 1 oracle oinstall 722199552 Aug 14 00:56 Archive_20220814_0m153oh6_22_1_1
-rw-r-----. 1 oracle oinstall 326240768 Aug 14 00:56 Archive_20220814_0n153oh6_23_1_1
-rw-r-----. 1 oracle oinstall 113453056 Aug 14 00:56 Archive_20220814_0o153ohd_24_1_1
-rw-r-----. 1 oracle oinstall      7168 Aug 14 00:56 Archive_20220814_0r153ohu_27_1_1
-rw-r-----. 1 oracle oinstall  10682368 Aug 14 00:56 Controlback_20220814_0s153ohv_28_1_1
-rw-r-----. 1 oracle oinstall 845447168 Aug 14 00:56 Fullback_20220814_0p153ohe_25_1_1
-rw-r-----. 1 oracle oinstall 949166080 Aug 14 00:56 Fullback_20220814_0q153ohe_26_1_1
[oracle@oraclelab1 backup]$ scp * pwd
pwd: No such file or directory
[oracle@oraclelab1 backup]$ pwd
/u01/backup
[oracle@oraclelab1 backup]$ scp * oracle@10.38.4.179:/u01/backup/
The authenticity of host '10.38.4.179 (10.38.4.179)' can't be established.
ECDSA key fingerprint is SHA256:4GqjlDbP33EKEI9AUSxXgPUPnaJwbAUY7I5Xr1lIVsU.
ECDSA key fingerprint is MD5:fc:f8:eb:34:c8:83:fd:5b:41:0b:5e:dc:d7:1a:90:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.38.4.179' (ECDSA) to the list of known hosts.
oracle@10.38.4.179's password:
Archive_20220814_0m153oh6_22_1_1                                                                                                                       100%  689MB 180.2MB/s   00:03
Archive_20220814_0n153oh6_23_1_1                                                                                                                       100%  311MB 187.2MB/s   00:01
Archive_20220814_0o153ohd_24_1_1                                                                                                                       100%  108MB 160.1MB/s   00:00
Archive_20220814_0r153ohu_27_1_1                                                                                                                       100% 7168    58.4KB/s   00:00
Controlback_20220814_0s153ohv_28_1_1                                                                                                                   100%   10MB 105.1MB/s   00:00
Fullback_20220814_0p153ohe_25_1_1                                                                                                                      100%  806MB 162.2MB/s   00:04
Fullback_20220814_0q153ohe_26_1_1                                                                                                                      100%  905MB 181.0MB/s   00:05
[oracle@oraclelab1 backup]$ scp /u01/app/oracle/fast_recovery_area/DEVDB/autobackup/2022_08_14/o1_mf_s_1112662593_khhyq9gx_.bkp oracle@10.38.4.179:/u01/backup/
oracle@10.38.4.179's password:
o1_mf_s_1112662593_khhyq9gx_.bkp                                                                                                                       100%   10MB  70.5MB/s   00:00
[oracle@oraclelab1 backup]$

[oracle@oraclelab2 ~]$ cd /u01/backup
[oracle@oraclelab2 backup]$ ll
total 2908124
-rw-r-----. 1 oracle oinstall 722199552 Aug 14 00:57 Archive_20220814_0m153oh6_22_1_1
-rw-r-----. 1 oracle oinstall 326240768 Aug 14 00:57 Archive_20220814_0n153oh6_23_1_1
-rw-r-----. 1 oracle oinstall 113453056 Aug 14 00:57 Archive_20220814_0o153ohd_24_1_1
-rw-r-----. 1 oracle oinstall      7168 Aug 14 00:57 Archive_20220814_0r153ohu_27_1_1
-rw-r-----. 1 oracle oinstall  10682368 Aug 14 00:57 Controlback_20220814_0s153ohv_28_1_1
-rw-r-----. 1 oracle oinstall 845447168 Aug 14 00:57 Fullback_20220814_0p153ohe_25_1_1
-rw-r-----. 1 oracle oinstall 949166080 Aug 14 00:58 Fullback_20220814_0q153ohe_26_1_1
-rw-r-----. 1 oracle oinstall  10715136 Aug 14 00:58 o1_mf_s_1112662593_khhyq9gx_.bkp
[oracle@oraclelab2 backup]$


[oracle@oraclelab2 ~]$ . oraenv
ORACLE_SID = [TESTCDB] ? +ASM
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab2 ~]$ asmcmd -p
ASMCMD [+] >
ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     20476    13780                0           13780              0             N  DATA/
MOUNTED  NORMAL  N         512             512   4096  1048576      3069     2910             1023             943              0             N  DGROUPA/
MOUNTED  EXTERN  N         512             512   4096  4194304      3068     2968                0            2968              0             N  OCR/
MOUNTED  EXTERN  N         512             512   4096  4194304     10236     8320                0            8320              0             N  RECO/
ASMCMD [+] >

Restore and Recover schenario:

sqlplus / as sysdba
startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB.ora';

rman target /
restore spfile from '/u01/backup/o1_mf_s_1112662593_khhyq9gx_.bkp';
restore controlfile from '/u01/backup/Controlback_20220814_0s153ohv_28_1_1';
alter database mount;
catalog start with '/u01/backup/';
run {
restore database;
recover database;
}
alter database open resetlogs;

sqlplus / as sysdba
select name, open_mode from v$database;

[oracle@oraclenode1 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclenode1 dbs]$ cat initDEVDB.ora
*.db_name=DEVDB
*.db_unique_name=DEVDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/DEVDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/DEVDB/controlfile/control01.ctl','+RECO/DEVDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
[oracle@oraclenode1 dbs]$


[oracle@oraclelab2 dbs]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclelab2 dbs]$ cat initDEVDB.ora
*.db_name=DEVDB
*.db_unique_name=DEVDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/DEVDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/DEVDB/controlfile/control01.ctl','+RECO/DEVDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
[oracle@oraclelab2 dbs]$ . oraenv
ORACLE_SID = [TESTCDB] ? DEVDB
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@oraclelab2 dbs]$
[oracle@oraclelab2 dbs]$ env |grep ORA
ORACLE_SID=DEVDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclelab2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 01:05:29 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, 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';
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
SQL> exit
Disconnected
[oracle@oraclelab2 dbs]$ mkdir -p /u01/app/oracle/admin/DEVDB/adump
[oracle@oraclelab2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 01:06:12 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, 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  264239920 bytes
Fixed Size                  8895280 bytes
Variable Size             213909504 bytes
Database Buffers           33554432 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0
[oracle@oraclelab2 dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 01:06:31 2022
Version 19.14.0.0.0

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

connected to target database: DEVDB (not mounted)

RMAN> restore controlfile from '/u01/backup/Controlback_20220814_0s153ohv_28_1_1';

Starting restore at 14-AUG-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=183 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/DEVDB/controlfile/control01.ctl
output file name=+RECO/DEVDB/controlfile/control02.ctl
Finished restore at 14-AUG-22

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

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

Starting implicit crosscheck backup at 14-AUG-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=187 device type=DISK
Crosschecked 27 objects
Finished implicit crosscheck backup at 14-AUG-22

Starting implicit crosscheck copy at 14-AUG-22
using channel ORA_DISK_1
Finished implicit crosscheck copy at 14-AUG-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/Controlback_20220814_0s153ohv_28_1_1
File Name: /u01/backup/o1_mf_s_1112662593_khhyq9gx_.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/Controlback_20220814_0s153ohv_28_1_1
File Name: /u01/backup/o1_mf_s_1112662593_khhyq9gx_.bkp

RMAN> restore database;

Starting restore at 14-AUG-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_kh3nqhcn_.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/Fullback_20220814_0q153ohe_26_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Fullback_20220814_0q153ohe_26_1_1 tag=TAG20220814T005614
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
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 00003 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/Fullback_20220814_0p153ohe_25_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Fullback_20220814_0p153ohe_25_1_1 tag=TAG20220814T005614
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 14-AUG-22

RMAN> recover database;

Starting recover at 14-AUG-22
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece /u01/backup/Archive_20220814_0r153ohu_27_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Archive_20220814_0r153ohu_27_1_1 tag=TAG20220814T005629
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=+RECO/DEVDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.292.1112663281 thread=1 sequence=19
channel default: deleting archived log(s)
archived log file name=+RECO/DEVDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.292.1112663281 RECID=12 STAMP=1112663281
unable to find archived log
archived log thread=1 sequence=20
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/14/2022 01:08:03
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 20 and starting SCN of 2722305

RMAN> alter database open resetlogs;

Statement processed

RMAN> exit

Recovery Manager complete.
[oracle@oraclelab2 dbs]$


Errors1:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/alert_DEVDB.log
2022-08-14T01:07:27.403519+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_mz00_16155.trc:
ORA-01110: data file 1: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:07:27.572247+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_mz00_16155.trc:
ORA-01110: data file 3: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:07:27.670230+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_mz00_16155.trc:
ORA-01110: data file 4: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:07:27.770400+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_mz00_16155.trc:
ORA-01110: data file 7: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Checker run found 5 new persistent data failures
2022-08-14T01:07:39.491045+05:30
Full restore complete of datafile 7 +DATA/DEVDB/DATAFILE/users.283.1112663259.  Elapsed time: 0:00:00
  checkpoint is 2722290
  last deallocation scn is 2441149
2022-08-14T01:07:42.121448+05:30
Full restore complete of datafile 1 +DATA/DEVDB/DATAFILE/system.282.1112663259.  Elapsed time: 0:00:03
  checkpoint is 2722290
  last deallocation scn is 2433499
  Undo Optimization current scn is 2721488
2022-08-14T01:07:43.638061+05:30
Full restore complete of datafile 4 +DATA/DEVDB/DATAFILE/undotbs1.285.1112663263.  Elapsed time: 0:00:01
  checkpoint is 2722288
  last deallocation scn is 2720952
  Undo Optimization current scn is 2721488
2022-08-14T01:07:46.170576+05:30
Full restore complete of datafile 3 +DATA/DEVDB/DATAFILE/sysaux.284.1112663263.  Elapsed time: 0:00:04
  checkpoint is 2722288
  last deallocation scn is 2714914
2022-08-14T01:08:00.686801+05:30
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
 1 , 3 , 4 , 7
Completed: alter database recover datafile list
 1 , 3 , 4 , 7
alter database recover
 if needed start until cancel using backup controlfile
2022-08-14T01:08:00.712009+05:30
Media Recovery Start
 Started logmerger process
2022-08-14T01:08:00.884979+05:30
Parallel Media Recovery started with 2 slaves
ORA-279 signalled during: alter database recover
 if needed start until cancel using backup controlfile
...
2022-08-14T01:08:02.465885+05:30
alter database recover logfile '+RECO/DEVDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.292.1112663281'
2022-08-14T01:08:02.465992+05:30
Media Recovery Log +RECO/DEVDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.292.1112663281
ORA-279 signalled during: alter database recover logfile '+RECO/DEVDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.292.1112663281'...
alter database recover cancel
2022-08-14T01:08:03.004121+05:30
Media Recovery Canceled


Errors2:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/alert_DEVDB.log
2022-08-14T01:08:12.720788+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_ora_16122.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:08:12.721023+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_ora_16122.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Deleted Oracle managed file /u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log
Deleted Oracle managed file /u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log
2022-08-14T01:08:16.999649+05:30
.... (PID:16122): Clearing online redo logfile 1 complete
.... (PID:16122): Clearing online redo logfile 2 complete
.... (PID:16122): Clearing online redo logfile 3 complete
Resetting resetlogs activation ID 1016972583 (0x3c9dc527)
Online log +DATA/DEVDB/ONLINELOG/group_1.286.1112663293: Thread 1 Group 1 was previously cleared
Online log +RECO/DEVDB/ONLINELOG/group_1.291.1112663293: Thread 1 Group 1 was previously cleared
Online log +DATA/DEVDB/ONLINELOG/group_2.288.1112663293: Thread 1 Group 2 was previously cleared
Online log +RECO/DEVDB/ONLINELOG/group_2.290.1112663293: Thread 1 Group 2 was previously cleared
Online log +DATA/DEVDB/ONLINELOG/group_3.287.1112663293: Thread 1 Group 3 was previously cleared
Online log +RECO/DEVDB/ONLINELOG/group_3.292.1112663293: Thread 1 Group 3 was previously cleared
2022-08-14T01:08:17.064416+05:30
Setting recovery target incarnation to 3
2022-08-14T01:08:17.125148+05:30

Errors3:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/alert_DEVDB.log
2022-08-14T01:08:17.594349+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_dbw0_15986.trc:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:08:17.595216+05:30
Errors in file /u01/app/oracle/diag/rdbms/devdb/DEVDB/trace/DEVDB_dbw0_15986.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp'
2022-08-14T01:08:17.595336+05:30
File 201 not verified due to error ORA-01157
2022-08-14T01:08:17.599961+05:30
Dictionary check complete
Re-creating tempfile /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp as +DATA/DEVDB/TEMPFILE/temp.289.1112663297
Database Characterset is AL32UTF8

[oracle@oraclelab2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 01:08:29 2022
Version 19.14.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
DEVDB     READ WRITE

SQL>
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/DEVDB/DATAFILE/system.282.1112663259
+DATA/DEVDB/DATAFILE/sysaux.284.1112663263
+DATA/DEVDB/DATAFILE/undotbs1.285.1112663263
+DATA/DEVDB/DATAFILE/users.283.1112663259

SQL>
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA/DEVDB/controlfile/control01.ctl
+RECO/DEVDB/controlfile/control02.ctl

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/DEVDB/ONLINELOG/group_3.287.1112663293
+RECO/DEVDB/ONLINELOG/group_3.292.1112663293
+DATA/DEVDB/ONLINELOG/group_2.288.1112663293
+RECO/DEVDB/ONLINELOG/group_2.290.1112663293
+DATA/DEVDB/ONLINELOG/group_1.286.1112663293
+RECO/DEVDB/ONLINELOG/group_1.291.1112663293

6 rows selected.

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL>


RMAN Clone schenario:

sqlplus / as sysdba
startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';

rman auxiliary /
duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck;

sqlplus / as sysdba
select name, open_mode from v$database;


[oracle@oraclenode1 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclenode1 dbs]$ cat initTESTDB.ora
*.db_name=TESTDB
*.db_unique_name=TESTDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/TESTDB/controlfile/control01.ctl','+RECO/TESTDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
[oracle@oraclenode1 dbs]$

[oracle@oraclelab2 dbs]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclelab2 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclelab2 dbs]$ cat initTESTDB.ora
*.db_name=TESTDB
*.db_unique_name=TESTDB
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_create_online_log_dest_2='+RECO'
*.db_file_name_convert='/u01/app/oracle/oradata/DEVDB/datafile','+DATA'
*.log_file_name_convert='/u01/app/oracle/oradata/DEVDB/onlinelog','+DATA','/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog','+RECO'
*.control_files='+DATA/TESTDB/controlfile/control01.ctl','+RECO/TESTDB/controlfile/control02.ctl'
*.db_recovery_file_dest_size=8931M
*.db_recovery_file_dest='+RECO'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
[oracle@oraclelab2 dbs]$
[oracle@oraclelab2 dbs]$ mkdir -p /u01/app/oracle/admin/TESTDB/adump
[oracle@oraclelab2 dbs]$
[oracle@oraclelab2 dbs]$ . 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@oraclelab2 dbs]$
[oracle@oraclelab2 dbs]$ env |grep ORA
ORACLE_SID=TESTDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclelab2 dbs]$
[oracle@oraclelab2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 01:18:19 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, 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  264239920 bytes
Fixed Size                  8895280 bytes
Variable Size             213909504 bytes
Database Buffers           33554432 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0
[oracle@oraclelab2 dbs]$ rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 01:18:48 2022
Version 19.14.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 14-AUG-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     264239920 bytes

Fixed Size                     8895280 bytes
Variable Size                213909504 bytes
Database Buffers              33554432 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_1112662593_khhyq9gx_.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     264239920 bytes

Fixed Size                     8895280 bytes
Variable Size                213909504 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7880704 bytes

Starting restore at 14-AUG-22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=+DATA/TESTDB/controlfile/control01.ctl
output file name=+RECO/TESTDB/controlfile/control02.ctl
Finished restore at 14-AUG-22

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_1_kh3ntkp7_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_1_kh3ntm6f_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_2_kh3ntkq3_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_2_kh3ntmn8_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp conflicts with a file used by the target database

contents of Memory Script:
{
   set until scn  2722305;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 14-AUG-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/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Fullback_20220814_0q153ohe_26_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Fullback_20220814_0q153ohe_26_1_1 tag=TAG20220814T005614
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
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 00003 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Fullback_20220814_0p153ohe_25_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Fullback_20220814_0p153ohe_25_1_1 tag=TAG20220814T005614
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 14-AUG-22

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

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1112664015 file name=+DATA/TESTDB/DATAFILE/system.291.1112664009
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1112664015 file name=+DATA/TESTDB/DATAFILE/sysaux.293.1112664013
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1112664015 file name=+DATA/TESTDB/DATAFILE/undotbs1.294.1112664013
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1112664015 file name=+DATA/TESTDB/DATAFILE/users.292.1112664009

contents of Memory Script:
{
   set until scn  2722305;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 14-AUG-22
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Archive_20220814_0r153ohu_27_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Archive_20220814_0r153ohu_27_1_1 tag=TAG20220814T005629
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=+RECO/TESTDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.285.1112664017 thread=1 sequence=19
channel clone_default: deleting archived log(s)
archived log file name=+RECO/TESTDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.285.1112664017 RECID=1 STAMP=1112664016
media recovery complete, elapsed time: 00:00:01
Finished recover at 14-AUG-22
Oracle instance started

Total System Global Area     264239920 bytes

Fixed Size                     8895280 bytes
Variable Size                213909504 bytes
Database Buffers              33554432 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     264239920 bytes

Fixed Size                     8895280 bytes
Variable Size                213909504 bytes
Database Buffers              33554432 bytes
Redo Buffers                   7880704 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_1_kh3ntkp7_.log', '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_1_kh3ntm6f_.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_2_kh3ntkq3_.log', '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_2_kh3ntmn8_.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log', '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log' ) SIZE 200 M  REUSE
 DATAFILE
  '+DATA/TESTDB/DATAFILE/system.291.1112664009'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/TESTDB/DATAFILE/sysaux.293.1112664013",
 "+DATA/TESTDB/DATAFILE/undotbs1.294.1112664013",
 "+DATA/TESTDB/DATAFILE/users.292.1112664009";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/DEVDB/datafile/o1_mf_temp_kh3nttq6_.tmp in control file

cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/sysaux.293.1112664013 RECID=1 STAMP=1112664043
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/undotbs1.294.1112664013 RECID=2 STAMP=1112664043
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/users.292.1112664009 RECID=3 STAMP=1112664043

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1112664043 file name=+DATA/TESTDB/DATAFILE/sysaux.293.1112664013
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1112664043 file name=+DATA/TESTDB/DATAFILE/undotbs1.294.1112664013
datafile 7 switched to datafile copy
input datafile copy RECID=3 STAMP=1112664043 file name=+DATA/TESTDB/DATAFILE/users.292.1112664009

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

database opened
Cannot remove created server parameter file
Finished Duplicate Db at 14-AUG-22

RMAN> exit


Recovery Manager complete.
[oracle@oraclelab2 dbs]$


Errors1:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/alert_TESTDB.log
Completed: alter database mount
2022-08-14T01:20:09.095548+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_mz00_17728.trc:
ORA-01110: data file 1: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_kh3nqhcn_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:20:09.300456+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_mz00_17728.trc:
ORA-01110: data file 3: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_sysaux_kh3nrlj4_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:20:09.426619+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_mz00_17728.trc:
ORA-01110: data file 4: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_undotbs1_kh3nscnc_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:20:09.540599+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_mz00_17728.trc:
ORA-01110: data file 7: '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_users_kh3nsdqj_.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2022-08-14T01:20:09.575694+05:30
Full restore complete of datafile 7 +DATA/TESTDB/DATAFILE/users.292.1112664009.  Elapsed time: 0:00:00
  checkpoint is 2722290
  last deallocation scn is 2441149
Checker run found 5 new persistent data failures
2022-08-14T01:20:12.131355+05:30
Full restore complete of datafile 1 +DATA/TESTDB/DATAFILE/system.291.1112664009.  Elapsed time: 0:00:02
  checkpoint is 2722290
  last deallocation scn is 2433499
  Undo Optimization current scn is 2721488
2022-08-14T01:20:13.501864+05:30
Full restore complete of datafile 4 +DATA/TESTDB/DATAFILE/undotbs1.294.1112664013.  Elapsed time: 0:00:01
  checkpoint is 2722288
  last deallocation scn is 2720952
  Undo Optimization current scn is 2721488
2022-08-14T01:20:15.538422+05:30
Full restore complete of datafile 3 +DATA/TESTDB/DATAFILE/sysaux.293.1112664013.  Elapsed time: 0:00:03
  checkpoint is 2722288
  last deallocation scn is 2714914
2022-08-14T01:20:15.708959+05:30
Switch of datafile 1 complete to datafile copy
  checkpoint is 2722290
Switch of datafile 3 complete to datafile copy
  checkpoint is 2722288
Switch of datafile 4 complete to datafile copy
  checkpoint is 2722288
Switch of datafile 7 complete to datafile copy
  checkpoint is 2722290
setnotrustfnames set to : 0
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
 1 , 3 , 4 , 7
Completed: alter database recover datafile list
 1 , 3 , 4 , 7
alter database recover
 if needed start until change 2722305 using backup controlfile
Media Recovery Start
 Started logmerger process
2022-08-14T01:20:16.217704+05:30
Parallel Media Recovery started with 2 slaves
ORA-279 signalled during: alter database recover
 if needed start until change 2722305 using backup controlfile
...
2022-08-14T01:20:17.728921+05:30
alter database recover logfile '+RECO/TESTDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.285.1112664017'
2022-08-14T01:20:17.729009+05:30
Media Recovery Log +RECO/TESTDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.285.1112664017
2022-08-14T01:20:17.866952+05:30
Incomplete Recovery applied until change 2722305 time 08/14/2022 00:56:29
2022-08-14T01:20:17.869551+05:30
Media Recovery Complete (TESTDB)
Completed: alter database recover logfile '+RECO/TESTDB/ARCHIVELOG/2022_08_14/thread_1_seq_19.285.1112664017'
2022-08-14T01:20:18.126958+05:30
zeroing database id of data file (1): +DATA/TESTDB/DATAFILE/system.291.1112664009
zeroing database id of data file (3): +DATA/TESTDB/DATAFILE/sysaux.293.1112664013
zeroing database id of data file (4): +DATA/TESTDB/DATAFILE/undotbs1.294.1112664013
zeroing database id of data file (7): +DATA/TESTDB/DATAFILE/users.292.1112664009
2022-08-14T01:20:19.214648+05:30

Errors2:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/alert_TESTDB.log
2022-08-14T01:20:44.029639+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_ora_18024.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Deleted Oracle managed file /u01/app/oracle/oradata/DEVDB/onlinelog/o1_mf_3_kh3ntkrc_.log
Deleted Oracle managed file /u01/app/oracle/fast_recovery_area/DEVDB/onlinelog/o1_mf_3_kh3ntn3n_.log
2022-08-14T01:20:47.848006+05:30
.... (PID:18024): Clearing online redo logfile 1 complete
.... (PID:18024): Clearing online redo logfile 2 complete
.... (PID:18024): Clearing online redo logfile 3 complete
Online log +DATA/TESTDB/ONLINELOG/group_1.295.1112664045: Thread 1 Group 1 was previously cleared
Online log +RECO/TESTDB/ONLINELOG/group_1.285.1112664045: Thread 1 Group 1 was previously cleared
Online log +DATA/TESTDB/ONLINELOG/group_2.296.1112664045: Thread 1 Group 2 was previously cleared
Online log +RECO/TESTDB/ONLINELOG/group_2.284.1112664045: Thread 1 Group 2 was previously cleared
Online log +DATA/TESTDB/ONLINELOG/group_3.297.1112664045: Thread 1 Group 3 was previously cleared
Online log +RECO/TESTDB/ONLINELOG/group_3.283.1112664045: Thread 1 Group 3 was previously cleared
2022-08-14T01:20:47.898639+05:30
Setting recovery target incarnation to 2
2022-08-14T01:20:47.933650+05:30
Smart fusion block transfer is disabled:

Errors3:
[oracle@oraclelab2 trace]$ tail -f /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/alert_TESTDB.log
2022-08-14T01:20:48.454928+05:30
Errors in file /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_dbw0_17945.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATA'
2022-08-14T01:20:48.454989+05:30
File 201 not verified due to error ORA-01157
2022-08-14T01:20:48.460062+05:30
Dictionary check complete
Re-creating tempfile +DATA as +DATA/TESTDB/TEMPFILE/temp.298.1112664049
Database Characterset is AL32UTF8

[oracle@oraclelab2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 01:28:43 2022
Version 19.14.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TESTDB    READ WRITE

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/TESTDB/DATAFILE/system.291.1112664009
+DATA/TESTDB/DATAFILE/sysaux.293.1112664013
+DATA/TESTDB/DATAFILE/undotbs1.294.1112664013
+DATA/TESTDB/DATAFILE/users.292.1112664009

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA/TESTDB/controlfile/control01.ctl
+RECO/TESTDB/controlfile/control02.ctl

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/TESTDB/ONLINELOG/group_3.297.1112664045
+RECO/TESTDB/ONLINELOG/group_3.283.1112664045
+DATA/TESTDB/ONLINELOG/group_2.296.1112664045
+RECO/TESTDB/ONLINELOG/group_2.284.1112664045
+DATA/TESTDB/ONLINELOG/group_1.295.1112664045
+RECO/TESTDB/ONLINELOG/group_1.285.1112664045

6 rows selected.

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.0.0
                                                 .0/dbhome_1/dbs/spfileTESTDB.o
                                                 ra
SQL>

Regards,
Mallik

DR database or Standby database build is very easy

DR database or Standby database build is very easy:


Primary:
DB: ORCL
OH: /u01/app/oracle/product/19.0.0.0/dbhome_1
Hostname: oracledb.localdomain.com

Standby:
DB: ORCLSB
OH: /u01/app/oracle/product/19.0.0.0/dbhome_1
Hostname: oraclesb.localdomain.com

High Level Steps:

1. Prechecks on primary and Standby Servers:
2. Check listener.ora and tnsnames.ora on primary and Standby Servers:
3. Verify tnsping on primary and Standby Servers:
4. Copy Primary password file to standby:
5. Create standby init/pfile and start the standby instance in nomount mode:
6. Verify password connectivity for both Primary and standby:
7. Set the standby parameters at Primary and standby redologs:
8. Take Primary database backup:
9. Build Standby database:
10. Enable log shipping:
11. Verify the Primary and Standby sync status:

1. Prechecks on primary and Standby Servers:

Primary:
ps -ef|grep smon
hostname -f

Standby:
ps -ef|grep smon
hostname -f

Primary:
. oraenv
ORCL
/u01/app/oracle/product/19.0.0.0/dbhome_1
env |grep ORA
sqlplus / as sysdba
archive log list
select FORCE_LOGGING,log_mode from v$database;


2. Check listener.ora and tnsnames.ora on primary and Standby Servers:

Primary:
cd $ORACLE_HOME/network/admin
cat listener.ora
cat tnsnames.ora
lsnrctl status LISTENER_ORCL
lsnrctl start LISTENER_ORCL

Standby:
. oraenv
ORCLSB
/u01/app/oracle/product/19.0.0.0/dbhome_1
cd $ORACLE_HOME/network/admin
cat listener.ora
cat tnsnames.ora
lsnrctl status LISTENER_ORCLSB
lsnrctl start LISTENER_ORCLSB

3. Verify tnsping on primary and Standby Servers:

Primary:
tnsping ORCL
tnsping ORCLSB

Standby:
tnsping ORCL
tnsping ORCLSB

4. Copy Primary password file to standby:

Primary:
cd $ORACLE_HOME/dbs
ls -ltr orapwORCL
scp orapwORCL oracle@standbyserver:/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwORCLSB

Standby:
cd $ORACLE_HOME/dbs
ls -l orapwORCLSB

5. Create standby init/pfile and start the standby instance in nomount mode:

Standby:
cat initORCLSB.ora
db_name=ORCL
db_unique_name=ORCLSB

. oraenv
ORCLSB
/u01/app/oracle/product/19.0.0.0/dbhome_1
env |grep ORA

sqlplus / as sysdba
startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initORCLSB.ora';

6. Verify password connectivity for both Primary and standby:

Primary:
sqlplus sys/Mallik123@ORCL as sysdba
select instance_name, status from v$instance;

sqlplus sys/Mallik123@ORCLSB as sysdba
select instance_name, status from v$instance;

Standby:
sqlplus sys/Mallik123@ORCL as sysdba
select instance_name, status from v$instance;

sqlplus sys/Mallik123@ORCLSB as sysdba
select instance_name, status from v$instance;

7. Set the standby parameters at Primary and standby redologs:

Primary:
ALTER SYSTEM SET db_unique_name='ORCL' SCOPE=SPFILE;
ALTER SYSTEM SET log_archive_config='dg_config=(ORCL,ORCLSB)' SCOPE=BOTH;

ALTER SYSTEM SET log_archive_dest_1='location=use_db_recovery_file_dest' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ORCL' SCOPE=BOTH;

ALTER SYSTEM SET log_archive_dest_2='service=ORCLSB async valid_for=(online_logfiles,primary_role) db_unique_name=ORCLSB' SCOPE=both;

ALTER SYSTEM SET fal_server='ORCLSB' SCOPE=SPFILE;
ALTER SYSTEM SET fal_client='ORCL' SCOPE=SPFILE;

ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=SPFILE;

ALTER SYSTEM SET db_file_name_convert='/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile' SCOPE=SPFILE;
ALTER SYSTEM SET log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog' SCOPE=SPFILE;

show parameter db_unique_name
show parameter log_archive_config
show parameter log_archive_dest_1
show parameter log_archive_dest_2
show parameter fal
show parameter standby_file_management
show parameter db_file_name_convert
show parameter log_file_name_convert

set pages 1000
set lines 1000
col INSTANCE for a10
col member for a75
SELECT t.INSTANCE, l.THREAD#, l.GROUP#,  l.SEQUENCE#, l.bytes, l.archived, l.status, lf.MEMBER
FROM v$log l, v$logfile lf, v$thread t
WHERE t.THREAD# = l.THREAD#
AND l.GROUP# = lf.GROUP#
ORDER BY l.THREAD#, GROUP#;

ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 4 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo01.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo01_1.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 5 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo02.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo02_2.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 6 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo03.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo03_3.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 7 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo04.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo04_4.log') SIZE 200M;

set pages 1000
set lines 1000
col DBID for a10
select * from v$standby_log;

8. Take Primary database backup:

Primary:
rman target /
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
crosscheck backup;
crosscheck archivelog all;
DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 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;
release channel ch2;
}

cd /u01/backup
ls -l

scp * oracle@10.38.4.118:/u01/backup/

Standby:
cd /u01/backup
ls -l

9. Build Standby database:

Option1:
standby build using active database duplication with backup

rman target sys/Mallik123@ORCL
connect auxiliary sys/Mallik123@ORCLSB
run
{
allocate channel p1 type disk;
allocate channel p2 type disk;
allocate channel p3 type disk;
allocate channel p4 type disk;
allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
allocate auxiliary channel s3 type disk;
allocate auxiliary channel s4 type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'ORCL','ORCLSB'
set db_name='ORCL'
set db_unique_name='ORCLSB'
set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
;
}

Option2:
standby build using backup based database duplication
rman auxiliary sys/Mallik123@ORCLSB
run
{
allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
allocate auxiliary channel s3 type disk;
allocate auxiliary channel s4 type disk;
DUPLICATE TARGET DATABASE FOR STANDBY
SPFILE
parameter_value_convert 'ORCL','ORCLSB'
set db_name='ORCL'
set db_unique_name='ORCLSB'
set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
BACKUP LOCATION '/u01/backup/' nofilenamecheck
;
}

10. Enable log shipping

sqlplus / as sysdba
SELECT name,database_role FROM v$database;
show parameter fal
alter system set fal_server=ORCL scope=both;
show parameter fal

Start mrp:
Standby:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE disconnect from session; --- arc/mrp apply
alter database recover managed standby database using current logfile disconnect from session; --- real time apply 

alter database recover managed standby database cancel;

SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=6770;

Primary:
alter system set log_archive_dest_state_2=DEFER scope=both sid='*';
alter system set log_archive_dest_state_2=enable scope=both sid='*';

11. Verify the Primary and Standby sync status:

Primary:
archive log list;
alter system switch logfile;
SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=6370;

Standby:
sqlplus / as sysdba
SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=6370;


log:

[oracle@oracledb archivelog]$ ps -ef|grep smon
oracle   22431     1  0 23:09 ?        00:00:00 ora_smon_ORCL
oracle   24508 19837  0 23:14 pts/1    00:00:00 grep --color=auto smon
[oracle@oracledb archivelog]$
[oracle@oracledb archivelog]$ hostname
oracledb.localdomain.com
[oracle@oracledb archivelog]$

[oracle@oraclesb onlinelog]$ ps -ef|grep smon
oracle    7608  6665  0 23:16 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclesb onlinelog]$
[oracle@oraclesb onlinelog]$ hostname -f
oraclesb.localdomain.com
[oracle@oraclesb onlinelog]$

[oracle@oracledb admin]$ env |grep ORA
ORACLE_SID=ORCL
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oracledb admin]$

[oracle@oracledb archivelog]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:15:00 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     5970
Next log sequence to archive   5970
Current log sequence           5972
SQL>
SQL> select FORCE_LOGGING,log_mode from v$database;

FORCE_LOGGING                           LOG_MODE
--------------------------------------- ------------
YES                                     ARCHIVELOG

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@oracledb archivelog]$
[oracle@oracledb archivelog]$ cd $ORACLE_HOME/network/admin
[oracle@oracledb admin]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin
[oracle@oracledb admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

ADR_BASE_LISTENER_ORCL = /u01/app/oracle

LISTENER_ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.localdomain.com)(PORT = 1522))
  )

[oracle@oracledb admin]$ cat tnsnames.ora
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.localdomain.com)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )

ORCLSB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oraclesb.localdomain.com)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCLSB)
    )
  )
[oracle@oracledb admin]$

[oracle@oracledb admin]$ lsnrctl status LISTENER_ORCL

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:16:17

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracledb.localdomain.com)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_ORCL
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                20-JAN-2022 09:46:47
Uptime                    205 days 13 hr. 29 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oracledb/listener_orcl/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb.localdomain.com)(PORT=1522)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCLXDB" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracledb admin]$

[oracle@oraclesb admin]$ ps -ef|grep tns
root        35     2  0 Jul05 ?        00:00:00 [netns]
oracle    4871     1  0 Aug04 ?        00:00:12 /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/tnslsnr LISTENER_ORCLSB -inherit
oracle    7804  6665  0 23:19 pts/1    00:00:00 grep --color=auto tns
[oracle@oraclesb admin]$

[oracle@oraclesb onlinelog]$ cd $ORACLE_HOME/network/admin
[oracle@oraclesb admin]$
[oracle@oraclesb admin]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin
[oracle@oraclesb admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER_ORCLSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclesb.localdomain.com)(PORT = 1522))
  )

ADR_BASE_LISTENER_ORCLSB = /u01/app/oracle

SID_LIST_LISTENER_ORCLSB =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCLSB)
      (ORACLE_HOME = /u01/app/oracle/product/19.0.0.0/dbhome_1)
      (SID_NAME = ORCLSB)
    )
  )
[oracle@oraclesb admin]$
[oracle@oraclesb admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCLSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclesb.localdomain.com)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCLSB)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.localdomain.com)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )

[oracle@oraclesb admin]$

[oracle@oraclesb admin]$ lsnrctl status LISTENER_ORCLSB

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:19:50

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oraclesb.localdomain.com)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_ORCLSB
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                04-AUG-2022 09:17:05
Uptime                    9 days 14 hr. 2 min. 44 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oraclesb/listener_orclsb/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraclesb.localdomain.com)(PORT=1522)))
Services Summary...
Service "ORCLSB" has 1 instance(s).
  Instance "ORCLSB", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@oraclesb admin]$

[oracle@oracledb admin]$ tnsping ORCL

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:18:05

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.localdomain.com)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL)))
OK (0 msec)
[oracle@oracledb admin]$
[oracle@oracledb admin]$ tnsping ORCLSB

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:18:09

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oraclesb.localdomain.com)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = ORCLSB)))
OK (10 msec)
[oracle@oracledb admin]$

[oracle@oracledb admin]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:18:29 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (ADDRESS = (PROTOCOL = TCP)(HO
                                                 ST = oracledb.localdomain.com)
                                                 (PORT = 1522))
parallel_force_local                 boolean     FALSE
SQL>


[oracle@oracledb admin]$ cd $ORACLE_HOME/dbs
[oracle@oracledb dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oracledb dbs]$ ls -ltr orapw*
-rw-r-----. 1 oracle oinstall 2048 Aug  2  2021 orapwORCL
[oracle@oracledb dbs]$

[oracle@oraclesb admin]$ cd $ORACLE_HOME/dbs
[oracle@oraclesb dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclesb dbs]$ ls -l orapw*
-rw-r-----. 1 oracle oinstall 2048 Aug  4 10:17 orapwORCLSB
[oracle@oraclesb dbs]$

[oracle@oraclesb dbs]$ cat initORCLSB.ora
db_name=ORCL
db_unique_name=ORCLSB
[oracle@oraclesb dbs]$

[oracle@oraclesb dbs]$ . oraenv
ORACLE_SID = [ORCLSB] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclesb dbs]$ env |grep ORA
ORACLE_SID=ORCLSB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclesb dbs]$

[oracle@oraclesb dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:23:54 2022
Version 19.11.0.0.0

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

Connected to an idle instance.

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

Total System Global Area  322960856 bytes
Fixed Size                  8895960 bytes
Variable Size             239075328 bytes
Database Buffers           67108864 bytes
Redo Buffers                7880704 bytes
SQL>

[oracle@oraclesb dbs]$ tnsping ORCL

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:24:50

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.localdomain.com)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = ORCL)))
OK (0 msec)
[oracle@oraclesb dbs]$ tnsping ORCLSB

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 13-AUG-2022 23:24:53

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oraclesb.localdomain.com)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLSB)))
OK (0 msec)
[oracle@oraclesb dbs]$

[oracle@oracledb dbs]$ sqlplus sys/Mallik123@ORCL as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:22:50 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
ORCL             OPEN

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@oracledb dbs]$ sqlplus sys/Mallik123@ORCLSB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:23:14 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
ORCLSB           STARTED

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@oracledb dbs]$

[oracle@oraclesb dbs]$ sqlplus sys/Mallik123@ORCL as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:25:51 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
ORCL             OPEN

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@oraclesb dbs]$ sqlplus sys/Mallik123@ORCLSB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:26:05 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
ORCLSB           STARTED

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@oraclesb dbs]$

[oracle@oracledb dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 13 23:24:32 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      ORCL
SQL> show parameter log_archive_config

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_config                   string      dg_config=(ORCL,ORCLSB)
SQL> show parameter log_archive_dest_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string      location=use_db_recovery_file_
                                                 dest
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
log_archive_dest_13                  string
log_archive_dest_14                  string
log_archive_dest_15                  string
log_archive_dest_16                  string
log_archive_dest_17                  string
log_archive_dest_18                  string

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_19                  string
SQL> show parameter log_archive_dest_2

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2                   string      service=ORCLSB async valid_for
                                                 =(online_logfiles,primary_role
                                                 ) db_unique_name=ORCLSB
log_archive_dest_20                  string
log_archive_dest_21                  string
log_archive_dest_22                  string
log_archive_dest_23                  string
log_archive_dest_24                  string
log_archive_dest_25                  string
log_archive_dest_26                  string
log_archive_dest_27                  string

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_28                  string
log_archive_dest_29                  string
SQL> show parameter fal

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
fal_client                           string      ORCL
fal_server                           string      ORCLSB
SQL> show parameter standby_file_management

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      AUTO
SQL> show parameter db_file_name_convert

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string      /u01/app/oracle/oradata/ORCL/d
                                                 atafile, /u01/app/oracle/orada
                                                 ta/ORCLSB/datafile
pdb_file_name_convert                string
SQL> show parameter log_file_name_convert

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_file_name_convert                string      /u01/app/oracle/oradata/ORCL/o
                                                 nlinelog, /u01/app/oracle/orad
                                                 ata/ORCLSB/onlinelog, /u01/app
                                                 /oracle/fast_recovery_area/ORC
                                                 L/onlinelog, /u01/app/oracle/f
                                                 ast_recovery_area/ORCLSB/onlin
                                                 elog
SQL>

ALTER SYSTEM SET db_unique_name='ORCL' SCOPE=SPFILE;
ALTER SYSTEM SET log_archive_config='dg_config=(ORCL,ORCLSB)' SCOPE=BOTH;

ALTER SYSTEM SET log_archive_dest_1='location=use_db_recovery_file_dest' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=ORCL' SCOPE=BOTH;

ALTER SYSTEM SET log_archive_dest_2='service=ORCLSB async valid_for=(online_logfiles,primary_role) db_unique_name=ORCLSB' SCOPE=both;

ALTER SYSTEM SET fal_server='ORCLSB' SCOPE=SPFILE;
ALTER SYSTEM SET fal_client='ORCL' SCOPE=SPFILE;

ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=SPFILE;

ALTER SYSTEM SET db_file_name_convert='/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile' SCOPE=SPFILE;
ALTER SYSTEM SET log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog' SCOPE=SPFILE;

SQL> set pages 1000
set lines 1000
col INSTANCE for a10
SQL> SQL> SQL> col member for a75
SQL> SELECT t.INSTANCE, l.THREAD#, l.GROUP#,  l.SEQUENCE#, l.bytes, l.archived, l.status, lf.MEMBER
  2  FROM v$log l, v$logfile lf, v$thread t
  3  WHERE t.THREAD# = l.THREAD#
  4  AND l.GROUP# = lf.GROUP#
  5  ORDER BY l.THREAD#, GROUP#;

INSTANCE      THREAD#     GROUP#  SEQUENCE#      BYTES ARC STATUS           MEMBER
---------- ---------- ---------- ---------- ---------- --- ---------------- ---------------------------------------------------------------------------
ORCL                1          1       5971  209715200 NO  INACTIVE         /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_k90p82vd_.log
ORCL                1          1       5971  209715200 NO  INACTIVE         /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_1_k90p8306_.log
ORCL                1          2       5972  209715200 NO  CURRENT          /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_k90p84vy_.log
ORCL                1          2       5972  209715200 NO  CURRENT          /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_2_k90p850w_.log
ORCL                1          3       5970  209715200 NO  INACTIVE         /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_k90p8704_.log
ORCL                1          3       5970  209715200 NO  INACTIVE         /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_3_k90p8749_.log

6 rows selected.

SQL>

SQL> set pages 1000
set lines 1000
col DBID for a10
select * from v$standby_log;SQL> SQL> SQL>

    GROUP# DBID          THREAD#  SEQUENCE#      BYTES  BLOCKSIZE       USED ARC STATUS     FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME LAST_CHANGE# LAST_TIME     CON_ID
---------- ---------- ---------- ---------- ---------- ---------- ---------- --- ---------- ------------- --------- ------------ --------- ------------ --------- ----------
         4 UNASSIGNED          1          0  209715200        512          0 YES UNASSIGNED                                                                                0
         5 UNASSIGNED          1          0  209715200        512          0 YES UNASSIGNED                                                                                0
         6 UNASSIGNED          1          0  209715200        512          0 YES UNASSIGNED                                                                                0
         7 UNASSIGNED          1          0  209715200        512          0 YES UNASSIGNED                                                                                0
SQL>

ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 4 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo01.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo01_1.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 5 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo02.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo02_2.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 6 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo03.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo03_3.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 7 ('/u01/app/oracle/oradata/ORCL/onlinelog/standby_redo04.log','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/standby_redo04_4.log') SIZE 200M;

Backup:
rman target /
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
crosscheck backup;
crosscheck archivelog all;
DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 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;
release channel ch2;
}

[oracle@oracledb backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Aug 13 23:51:14 2022
Version 19.11.0.0.0

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

connected to target database: ORCL (DBID=1607315920)

RMAN> run {
2> allocate channel ch1 device type disk;
3> allocate channel ch2 device type disk;
4> crosscheck backup;
crosscheck archivelog all;
5> 6> DELETE noprompt archivelog all COMPLETED BEFORE 'SYSDATE-7';
backup as backupset incremental level 0 database format '/u01/backup/Fullback_%T_%U'
7> plus archivelog format '/u01/backup/Archive_%T_%U';
backup current controlfile format '/u01/backup/Controlback_%T_%U';
8> 9> release channel ch1;
10> 11> release channel ch2;
}12>

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

allocated channel: ch2
channel ch2: SID=393 device type=DISK

crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/tmp/ForStandby_gd14d0jl_10765_1_1 RECID=10038 STAMP=1111917174
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/tmp/ForStandby_ge14d0jp_10766_1_1 RECID=10039 STAMP=1111917178
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2022_08_05/o1_mf_s_1111917388_kgs6zo2y_.bkp RECID=10040 STAMP=1111917389
Crosschecked 2 objects

crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2022_08_13/o1_mf_s_1112658521_khhtr1n5_.bkp RECID=10071 STAMP=1112658521
Crosschecked 2 objects


validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5970_khhtgr0x_.arc RECID=1864 STAMP=1112658224
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5971_khhtdynh_.arc RECID=1863 STAMP=1112658166
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5972_khhtgr2w_.arc RECID=1865 STAMP=1112658224
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5973_khhtljgg_.arc RECID=1866 STAMP=1112658344
validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5974_khhtqf1t_.arc RECID=1867 STAMP=1112658501
Crosschecked 3 objects

validation succeeded for archived log
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2022_08_13/o1_mf_1_5975_khhtqz0c_.arc RECID=1868 STAMP=1112658519
Crosschecked 3 objects




Starting backup at 13-AUG-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=5970 RECID=1864 STAMP=1112658224
input archived log thread=1 sequence=5971 RECID=1863 STAMP=1112658166
input archived log thread=1 sequence=5972 RECID=1865 STAMP=1112658224
input archived log thread=1 sequence=5973 RECID=1866 STAMP=1112658344
channel ch1: starting piece 1 at 13-AUG-22
channel ch2: starting archived log backup set
channel ch2: specifying archived log(s) in backup set
input archived log thread=1 sequence=5974 RECID=1867 STAMP=1112658501
input archived log thread=1 sequence=5975 RECID=1868 STAMP=1112658519
input archived log thread=1 sequence=5976 RECID=1869 STAMP=1112658688
channel ch2: starting piece 1 at 13-AUG-22
channel ch1: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Archive_20220813_hm153ko0_10806_1_1 tag=TAG20220813T235128 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
channel ch2: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Archive_20220813_hn153ko0_10807_1_1 tag=TAG20220813T235128 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-22

Starting backup at 13-AUG-22
channel ch1: starting incremental level 0 datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_k3jps1mq_.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf
channel ch1: starting piece 1 at 13-AUG-22
channel ch2: starting incremental level 0 datafile backup set
channel ch2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_k3jprllp_.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_k3jpsqnf_.dbf
channel ch2: starting piece 1 at 13-AUG-22
channel ch1: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Fullback_20220813_ho153ko1_10808_1_1 tag=TAG20220813T235129 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:15
channel ch1: starting incremental level 0 datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/datafile/test_16k_ts01.dbf
channel ch1: starting piece 1 at 13-AUG-22
channel ch2: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Fullback_20220813_hp153ko1_10809_1_1 tag=TAG20220813T235129 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:15
channel ch1: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Fullback_20220813_hq153kog_10810_1_1 tag=TAG20220813T235129 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-22

Starting backup at 13-AUG-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=5977 RECID=1870 STAMP=1112658706
channel ch1: starting piece 1 at 13-AUG-22
channel ch1: finished piece 1 at 13-AUG-22
piece handle=/u01/backup/Archive_20220813_hr153koi_10811_1_1 tag=TAG20220813T235146 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-22

Starting backup at 13-AUG-22
channel ch1: starting datafile copy
copying current control file
output file name=/u01/backup/Controlback_20220813_cf_D-ORCL_id-1607315920_hs153koj tag=TAG20220813T235147 RECID=970 STAMP=1112658707
channel ch1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-AUG-22

Starting Control File and SPFILE Autobackup at 13-AUG-22
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2022_08_13/o1_mf_s_1112658708_khhtxwly_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-22

released channel: ch1

released channel: ch2

RMAN> exit


Recovery Manager complete.
[oracle@oracledb backup]$ pwd
/u01/backup
[oracle@oracledb backup]$ ll
total 2281296
-rw-r-----. 1 oracle oinstall   48598528 Aug 13 23:51 Archive_20220813_hm153ko0_10806_1_1
-rw-r-----. 1 oracle oinstall   20655104 Aug 13 23:51 Archive_20220813_hn153ko0_10807_1_1
-rw-r-----. 1 oracle oinstall      13824 Aug 13 23:51 Archive_20220813_hr153koi_10811_1_1
-rw-r-----. 1 oracle oinstall   26034176 Aug 13 23:51 Controlback_20220813_cf_D-ORCL_id-1607315920_hs153koj
-rw-r-----. 1 oracle oinstall 1298079744 Aug 13 23:51 Fullback_20220813_ho153ko1_10808_1_1
-rw-r-----. 1 oracle oinstall  942481408 Aug 13 23:51 Fullback_20220813_hp153ko1_10809_1_1
-rw-r-----. 1 oracle oinstall     180224 Aug 13 23:51 Fullback_20220813_hq153kog_10810_1_1
[oracle@oracledb backup]$

[oracle@oracledb backup]$ scp * oracle@10.38.4.118:/u01/backup/
oracle@10.38.4.118's password:
Archive_20220813_hm153ko0_10806_1_1                                                                                                                    100%   46MB  87.2MB/s   00:00
Archive_20220813_hn153ko0_10807_1_1                                                                                                                    100%   20MB  92.6MB/s   00:00
Archive_20220813_hr153koi_10811_1_1                                                                                                                    100%   14KB   2.5MB/s   00:00
Controlback_20220813_cf_D-ORCL_id-1607315920_hs153koj                                                                                                  100%   25MB  92.3MB/s   00:00
Fullback_20220813_ho153ko1_10808_1_1                                                                                                                   100% 1238MB 123.8MB/s   00:10
Fullback_20220813_hp153ko1_10809_1_1                                                                                                                   100%  899MB 112.3MB/s   00:08
Fullback_20220813_hq153kog_10810_1_1                                                                                                                   100%  176KB  46.6MB/s   00:00
[oracle@oracledb backup]$

[oracle@oraclesb backup]$ ll
total 2281296
-rw-r-----. 1 oracle oinstall   48598528 Aug 13 23:55 Archive_20220813_hm153ko0_10806_1_1
-rw-r-----. 1 oracle oinstall   20655104 Aug 13 23:55 Archive_20220813_hn153ko0_10807_1_1
-rw-r-----. 1 oracle oinstall      13824 Aug 13 23:55 Archive_20220813_hr153koi_10811_1_1
-rw-r-----. 1 oracle oinstall   26034176 Aug 13 23:55 Controlback_20220813_cf_D-ORCL_id-1607315920_hs153koj
-rw-r-----. 1 oracle oinstall 1298079744 Aug 13 23:55 Fullback_20220813_ho153ko1_10808_1_1
-rw-r-----. 1 oracle oinstall  942481408 Aug 13 23:56 Fullback_20220813_hp153ko1_10809_1_1
-rw-r-----. 1 oracle oinstall     180224 Aug 13 23:56 Fullback_20220813_hq153kog_10810_1_1
[oracle@oraclesb backup]$

Option1:
rman target sys/Mallik123@ORCL
connect auxiliary sys/Mallik123@ORCLSB

run
{
allocate channel p1 type disk;
allocate channel p2 type disk;
allocate channel p3 type disk;
allocate channel p4 type disk;
allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
allocate auxiliary channel s3 type disk;
allocate auxiliary channel s4 type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'ORCL','ORCLSB'
set db_name='ORCL'
set db_unique_name='ORCLSB'
set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
;
}

[oracle@oraclesb ~]$ rman target sys/Mallik123@ORCL

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 00:37:29 2022
Version 19.11.0.0.0

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

connected to target database: ORCL (DBID=1607315920)

RMAN> connect auxiliary sys/Mallik123@ORCLSB

connected to auxiliary database: ORCL (not mounted)

RMAN> run
{
allocate channel p1 type disk;
2> 3> allocate channel p2 type disk;
allocate channel p3 type disk;
4> 5> allocate channel p4 type disk;
6> 7> allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
8> allocate auxiliary channel s3 type disk;
9> allocate auxiliary channel s4 type disk;
10> 11> duplicate target database for standby from active database
12> spfile
parameter_value_convert 'ORCL','ORCLSB'
13> 14> set db_name='ORCL'
15> set db_unique_name='ORCLSB'
16> set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
17> 18> ;
}19>

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

allocated channel: p2
channel p2: SID=390 device type=DISK

allocated channel: p3
channel p3: SID=276 device type=DISK

allocated channel: p4
channel p4: SID=395 device type=DISK

allocated channel: s1
channel s1: SID=10 device type=DISK

allocated channel: s2
channel s2: SID=150 device type=DISK

allocated channel: s3
channel s3: SID=294 device type=DISK

allocated channel: s4
channel s4: SID=434 device type=DISK

Starting Duplicate Db at 14-AUG-22

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/orapwORCLSB'   ;
   restore clone from service  'ORCL' spfile to
 '/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora';
   sql clone "alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora''";
}
executing Memory Script

Starting backup at 14-AUG-22
Finished backup at 14-AUG-22

Starting restore at 14-AUG-22

channel s1: starting datafile backup set restore
channel s1: using network backup set from service ORCL
channel s1: restoring SPFILE
output file name=/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora
channel s1: restore complete, elapsed time: 00:00:01
Finished restore at 14-AUG-22

sql statement: alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora''

contents of Memory Script:
{
   sql clone "alter system set  audit_file_dest =
 ''/u01/app/oracle/admin/ORCLSB/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=ORCLSBXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_client =
 ''ORCLSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server =
 ''ORCLSBSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCLSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''/u01/app/oracle/oradata/ORCL/datafile'', ''/u01/app/oracle/oradata/ORCLSB/datafile'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''/u01/app/oracle/oradata/ORCL/onlinelog'', ''/u01/app/oracle/oradata/ORCLSB/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCL/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/ORCLSB/adump'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=ORCLSBXDB)'' comment= '''' scope=spfile

sql statement: alter system set  fal_client =  ''ORCLSB'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''ORCLSBSB'' comment= '''' scope=spfile

sql statement: alter system set  db_name =  ''ORCL'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCLSB'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/u01/app/oracle/oradata/ORCL/datafile'', ''/u01/app/oracle/oradata/ORCLSB/datafile'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''/u01/app/oracle/oradata/ORCL/onlinelog'', ''/u01/app/oracle/oradata/ORCLSB/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCL/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3707763112 bytes

Fixed Size                     8903080 bytes
Variable Size                704643072 bytes
Database Buffers            2986344448 bytes
Redo Buffers                   7872512 bytes
allocated channel: s1
channel s1: SID=261 device type=DISK
allocated channel: s2
channel s2: SID=379 device type=DISK
allocated channel: s3
channel s3: SID=10 device type=DISK
allocated channel: s4
channel s4: SID=137 device type=DISK

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment=
 ''Set by RMAN'' scope=spfile";
   restore clone from service  'ORCL' standby controlfile;
}
executing Memory Script

sql statement: alter system set  control_files =   ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment= ''Set by RMAN'' scope=spfile

Starting restore at 14-AUG-22

channel s1: starting datafile backup set restore
channel s1: using network backup set from service ORCL
channel s1: restoring control file
channel s1: restore complete, elapsed time: 00:00:02
output file name=/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl
output file name=/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl
Finished restore at 14-AUG-22

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_temp_k9ng3t4v_.tmp";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_k3jprllp_.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_k3jps1mq_.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_k3jpsqnf_.dbf";
   restore
   from  nonsparse   from service
 'ORCL'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_temp_k9ng3t4v_.tmp in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 14-AUG-22

channel s1: starting datafile backup set restore
channel s1: using network backup set from service ORCL
channel s1: specifying datafile(s) to restore from backup set
channel s1: restoring datafile 00001 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_k3jprllp_.dbf
channel s2: starting datafile backup set restore
channel s2: using network backup set from service ORCL
channel s2: specifying datafile(s) to restore from backup set
channel s2: restoring datafile 00003 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_k3jps1mq_.dbf
channel s3: starting datafile backup set restore
channel s3: using network backup set from service ORCL
channel s3: specifying datafile(s) to restore from backup set
channel s3: restoring datafile 00004 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf
channel s4: starting datafile backup set restore
channel s4: using network backup set from service ORCL
channel s4: specifying datafile(s) to restore from backup set
channel s4: restoring datafile 00005 to /u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf
channel s4: restore complete, elapsed time: 00:00:01
channel s4: starting datafile backup set restore
channel s4: using network backup set from service ORCL
channel s4: specifying datafile(s) to restore from backup set
channel s4: restoring datafile 00007 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_k3jpsqnf_.dbf
channel s4: restore complete, elapsed time: 00:00:03
channel s3: restore complete, elapsed time: 00:00:09
channel s1: restore complete, elapsed time: 00:00:17
channel s2: restore complete, elapsed time: 00:00:17
Finished restore at 14-AUG-22

sql statement: alter system archive log current

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

datafile 1 switched to datafile copy
input datafile copy RECID=971 STAMP=1112661539 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_khhxoty2_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=972 STAMP=1112661539 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_khhxov0r_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=973 STAMP=1112661539 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_khhxov2o_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=974 STAMP=1112661539 file name=/u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=975 STAMP=1112661539 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_khhxow6n_.dbf
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Finished Duplicate Db at 14-AUG-22
released channel: p1
released channel: p2
released channel: p3
released channel: p4
released channel: s1
released channel: s2
released channel: s3
released channel: s4

RMAN> exit


Recovery Manager complete.
[oracle@oraclesb ~]$


Option2:
rman auxiliary sys/Mallik123@ORCLSB

run
{
allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
allocate auxiliary channel s3 type disk;
allocate auxiliary channel s4 type disk;
DUPLICATE TARGET DATABASE FOR STANDBY
SPFILE
parameter_value_convert 'ORCL','ORCLSB'
set db_name='ORCL'
set db_unique_name='ORCLSB'
set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
BACKUP LOCATION '/u01/backup/' nofilenamecheck
;
}

[oracle@oraclesb backup]$ rman auxiliary sys/Mallik123@ORCLSB

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 00:27:07 2022
Version 19.11.0.0.0

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

connected to auxiliary database: ORCL (not mounted)

RMAN> run
{
allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
2> 3> allocate auxiliary channel s3 type disk;
4> 5> allocate auxiliary channel s4 type disk;
6> 7> DUPLICATE TARGET DATABASE FOR STANDBY
SPFILE
parameter_value_convert 'ORCL','ORCLSB'
8> 9> 10> set db_name='ORCL'
set db_unique_name='ORCLSB'
11> 12> set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
13> 14> BACKUP LOCATION '/u01/backup/' nofilenamecheck
;
15> 16> }

allocated channel: s1
channel s1: SID=10 device type=DISK

allocated channel: s2
channel s2: SID=150 device type=DISK

allocated channel: s3
channel s3: SID=293 device type=DISK

allocated channel: s4
channel s4: SID=435 device type=DISK

Starting Duplicate Db at 14-AUG-22
released channel: s1
released channel: s2
released channel: s3
released channel: s4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/14/2022 00:27:16
RMAN-05501: aborting duplication of target database
RMAN-05569: SPFILE backup not found in /u01/backup/

RMAN>


[oracle@oracledb backup]$ scp /u01/app/oracle/fast_recovery_area/ORCL/autobackup/2022_08_13/o1_mf_s_1112658708_khhtxwly_.bkp oracle@10.38.4.118:/u01/backup/
oracle@10.38.4.118's password:
o1_mf_s_1112658708_khhtxwly_.bkp                                                                                                                       100%   25MB  90.3MB/s   00:00
You have new mail in /var/spool/mail/oracle
[oracle@oracledb backup]$

[oracle@oraclesb backup]$ ls -ltr
total 2306832
-rw-r-----. 1 oracle oinstall   48598528 Aug 13 23:55 Archive_20220813_hm153ko0_10806_1_1
-rw-r-----. 1 oracle oinstall   20655104 Aug 13 23:55 Archive_20220813_hn153ko0_10807_1_1
-rw-r-----. 1 oracle oinstall      13824 Aug 13 23:55 Archive_20220813_hr153koi_10811_1_1
-rw-r-----. 1 oracle oinstall   26034176 Aug 13 23:55 Controlback_20220813_cf_D-ORCL_id-1607315920_hs153koj
-rw-r-----. 1 oracle oinstall 1298079744 Aug 13 23:55 Fullback_20220813_ho153ko1_10808_1_1
-rw-r-----. 1 oracle oinstall  942481408 Aug 13 23:56 Fullback_20220813_hp153ko1_10809_1_1
-rw-r-----. 1 oracle oinstall     180224 Aug 13 23:56 Fullback_20220813_hq153kog_10810_1_1
-rw-r-----. 1 oracle oinstall   26148864 Aug 14 00:28 o1_mf_s_1112658708_khhtxwly_.bkp
[oracle@oraclesb backup]$

[oracle@oraclesb backup]$ rman auxiliary sys/Mallik123@ORCLSB

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Aug 14 00:30:08 2022
Version 19.11.0.0.0

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

connected to auxiliary database: ORCL (not mounted)

RMAN> run
{
2> 3> allocate auxiliary channel s1 type disk;
allocate auxiliary channel s2 type disk;
4> allocate auxiliary channel s3 type disk;
5> 6> allocate auxiliary channel s4 type disk;
DUPLICATE TARGET DATABASE FOR STANDBY
7> SPFILE
8> parameter_value_convert 'ORCL','ORCLSB'
9> 10> set db_name='ORCL'
11> set db_unique_name='ORCLSB'
set db_file_name_convert '/u01/app/oracle/oradata/ORCL/datafile','/u01/app/oracle/oradata/ORCLSB/datafile'
12> 13> set log_file_name_convert='/u01/app/oracle/oradata/ORCL/onlinelog','/u01/app/oracle/oradata/ORCLSB/onlinelog','/u01/app/oracle/fast_recovery_area/ORCL/onlinelog','/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'
14> BACKUP LOCATION '/u01/backup/' nofilenamecheck
15> ;
16> }

allocated channel: s1
channel s1: SID=433 device type=DISK

allocated channel: s2
channel s2: SID=10 device type=DISK

allocated channel: s3
channel s3: SID=149 device type=DISK

allocated channel: s4
channel s4: SID=292 device type=DISK

Starting Duplicate Db at 14-AUG-22
searching for database ID
found backup of database ID 1607315920

contents of Memory Script:
{
   restore clone spfile to  '/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora' from
 '/u01/backup/o1_mf_s_1112658708_khhtxwly_.bkp';
   sql clone "alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora''";
}
executing Memory Script

Starting restore at 14-AUG-22

channel s2: skipped, AUTOBACKUP already found
channel s3: skipped, AUTOBACKUP already found
channel s4: skipped, AUTOBACKUP already found
channel s1: restoring spfile from AUTOBACKUP /u01/backup/o1_mf_s_1112658708_khhtxwly_.bkp
channel s1: SPFILE restore from AUTOBACKUP complete
Finished restore at 14-AUG-22

sql statement: alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/spfileORCLSB.ora''

contents of Memory Script:
{
   sql clone "alter system set  audit_file_dest =
 ''/u01/app/oracle/admin/ORCLSB/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=ORCLSBXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_client =
 ''ORCLSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server =
 ''ORCLSBSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCLSB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''/u01/app/oracle/oradata/ORCL/datafile'', ''/u01/app/oracle/oradata/ORCLSB/datafile'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''/u01/app/oracle/oradata/ORCL/onlinelog'', ''/u01/app/oracle/oradata/ORCLSB/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCL/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/ORCLSB/adump'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=ORCLSBXDB)'' comment= '''' scope=spfile

sql statement: alter system set  fal_client =  ''ORCLSB'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''ORCLSBSB'' comment= '''' scope=spfile

sql statement: alter system set  db_name =  ''ORCL'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCLSB'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/u01/app/oracle/oradata/ORCL/datafile'', ''/u01/app/oracle/oradata/ORCLSB/datafile'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''/u01/app/oracle/oradata/ORCL/onlinelog'', ''/u01/app/oracle/oradata/ORCLSB/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCL/onlinelog'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/onlinelog'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3707763112 bytes

Fixed Size                     8903080 bytes
Variable Size                704643072 bytes
Database Buffers            2986344448 bytes
Redo Buffers                   7872512 bytes
allocated channel: s1
channel s1: SID=262 device type=DISK
allocated channel: s2
channel s2: SID=379 device type=DISK
allocated channel: s3
channel s3: SID=11 device type=DISK
allocated channel: s4
channel s4: SID=136 device type=DISK

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment=
 ''Set by RMAN'' scope=spfile";
   restore clone standby controlfile from  '/u01/backup/o1_mf_s_1112658708_khhtxwly_.bkp';
}
executing Memory Script

sql statement: alter system set  control_files =   ''/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl'', ''/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl'' comment= ''Set by RMAN'' scope=spfile

Starting restore at 14-AUG-22

channel s2: skipped, AUTOBACKUP already found
channel s3: skipped, AUTOBACKUP already found
channel s4: skipped, AUTOBACKUP already found
channel s1: restoring control file
channel s1: restore complete, elapsed time: 00:00:08
output file name=/u01/app/oracle/oradata/ORCLSB/controlfile/o1_mf_jjhgcrh6_.ctl
output file name=/u01/app/oracle/fast_recovery_area/ORCLSB/controlfile/o1_mf_jjhgcrjw_.ctl
Finished restore at 14-AUG-22

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_k3jprllp_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_k3jps1mq_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_k3jpsqnf_.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_temp_k9ng3t4v_.tmp conflicts with a file used by the target database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_temp_k9ng3t4v_.tmp";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_k3jprllp_.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_k3jps1mq_.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_k3jpsqnf_.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_temp_k9ng3t4v_.tmp in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 14-AUG-22

channel s1: starting datafile backup set restore
channel s1: specifying datafile(s) to restore from backup set
channel s1: restoring datafile 00001 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_k3jprllp_.dbf
channel s1: restoring datafile 00007 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_k3jpsqnf_.dbf
channel s1: reading from backup piece /u01/backup/Fullback_20220813_hp153ko1_10809_1_1
channel s2: starting datafile backup set restore
channel s2: specifying datafile(s) to restore from backup set
channel s2: restoring datafile 00003 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_k3jps1mq_.dbf
channel s2: restoring datafile 00004 to /u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_k3jpsjp6_.dbf
channel s2: reading from backup piece /u01/backup/Fullback_20220813_ho153ko1_10808_1_1
channel s3: starting datafile backup set restore
channel s3: specifying datafile(s) to restore from backup set
channel s3: restoring datafile 00005 to /u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf
channel s3: reading from backup piece /u01/backup/Fullback_20220813_hq153kog_10810_1_1
channel s3: piece handle=/u01/backup/Fullback_20220813_hq153kog_10810_1_1 tag=TAG20220813T235129
channel s3: restored backup piece 1
channel s3: restore complete, elapsed time: 00:00:01
channel s1: piece handle=/u01/backup/Fullback_20220813_hp153ko1_10809_1_1 tag=TAG20220813T235129
channel s1: restored backup piece 1
channel s1: restore complete, elapsed time: 00:00:07
channel s2: piece handle=/u01/backup/Fullback_20220813_ho153ko1_10808_1_1 tag=TAG20220813T235129
channel s2: restored backup piece 1
channel s2: restore complete, elapsed time: 00:00:15
Finished restore at 14-AUG-22

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

datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=1112661082 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_system_khhx7mcm_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=1112661082 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_sysaux_khhx7md2_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=1112661082 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_undotbs1_khhx7mdm_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=1112661082 file name=/u01/app/oracle/oradata/ORCLSB/datafile/test_16k_ts01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=1112661082 file name=/u01/app/oracle/oradata/ORCLSB/datafile/o1_mf_users_khhx7mcq_.dbf
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Oracle error from auxiliary database: ORA-01275: Operation RENAME is not allowed if standby file management is automatic.

RMAN-05535: warning: All redo log files were not defined properly.
Finished Duplicate Db at 14-AUG-22
released channel: s1
released channel: s2
released channel: s3
released channel: s4

RMAN> exit


Recovery Manager complete.
[oracle@oraclesb backup]$ 


[oracle@oraclesb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 00:40:12 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> SELECT name,database_role FROM v$database;

NAME      DATABASE_ROLE
--------- ----------------
ORCL      PHYSICAL STANDBY

SQL> show parameter fal

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
fal_client                           string      ORCLSB
fal_server                           string      ORCLSBSB
SQL> alter system set fal_server=ORCL scope=both;

System altered.

SQL> show parameter fal

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
fal_client                           string      ORCLSB
fal_server                           string      ORCL
SQL>


Standby:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE disconnect from session; --- arc/mrp apply
alter database recover managed standby database using current logfile disconnect from session; --- real time apply 

alter database recover managed standby database cancel;

SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=6770;

Primary:
alter system set log_archive_dest_state_2=DEFER scope=both sid='*';
alter system set log_archive_dest_state_2=enable scope=both sid='*';


[oracle@oracledb backup]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 00:39:37 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> alter system set log_archive_dest_state_2=enable scope=both sid='*';

System altered.

SQL>


[oracle@oraclesb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 00:40:12 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL>
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE disconnect from session;

Database altered.

SQL>

[oracle@oracledb backup]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 00:39:37 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL>
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     5979
Next log sequence to archive   5981
Current log sequence           5981
SQL>

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=5979;

 SEQUENCE# FIRST_TIM NEXT_TIME APPLIED
---------- --------- --------- ---------
      5979 14-AUG-22 14-AUG-22 NO
      5980 14-AUG-22 14-AUG-22 NO
      5980 14-AUG-22 14-AUG-22 YES
      5981 14-AUG-22 14-AUG-22 NO
      5981 14-AUG-22 14-AUG-22 YES
      5982 14-AUG-22 14-AUG-22 NO
      5982 14-AUG-22 14-AUG-22 YES
      5983 14-AUG-22 14-AUG-22 NO
      5983 14-AUG-22 14-AUG-22 YES

9 rows selected.

SQL>

[oracle@oraclesb ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 14 00:40:12 2022
Version 19.11.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> 
SQL> SELECT sequence#, first_time, next_time, applied FROM v$archived_log where sequence#>=5979;

 SEQUENCE# FIRST_TIM NEXT_TIME APPLIED
---------- --------- --------- ---------
      5980 14-AUG-22 14-AUG-22 YES
      5981 14-AUG-22 14-AUG-22 YES
      5982 14-AUG-22 14-AUG-22 YES
      5983 14-AUG-22 14-AUG-22 YES

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...