Tuesday, March 1, 2022

RAC to RAC Database Restore Recover Vs RMAN Clone

RAC to RAC Database Restore Recover Vs RMAN Clone:

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

1. Prestep take source DB backups and transfer it to target
2. Restore and Recover schenario:
3. RMAN Clone schenario:
4. Post Restore/Clone Steps:



1. Prestep take source DB backups and transfer it to target
==========================================================
rman target /
run {
allocate channel ch1 device type disk;
backup as backupset database format '/u01/backup/Fullback_%T_%U'
plus archivelog format '/u01/backup/Archive_%T_%U';
backup current controlfile format '/u01/backup/Controlback_%T_%U';
backup spfile format '/u01/backup/spfile_%T_%U';
release channel ch1;
}

scp /u01/backup/* oracle@target:/u01/backup/.


[oracle@oranode1 backup]$ . oraenv
ORACLE_SID = [DEVDB1] ?
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@oranode1 backup]$
[oracle@oranode1 backup]$ env |grep ORA
ORACLE_SID=DEVDB1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oranode1 backup]$
[oracle@oranode1 backup]$ pwd
/u01/backup
[oracle@oranode1 backup]$ ls -ltrh
total 0
[oracle@oranode1 backup]$
[oracle@oranode1 backup]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Feb 18 19:51:40 2022
Version 19.3.0.0.0

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

connected to target database: DEVDB (DBID=1000656445)

RMAN> run {
allocate channel ch1 device type disk;
2> 3> backup as backupset database format '/u01/backup/Fullback_%T_%U'
4> plus archivelog format '/u01/backup/Archive_%T_%U';
5> backup current controlfile format '/u01/backup/Controlback_%T_%U';
backup spfile format '/u01/backup/spfile_%T_%U';
6> 7> release channel ch1;
8> }

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


Starting backup at 18-FEB-22
current log archived
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=2 sequence=7 RECID=2 STAMP=1096938623
input archived log thread=1 sequence=19 RECID=1 STAMP=1096938621
input archived log thread=1 sequence=20 RECID=3 STAMP=1096938655
input archived log thread=2 sequence=8 RECID=4 STAMP=1096938655
input archived log thread=1 sequence=21 RECID=5 STAMP=1096940093
input archived log thread=2 sequence=9 RECID=6 STAMP=1096940093
input archived log thread=1 sequence=22 RECID=7 STAMP=1096940114
input archived log thread=2 sequence=10 RECID=8 STAMP=1096940084
input archived log thread=1 sequence=23 RECID=9 STAMP=1097005913
input archived log thread=2 sequence=11 RECID=10 STAMP=1097005882
channel ch1: starting piece 1 at 18-FEB-22
channel ch1: finished piece 1 at 18-FEB-22
piece handle=/u01/backup/Archive_20220218_050m3uhu_1_1 tag=TAG20220218T195153 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:03
Finished backup at 18-FEB-22

Starting backup at 18-FEB-22
channel ch1: starting full datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/DEVDB/DATAFILE/sysaux.268.1095926363
input datafile file number=00001 name=+DATA/DEVDB/DATAFILE/system.267.1095926327
input datafile file number=00004 name=+DATA/DEVDB/DATAFILE/undotbs1.269.1095926387
input datafile file number=00005 name=+DATA/DEVDB/DATAFILE/undotbs2.275.1095926641
input datafile file number=00007 name=+DATA/DEVDB/DATAFILE/users.270.1095926389
channel ch1: starting piece 1 at 18-FEB-22
channel ch1: finished piece 1 at 18-FEB-22
piece handle=/u01/backup/Fullback_20220218_060m3ui1_1_1 tag=TAG20220218T195156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-FEB-22

Starting backup at 18-FEB-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=24 RECID=11 STAMP=1097005932
input archived log thread=2 sequence=12 RECID=12 STAMP=1097005902
channel ch1: starting piece 1 at 18-FEB-22
channel ch1: finished piece 1 at 18-FEB-22
piece handle=/u01/backup/Archive_20220218_070m3uij_1_1 tag=TAG20220218T195213 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-FEB-22

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

Starting backup at 18-FEB-22
channel ch1: starting full datafile backup set
channel ch1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch1: starting piece 1 at 18-FEB-22
channel ch1: finished piece 1 at 18-FEB-22
piece handle=/u01/backup/spfile_20220218_0a0m417c_1_1 tag=TAG20220218T195216 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-FEB-22

Starting Control File and SPFILE Autobackup at 18-FEB-22
piece handle=+RECO/DEVDB/AUTOBACKUP/2022_02_18/s_1097005938.273.1097005939 comment=NONE
Finished Control File and SPFILE Autobackup at 18-FEB-22

released channel: ch1

RMAN> exit

Recovery Manager complete.
[oracle@oranode1 backup]$ ls

Target:
[oracle@oraclenode1 backup]$ pwd
/u01/backup
[oracle@oraclenode1 backup]$ ls -ltrh
total 0
[oracle@oraclenode1 backup]$

Source:
[oracle@oranode1 backup]$ ls -ltrh
total 2.5G
-rw-r----- 1 oracle oinstall 441M Feb 18 19:51 Archive_20220218_050m3uhu_1_1
-rw-r----- 1 oracle oinstall 2.1G Feb 18 19:52 Fullback_20220218_060m3ui1_1_1
-rw-r----- 1 oracle oinstall  12K Feb 18 19:52 Archive_20220218_070m3uij_1_1
-rw-r----- 1 oracle oinstall  11M Feb 18 19:52 Controlback_20220218_080m3uik_1_1
-rw-r----- 1 oracle oinstall 112K Feb 18 19:52 spfile_20220218_0a0m417c_1_1
[oracle@oranode1 backup]$ pwd
/u01/backup
[oracle@oranode1 backup]$ scp /u01/backup/* oracle@10.38.4.110:/u01/backup/.
oracle@10.38.4.110's password:
Archive_20220218_050m3uhu_1_1 100%  440MB 110.1MB/s   00:04
Archive_20220218_070m3uij_1_1 100%   12KB   7.7MB/s   00:00
Controlback_20220218_080m3uik_1_1 100%   10MB  89.0MB/s   00:00
Fullback_20220218_060m3ui1_1_1 100% 2079MB 139.7MB/s   00:14
spfile_20220218_0a0m417c_1_1 100%  112KB  32.1MB/s   00:00
[oracle@oranode1 backup]$

Target:
[oracle@oraclenode1 backup]$ ls -ltrh
total 2.5G
-rw-r-----. 1 oracle oinstall 441M Feb 18 19:53 Archive_20220218_050m3uhu_1_1
-rw-r-----. 1 oracle oinstall  12K Feb 18 19:54 Archive_20220218_070m3uij_1_1
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:54 Controlback_20220218_080m3uik_1_1
-rw-r-----. 1 oracle oinstall 2.1G Feb 18 19:54 Fullback_20220218_060m3ui1_1_1
-rw-r-----. 1 oracle oinstall 112K Feb 18 19:54 spfile_20220218_0a0m417c_1_1
[oracle@oraclenode1 backup]$


2. Restore and Recover scenario:
=================================
[oracle@oraclenode1 backup]$ ll
total 2412632
-rw-r-----. 1 oracle oinstall  263259648 Feb 18 02:08 Archive_20220218_050m3uhu_1_1
-rw-r-----. 1 oracle oinstall      67072 Feb 18 02:08 Archive_20220218_070m3uij_1_1
-rw-r-----. 1 oracle oinstall   10682368 Feb 18 02:08 Controlback_20220218_080m3uik_1_1
-rw-r-----. 1 oracle oinstall 2196406272 Feb 18 02:08 Fullback_20220218_060m3ui1_1_1
-rw-r-----. 1 oracle oinstall     114688 Feb 18 02:20 spfile_20220218_0a0m417c_1_1
[oracle@oraclenode1 backup]$ 

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/spfile_20220218_0a0m417c_1_1';
restore controlfile from '/u01/backup/Controlback_20220218_080m3uik_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='+DATA/DEVDB','+DATA/TESTDB'
#*.log_file_name_convert='+DATA/DEVDB','+DATA/TESTDB','+RECO/DEVDB','+RECO/TESTDB'
*.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@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Feb 18 19:15:37 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

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

Total System Global Area  343932624 bytes
Fixed Size                  8896208 bytes
Variable Size             276824064 bytes
Database Buffers           50331648 bytes
Redo Buffers                7880704 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Feb 18 19:16:02 2022
Version 19.3.0.0.0

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

connected to target database: DEVDB (not mounted)

RMAN> restore spfile from '/u01/backup/spfile_20220218_0a0m417c_1_1';

Starting restore at 18-FEB-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=437 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/backup/spfile_20220218_0a0m417c_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 18-FEB-22

RMAN> exit


Recovery Manager complete.
[oracle@oraclenode1 dbs]$ ll
total 20
-rw-rw----. 1 oracle oinstall 1544 Feb 18 19:15 hc_DEVDB.dat
-rw-r--r--. 1 oracle oinstall  586 Feb 18 19:15 initDEVDB.ora
-rw-r--r--. 1 oracle oinstall  591 Feb 18 19:15 initTESTDB.ora
-rw-r-----. 1 oracle oinstall 5632 Feb 18 19:16 spfileDEVDB.ora
[oracle@oraclenode1 dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Feb 18 19:17:03 2022
Version 19.3.0.0.0

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

connected to target database: DEVDB (not mounted)

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

Starting restore at 18-FEB-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=437 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 18-FEB-22

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

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

Starting implicit crosscheck backup at 18-FEB-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=437 device type=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 18-FEB-22

Starting implicit crosscheck copy at 18-FEB-22
using channel ORA_DISK_1
Finished implicit crosscheck copy at 18-FEB-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_20220218_080m3uik_1_1
File Name: /u01/backup/spfile_20220218_0a0m417c_1_1

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_20220218_080m3uik_1_1
File Name: /u01/backup/spfile_20220218_0a0m417c_1_1

RMAN> run {
restore database;
recover database;
}2> 3> 4>

Starting restore at 18-FEB-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 +DATA/DEVDB/DATAFILE/system.267.1095926327
channel ORA_DISK_1: restoring datafile 00003 to +DATA/DEVDB/DATAFILE/sysaux.268.1095926363
channel ORA_DISK_1: restoring datafile 00004 to +DATA/DEVDB/DATAFILE/undotbs1.269.1095926387
channel ORA_DISK_1: restoring datafile 00005 to +DATA/DEVDB/DATAFILE/undotbs2.275.1095926641
channel ORA_DISK_1: restoring datafile 00007 to +DATA/DEVDB/DATAFILE/users.270.1095926389
channel ORA_DISK_1: reading from backup piece /u01/backup/Fullback_20220218_060m3ui1_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Fullback_20220218_060m3ui1_1_1 tag=TAG20220218T013457
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 18-FEB-22

Starting recover at 18-FEB-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=22
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=10
channel ORA_DISK_1: reading from backup piece /u01/backup/Archive_20220218_070m3uij_1_1
channel ORA_DISK_1: piece handle=/u01/backup/Archive_20220218_070m3uij_1_1 tag=TAG20220218T013515
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_02_18/thread_1_seq_22.1199.1097003871 thread=1 sequence=22
archived log file name=+RECO/DEVDB/ARCHIVELOG/2022_02_18/thread_2_seq_10.1132.1097003871 thread=2 sequence=10
channel default: deleting archived log(s)
archived log file name=+RECO/DEVDB/ARCHIVELOG/2022_02_18/thread_1_seq_22.1199.1097003871 RECID=9 STAMP=1097003870
unable to find archived log
archived log thread=1 sequence=23
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/18/2022 19:17:52
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 23 and starting SCN of 3760150

RMAN> alter database open resetlogs;

Statement processed

RMAN> exit


Recovery Manager complete.
[oracle@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Feb 18 19:18:45 2022
Version 19.3.0.0.0

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


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

SQL> select name, open_mode from v$database;

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

SQL>


3. RMAN Clone scenario:
=========================
[oracle@oraclenode1 backup]$ ll
total 2412632
-rw-r-----. 1 oracle oinstall  263259648 Feb 18 02:08 Archive_20220218_050m3uhu_1_1
-rw-r-----. 1 oracle oinstall      67072 Feb 18 02:08 Archive_20220218_070m3uij_1_1
-rw-r-----. 1 oracle oinstall   10682368 Feb 18 02:08 Controlback_20220218_080m3uik_1_1
-rw-r-----. 1 oracle oinstall 2196406272 Feb 18 02:08 Fullback_20220218_060m3ui1_1_1
-rw-r-----. 1 oracle oinstall     114688 Feb 18 02:20 spfile_20220218_0a0m417c_1_1
[oracle@oraclenode1 backup]$ 

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='+DATA/DEVDB','+DATA/TESTDB'
*.log_file_name_convert='+DATA/DEVDB','+DATA/TESTDB','+RECO/DEVDB','+RECO/TESTDB'
*.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@oraclenode1 dbs]$ . oraenv
ORACLE_SID = [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@oraclenode1 dbs]$
[oracle@oraclenode1 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@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Feb 18 19:32:33 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

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

Total System Global Area  343932624 bytes
Fixed Size                  8896208 bytes
Variable Size             276824064 bytes
Database Buffers           50331648 bytes
Redo Buffers                7880704 bytes
SQL> 


[oracle@oraclenode1 dbs]$ rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Feb 18 19:37:14 2022
Version 19.3.0.0.0

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

connected to auxiliary database: TESTDB (not mounted)

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

Starting Duplicate Db at 18-FEB-22
searching for database ID
found backup of database ID 1000656445

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     343932624 bytes

Fixed Size                     8896208 bytes
Variable Size                276824064 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DEVDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/backup/Controlback_20220218_080m3uik_1_1';
   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     343932624 bytes

Fixed Size                     8896208 bytes
Variable Size                276824064 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

Starting restore at 18-FEB-22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=424 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 18-FEB-22

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=424 device type=DISK
RMAN-05529: warning: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set until scn  3760150;
   set newname for datafile  1 to
 "+DATA";
   set newname for datafile  3 to
 "+DATA";
   set newname for datafile  4 to
 "+DATA";
   set newname for datafile  5 to
 "+DATA";
   set newname for datafile  7 to
 "+DATA";
   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

executing command: SET NEWNAME

Starting restore at 18-FEB-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 +DATA
channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00004 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00005 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00007 to +DATA
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Fullback_20220218_060m3ui1_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Fullback_20220218_060m3ui1_1_1 tag=TAG20220218T013457
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 18-FEB-22

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

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=1097005160 file name=+DATA/TESTDB/DATAFILE/system.310.1097005153
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=1097005160 file name=+DATA/TESTDB/DATAFILE/sysaux.340.1097005153
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=1097005160 file name=+DATA/TESTDB/DATAFILE/undotbs1.301.1097005153
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=1097005160 file name=+DATA/TESTDB/DATAFILE/undotbs2.326.1097005153
datafile 7 switched to datafile copy
input datafile copy RECID=10 STAMP=1097005160 file name=+DATA/TESTDB/DATAFILE/users.265.1097005153

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

executing command: SET until clause

Starting recover at 18-FEB-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=22
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=2 sequence=10
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/Archive_20220218_070m3uij_1_1
channel ORA_AUX_DISK_1: piece handle=/u01/backup/Archive_20220218_070m3uij_1_1 tag=TAG20220218T013515
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_02_18/thread_1_seq_22.1138.1097005161 thread=1 sequence=22
archived log file name=+RECO/TESTDB/ARCHIVELOG/2022_02_18/thread_2_seq_10.1304.1097005161 thread=2 sequence=10
channel clone_default: deleting archived log(s)
archived log file name=+RECO/TESTDB/ARCHIVELOG/2022_02_18/thread_1_seq_22.1138.1097005161 RECID=1 STAMP=1097005161
channel clone_default: deleting archived log(s)
archived log file name=+RECO/TESTDB/ARCHIVELOG/2022_02_18/thread_2_seq_10.1304.1097005161 RECID=2 STAMP=1097005161
media recovery complete, elapsed time: 00:00:01
Finished recover at 18-FEB-22
Oracle instance started

Total System Global Area     343932624 bytes

Fixed Size                     8896208 bytes
Variable Size                276824064 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7880704 bytes

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

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

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

Total System Global Area     343932624 bytes

Fixed Size                     8896208 bytes
Variable Size                276824064 bytes
Database Buffers              50331648 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 ( '+RECO', '+DATA' ) SIZE 200 M  REUSE,
  GROUP     2 ( '+RECO', '+DATA' ) SIZE 200 M  REUSE
 DATAFILE
  '+DATA/TESTDB/DATAFILE/system.310.1097005153'
 CHARACTER SET AL32UTF8

sql statement: ALTER DATABASE ADD LOGFILE

  INSTANCE 'i2'
  GROUP     3 ( '+DATA', '+RECO' ) SIZE 200 M  REUSE,
  GROUP     4 ( '+DATA', '+RECO' ) SIZE 200 M  REUSE

contents of Memory Script:
{
   set newname for tempfile  1 to
 "+DATA";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/TESTDB/DATAFILE/sysaux.340.1097005153",
 "+DATA/TESTDB/DATAFILE/undotbs1.301.1097005153",
 "+DATA/TESTDB/DATAFILE/undotbs2.326.1097005153",
 "+DATA/TESTDB/DATAFILE/users.265.1097005153";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/sysaux.340.1097005153 RECID=1 STAMP=1097005196
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/undotbs1.301.1097005153 RECID=2 STAMP=1097005196
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/undotbs2.326.1097005153 RECID=3 STAMP=1097005196
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/DATAFILE/users.265.1097005153 RECID=4 STAMP=1097005196

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1097005196 file name=+DATA/TESTDB/DATAFILE/sysaux.340.1097005153
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1097005196 file name=+DATA/TESTDB/DATAFILE/undotbs1.301.1097005153
datafile 5 switched to datafile copy
input datafile copy RECID=3 STAMP=1097005196 file name=+DATA/TESTDB/DATAFILE/undotbs2.326.1097005153
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1097005196 file name=+DATA/TESTDB/DATAFILE/users.265.1097005153

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

database opened
Cannot remove created server parameter file
Finished Duplicate Db at 18-FEB-22

RMAN>

Recovery Manager complete.
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Feb 18 19:40:12 2022
Version 19.3.0.0.0

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


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

SQL> select name, open_mode from v$database;

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

SQL>


4. Post Restore/Clone Steps:
============================
1. Get a pfiles from source and modify according to target environemtn
2. Start target instance using pfiles

sqlplus / as sysdba
shut immediate

cp initDEVDB.ora initDEVDB.ora_for_clone

vi /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB1.ora

. oraenv
>>> DEVDB1

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

create spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB1.ora';
shut immediate;

cp initDEVDB1.ora initDEVDB1.ora_After_RAC_Parameter_Added

Create local pfile initDEVDB1.ora point to SPFILE '+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora'

Node1>>>
cd $ORACLE_HOME/dbs
cat > initDEVDB1.ora 
spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora'

Node2 >>>
cat > initDEVDB2.ora 
spfile='+DATA/RACSB/PARAMETERFILE/spfileRACSB.ora'

sqlplus / as sysdba
startup mount;
show parameter spfile
shut immediate

Convert DEVDB database to RAC

srvctl add database -d DEVDB -n DEVDB -o '/u01/app/oracle/product/19.0.0.0/dbhome_1' -p '+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora' -t IMMEDIATE -a 'DATA,RECO'

Add the NODE instances
srvctl add instance -d DEVDB -i DEVDB1 -n oraclenode1
srvctl add instance -d DEVDB -i DEVDB2 -n oraclenode2

srvctl config database -d DEVDB
srvctl status database -d DEVDB
srvctl start database -d DEVDB
srvctl status database -d DEVDB
srvctl stop database -d DEVDB

cp initDEVDB1.ora initDEVDB1.ora_Pointing_To_spfile


Post steps logs:
================
DEVDB:
======
[oracle@oraclenode1 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclenode1 dbs]$ . oraenv
ORACLE_SID = [TESTDB] ? 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@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:20:43 2022
Version 19.3.0.0.0

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


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

SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/DEVDB/controlfile/contro
                                                 l01.ctl, +RECO/DEVDB/controlfi
                                                 le/control02.ctl
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ ll
total 21060
-rw-rw----. 1 oracle oinstall     1544 Feb 18 19:18 hc_DEVDB.dat
-rw-rw----. 1 oracle oinstall     1544 Feb 18 19:40 hc_TESTDB.dat
-rw-r--r--. 1 oracle oinstall      581 Feb 18 19:28 initDEVDB.ora
-rw-r--r--. 1 oracle oinstall      584 Feb 18 19:35 initTESTDB.ora
-rw-r-----. 1 oracle oinstall 10600448 Feb 18 19:18 snapcf_DEVDB.f
-rw-r-----. 1 oracle oinstall 10928128 Feb 18 19:40 snapcf_TESTDB.f
-rw-r-----. 1 oracle oinstall     5632 Feb 18 19:16 spfileDEVDB.ora
-rw-r-----. 1 oracle oinstall     8704 Feb 18 22:00 spfileTESTDB.ora
[oracle@oraclenode1 dbs]$ cp initTESTDB.ora initTESTDB.ora_for_clone
[oracle@oraclenode1 dbs]$ cp initDEVDB.ora initDEVDB.ora_for_clone
[oracle@oraclenode1 dbs]$ ls -ltrh
total 21M
-rw-r-----. 1 oracle oinstall 5.5K Feb 18 19:16 spfileDEVDB.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 18 19:18 hc_DEVDB.dat
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:18 snapcf_DEVDB.f
-rw-r--r--. 1 oracle oinstall  581 Feb 18 19:28 initDEVDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 18 19:35 initTESTDB.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 18 19:40 hc_TESTDB.dat
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:40 snapcf_TESTDB.f
-rw-r-----. 1 oracle oinstall 8.5K Feb 18 22:00 spfileTESTDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 19 00:25 initTESTDB.ora_for_clone
-rw-r--r--. 1 oracle oinstall  581 Feb 19 00:25 initDEVDB.ora_for_clone
[oracle@oraclenode1 dbs]$ vi initDEVDB1.ora
[oracle@oraclenode1 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:26:40 2022
Version 19.3.0.0.0

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


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

SQL> shut immediate
Database closed.
Database dismounted.


ORACLE instance shut down.

SQL> SQL> SQL> SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$ . oraenv
ORACLE_SID = [DEVDB] ? DEVDB1
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@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:27:44 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

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

Total System Global Area 3707763120 bytes
Fixed Size                  8903088 bytes
Variable Size             788529152 bytes
Database Buffers         2902458368 bytes
Redo Buffers                7872512 bytes
Database mounted.
SQL> create spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB1.ora';

File created.

SQL> shut immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$ ls -ltrh
total 21M
-rw-r-----. 1 oracle oinstall 5.5K Feb 18 19:16 spfileDEVDB.ora
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:18 snapcf_DEVDB.f
-rw-r--r--. 1 oracle oinstall  581 Feb 18 19:28 initDEVDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 18 19:35 initTESTDB.ora
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:40 snapcf_TESTDB.f
-rw-r-----. 1 oracle oinstall 8.5K Feb 18 22:00 spfileTESTDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 19 00:25 initTESTDB.ora_for_clone
-rw-r--r--. 1 oracle oinstall  581 Feb 19 00:25 initDEVDB.ora_for_clone
-rw-r--r--. 1 oracle oinstall 2.0K Feb 19 00:26 initDEVDB1.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:26 hc_DEVDB.dat
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:28 hc_DEVDB1.dat
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:29 hc_TESTDB.dat
-rw-r--r--. 1 oracle oinstall 2.0K Feb 19 00:30 initTESTDB1.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:31 hc_TESTDB1.dat
[oracle@oraclenode1 dbs]$ cp initDEVDB1.ora initDEVDB1.ora_After_RAC_Parameter_Added
[oracle@oraclenode1 dbs]$ cat > initDEVDB1.ora
spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora'
^C
[oracle@oraclenode1 dbs]$ cat initDEVDB1.ora
spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora'
[oracle@oraclenode1 dbs]$ scp initDEVDB1.ora oraclenode2:/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initDEVDB2.ora
initDEVDB1.ora                                                                                                                                                              100%   51    51.6KB/s   00:00
[oracle@oraclenode1 dbs]$ 

[oracle@oraclenode2 ~]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/
[oracle@oraclenode2 dbs]$ ls -ltrh
total 8.0K
-rw-r--r--. 1 oracle oinstall 3.1K Feb 18 02:09 init.ora
-rw-r--r--. 1 oracle oinstall   51 Feb 19 00:36 initDEVDB2.ora
[oracle@oraclenode2 dbs]$ cat initDEVDB2.ora
spfile='+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora'
[oracle@oraclenode2 dbs]$

[oracle@oraclenode1 dbs]$env |grep ORA
ORACLE_SID=DEVDB1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:37:22 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 3707763120 bytes
Fixed Size                  8903088 bytes
Variable Size             788529152 bytes
Database Buffers         2902458368 bytes
Redo Buffers                7872512 bytes
Database mounted.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/DEVDB/PARAMETERFILE/spfi
                                                 ledevdb.ora
SQL> shut immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$ srvctl add database -d DEVDB -n DEVDB -o '/u01/app/oracle/product/19.0.0.0/dbhome_1' -p '+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora' -t IMMEDIATE -a 'DATA,RECO'
[oracle@oraclenode1 dbs]$ srvctl add instance -d DEVDB -i DEVDB1 -n oraclenode1
[oracle@oraclenode1 dbs]$ srvctl add instance -d DEVDB -i DEVDB2 -n oraclenode2
[oracle@oraclenode1 dbs]$ srvctl config database -d DEVDB
Database unique name: DEVDB
Database name: DEVDB
Oracle home: /u01/app/oracle/product/19.0.0.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,RECO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: oinstall
OSOPER group: oinstall
Database instances: DEVDB1,DEVDB2
Configured nodes: oraclenode1,oraclenode2
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
[oracle@oraclenode1 dbs]$ srvctl status database -d DEVDB
Instance DEVDB1 is not running on node oraclenode1
Instance DEVDB2 is not running on node oraclenode2
[oracle@oraclenode1 dbs]$ srvctl start database -d DEVDB
[oracle@oraclenode1 dbs]$ srvctl status database -d DEVDB
Instance DEVDB1 is running on node oraclenode1
Instance DEVDB2 is running on node oraclenode2
[oracle@oraclenode1 dbs]$ cp initDEVDB1.ora initDEVDB1.ora_Pointing_To_spfile

[oracle@oraclenode2 dbs]$ cp initDEVDB2.ora initDEVDB2.ora_Pointing_To_spfile

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

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:29:19 2022
Version 19.3.0.0.0

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


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

SQL> shut immediate;
Database closed.
Database dismounted.

ORACLE instance shut down.
SQL> SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ vi initTESTDB1.ora
[oracle@oraclenode1 dbs]$ . oraenv
ORACLE_SID = [TESTDB] ? TESTDB1
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@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:30:56 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

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

Total System Global Area 3707763120 bytes
Fixed Size                  8903088 bytes
Variable Size             788529152 bytes
Database Buffers         2902458368 bytes
Redo Buffers                7872512 bytes
Database mounted.
SQL> create spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB1.ora';

File created.

SQL> shut immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$ ls -ltrh
total 21M
-rw-r-----. 1 oracle oinstall 5.5K Feb 18 19:16 spfileDEVDB.ora
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:18 snapcf_DEVDB.f
-rw-r--r--. 1 oracle oinstall  581 Feb 18 19:28 initDEVDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 18 19:35 initTESTDB.ora
-rw-r-----. 1 oracle oinstall  11M Feb 18 19:40 snapcf_TESTDB.f
-rw-r-----. 1 oracle oinstall 8.5K Feb 18 22:00 spfileTESTDB.ora
-rw-r--r--. 1 oracle oinstall  584 Feb 19 00:25 initTESTDB.ora_for_clone
-rw-r--r--. 1 oracle oinstall  581 Feb 19 00:25 initDEVDB.ora_for_clone
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:26 hc_DEVDB.dat
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:29 hc_TESTDB.dat
-rw-r--r--. 1 oracle oinstall 2.0K Feb 19 00:30 initTESTDB1.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:31 hc_TESTDB1.dat
-rw-r--r--. 1 oracle oinstall 2.0K Feb 19 00:35 initDEVDB1.ora_After_RAC_Parameter_Added
-rw-r--r--. 1 oracle oinstall   51 Feb 19 00:36 initDEVDB1.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:40 hc_DEVDB1.dat
-rw-r--r--. 1 oracle oinstall   51 Feb 19 00:41 initDEVDB1.ora_Pointing_To_spfile
[oracle@oraclenode1 dbs]$ cp initTESTDB1.ora initTESTDB1.ora_After_RAC_Parameter_Added
[oracle@oraclenode1 dbs]$ cat > initTESTDB1.ora
spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora'
^C
[oracle@oraclenode1 dbs]$ cat initTESTDB1.ora
spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora'
[oracle@oraclenode1 dbs]$ scp initTESTDB1.ora oraclenode2:/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB2.ora
initTESTDB1.ora                                                                                                                                                             100%   53    37.7KB/s   00:00
[oracle@oraclenode1 dbs]$ 

[oracle@oraclenode2 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclenode2 dbs]$ ls -ltrh
total 16K
-rw-r--r--. 1 oracle oinstall 3.1K Feb 18 02:09 init.ora
-rw-r--r--. 1 oracle oinstall   51 Feb 19 00:36 initDEVDB2.ora
-rw-rw----. 1 oracle oinstall 1.6K Feb 19 00:40 hc_DEVDB2.dat
-rw-r--r--. 1 oracle oinstall   53 Feb 19 00:44 initTESTDB2.ora
[oracle@oraclenode2 dbs]$ 

[oracle@oraclenode1 dbs]$env |grep ORA
ORACLE_SID=TESTDB1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclenode1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 19 00:45:14 2022
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 3707763120 bytes
Fixed Size                  8903088 bytes
Variable Size             788529152 bytes
Database Buffers         2902458368 bytes
Redo Buffers                7872512 bytes
Database mounted.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/TESTDB/PARAMETERFILE/spf
                                                 iletestdb.ora
SQL> shut immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ srvctl add database -d TESTDB -n TESTDB -o '/u01/app/oracle/product/19.0.0.0/dbhome_1' -p '+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' -t IMMEDIATE -a 'DATA,RECO'
[oracle@oraclenode1 dbs]$ srvctl add instance -d TESTDB -i TESTDB1 -n oraclenode1
[oracle@oraclenode1 dbs]$ srvctl add instance -d TESTDB -i TESTDB2 -n oraclenode2
[oracle@oraclenode1 dbs]$ srvctl config database -d TESTDB
Database unique name: TESTDB
Database name: TESTDB
Oracle home: /u01/app/oracle/product/19.0.0.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,RECO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: oinstall
OSOPER group: oinstall
Database instances: TESTDB1,TESTDB2
Configured nodes: oraclenode1,oraclenode2
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
[oracle@oraclenode1 dbs]$ srvctl status database -d TESTDB
Instance TESTDB1 is not running on node oraclenode1
Instance TESTDB2 is not running on node oraclenode2
[oracle@oraclenode1 dbs]$ srvctl start database -d TESTDB
[oracle@oraclenode1 dbs]$ srvctl status database -d TESTDB
Instance TESTDB1 is running on node oraclenode1
Instance TESTDB2 is running on node oraclenode2
[oracle@oraclenode1 dbs]$
[oracle@oraclenode1 dbs]$ cp initTESTDB1.ora initTESTDB1.ora_Pointing_To_spfile

[oracle@oraclenode2 dbs]$ cp initTESTDB2.ora initTESTDB2.ora_Pointing_To_spfile


Source DB pfile:
================
DEVDB1.__data_transfer_cache_size=0
DEVDB2.__data_transfer_cache_size=0
DEVDB1.__db_cache_size=2768240640
DEVDB2.__db_cache_size=2768240640
DEVDB1.__inmemory_ext_roarea=0
DEVDB2.__inmemory_ext_roarea=0
DEVDB1.__inmemory_ext_rwarea=0
DEVDB2.__inmemory_ext_rwarea=0
DEVDB1.__java_pool_size=0
DEVDB2.__java_pool_size=0
DEVDB1.__large_pool_size=16777216
DEVDB2.__large_pool_size=16777216
DEVDB1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
DEVDB2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
DEVDB1.__pga_aggregate_target=1241513984
DEVDB2.__pga_aggregate_target=1241513984
DEVDB1.__sga_target=3707764736
DEVDB2.__sga_target=3707764736
DEVDB1.__shared_io_pool_size=134217728
DEVDB2.__shared_io_pool_size=134217728
DEVDB1.__shared_pool_size=771751936
DEVDB2.__shared_pool_size=771751936
DEVDB1.__streams_pool_size=0
DEVDB2.__streams_pool_size=0
DEVDB1.__unified_pga_pool_size=0
DEVDB2.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/DEVDB/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='19.0.0'
*.control_files='+DATA/DEVDB/CONTROLFILE/current.271.1095926461','+RECO/DEVDB/CONTROLFILE/current.256.1095926461'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_name='DEVDB'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=8931m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DEVDBXDB)'
family:dw_helper.instance_mode='read-only'
DEVDB1.instance_number=1
DEVDB2.instance_number=2
*.local_listener='-oraagent-dummy-'
DEVDB1.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oranode1-vip.localdomain.com)(PORT=1522))))'
DEVDB2.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oranode2-vip.localdomain.com)(PORT=1522))))'
*.open_cursors=300
*.pga_aggregate_target=1174m
*.processes=300
*.remote_login_passwordfile='exclusive'
*.service_names='DEVDB,MALLIK'
*.sga_target=3522m
DEVDB2.thread=2
DEVDB1.thread=1
DEVDB2.undo_tablespace='UNDOTBS2'
DEVDB1.undo_tablespace='UNDOTBS1'

Target DEVDB pfile after adding RAC Instance:
=============================================
DEVDB1.__data_transfer_cache_size=0
DEVDB2.__data_transfer_cache_size=0
DEVDB1.__db_cache_size=2768240640
DEVDB2.__db_cache_size=2768240640
DEVDB1.__inmemory_ext_roarea=0
DEVDB2.__inmemory_ext_roarea=0
DEVDB1.__inmemory_ext_rwarea=0
DEVDB2.__inmemory_ext_rwarea=0
DEVDB1.__java_pool_size=0
DEVDB2.__java_pool_size=0
DEVDB1.__large_pool_size=16777216
DEVDB2.__large_pool_size=16777216
DEVDB1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
DEVDB2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
DEVDB1.__pga_aggregate_target=1241513984
DEVDB2.__pga_aggregate_target=1241513984
DEVDB1.__sga_target=3707764736
DEVDB2.__sga_target=3707764736
DEVDB1.__shared_io_pool_size=134217728
DEVDB2.__shared_io_pool_size=134217728
DEVDB1.__shared_pool_size=771751936
DEVDB2.__shared_pool_size=771751936
DEVDB1.__streams_pool_size=0
DEVDB2.__streams_pool_size=0
DEVDB1.__unified_pga_pool_size=0
DEVDB2.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/DEVDB/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='19.0.0'
*.control_files='+DATA/DEVDB/controlfile/control01.ctl','+RECO/DEVDB/controlfile/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_name='DEVDB'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=8931m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DEVDBXDB)'
family:dw_helper.instance_mode='read-only'
DEVDB1.instance_number=1
DEVDB2.instance_number=2
DEVDB1.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode1-vip.localdomain.com)(PORT=1522))))'
DEVDB2.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode1-vip.localdomain.com)(PORT=1522))))'
*.open_cursors=300
*.pga_aggregate_target=1174m
*.processes=300
*.remote_login_passwordfile='exclusive'
*.service_names='DEVDB'
*.sga_target=3522m
DEVDB2.thread=2
DEVDB1.thread=1
DEVDB2.undo_tablespace='UNDOTBS2'
DEVDB1.undo_tablespace='UNDOTBS1'


Target TESTDB pfile after adding RAC Instance:
==============================================
TESTDB1.__data_transfer_cache_size=0
TESTDB2.__data_transfer_cache_size=0
TESTDB1.__db_cache_size=2768240640
TESTDB2.__db_cache_size=2768240640
TESTDB1.__inmemory_ext_roarea=0
TESTDB2.__inmemory_ext_roarea=0
TESTDB1.__inmemory_ext_rwarea=0
TESTDB2.__inmemory_ext_rwarea=0
TESTDB1.__java_pool_size=0
TESTDB2.__java_pool_size=0
TESTDB1.__large_pool_size=16777216
TESTDB2.__large_pool_size=16777216
TESTDB1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
TESTDB2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
TESTDB1.__pga_aggregate_target=1241513984
TESTDB2.__pga_aggregate_target=1241513984
TESTDB1.__sga_target=3707764736
TESTDB2.__sga_target=3707764736
TESTDB1.__shared_io_pool_size=134217728
TESTDB2.__shared_io_pool_size=134217728
TESTDB1.__shared_pool_size=771751936
TESTDB2.__shared_pool_size=771751936
TESTDB1.__streams_pool_size=0
TESTDB2.__streams_pool_size=0
TESTDB1.__unified_pga_pool_size=0
TESTDB2.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='19.0.0'
*.control_files='+DATA/TESTDB/controlfile/control01.ctl','+RECO/TESTDB/controlfile/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_name='TESTDB'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=8931m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DEVDBXDB)'
family:dw_helper.instance_mode='read-only'
TESTDB1.instance_number=1
TESTDB2.instance_number=2
TESTDB1.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode1-vip.localdomain.com)(PORT=1522))))'
TESTDB2.local_listener='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode1-vip.localdomain.com)(PORT=1522))))'
*.open_cursors=300
*.pga_aggregate_target=1174m
*.processes=300
*.remote_login_passwordfile='exclusive'
*.service_names='TESTDB'
*.sga_target=3522m
TESTDB2.thread=2
TESTDB1.thread=1
TESTDB2.undo_tablespace='UNDOTBS2'
TESTDB1.undo_tablespace='UNDOTBS1'

Regards,
Mallik

No comments:

Post a Comment

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