Oracle 19c - Backup based RMAN Duplication without connecting Target Database - Demo!
Oracle 19c - Perform Backup Based RMAN DUPLICATE Without Connecting To Target Database:
If you are performing a backup based RMAN duplicate and using with or without recovery catalog as well, it is not required to connect to the source database as TARGET in RMAN.
This technique is advantageous where network connections from the auxiliary host to the source database are restricted or prone to intermittent disruptions. In duplication without a TARGET connection, the source database is unaffected by the duplication
For this RMAN duplication, we will connect RMAN to the auxiliary instance using RMAN backup or recovery catalog database and run duplicate command similar duplication or cloning.
Here we have to make sure we can only use SET UNTIL TIME clause for RMAN backup based duplication.
We can use this technique for both disk as well as tape (SBT) backups.
Usage of recovery catalog is mandatory for tape and disk based backup. However if you do not have a recovery catalog; you can still perform RMAN DUPLICATE without connecting to the target database but ONLY for disk backups. This can be achieved via BACKUP LOCATION clause of DUPLICATE command.
Here in these scenarios I am demonstrating BACKUP LOCATION clause of DUPLICATE without using recovery catalog.
Lab Setup:
Source DB: SRLAB
Source Server: srlab79
Auxiliary Database: srlabdup
Destination Server : srlab75
Step1: On Source database I am taking RMAN Backup.
RMAN> backup incremental level 0 tag 'L0-MAR2022' database plus archivelog TAG 'L0-ARCH-MAR2022';
Step 2: Copy the Backup to destination srlab75 server
Step 3: Create Pfile and password file on srlab75 server
Step 4: Startup database using this parameter file
Step 5: Create TNS and Listener Entry on target server srlab75 and start it.
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=srlabdup)
(SID_NAME=srlabdup)
(ORACLE_HOME=/u01/app/oracle/product/19.0.0.0)
)
)
SRLABDUP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = srlabdup)
)
)
Step 6: Connect auxiliary database in target server srlab75 and start the duplication:
RMAN> connect auxiliary sys/oracle@srlabdup;
RMAN> DUPLICATE DATABASE TO SRLABDUP BACKUP LOCATION '/u02/backup' nofilenamecheck until time "TO_DATE('19-MAR-2022 16:00:00','DD-MON-YYYY HH24:MI:SS')";
Step 7: Validate the database after successful duplication.
RMAN Session Source and Target session logs:
Source DB session:
[oracle@srlab79 backup]$ ps -ef |grep pmon
oracle 5397 1 0 11:36 ? 00:00:03 ora_pmon_srlab
oracle 21676 5187 0 15:56 pts/1 00:00:00 grep --color=auto pmon
[oracle@srlab79 backup]$ ps -ef |grep tns
root 22 2 0 11:00 ? 00:00:00 [netns]
oracle 7212 1 0 11:59 ? 00:00:01 /u01/app/oracle/product/19.0.0.0/bin/tnslsnr SRLAB_LISTENER -inherit
oracle 21681 5187 0 15:56 pts/1 00:00:00 grep --color=auto tns
[oracle@srlab79 backup]$ hostname
srlab79.localdomain
[oracle@srlab79 backup]$
[oracle@srlab79 backup]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 15:56:48 2022
Version 19.12.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.12.0.0.0
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SRLAB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRLABPLUG READ WRITE NO
SQL>
SQL> set lines 200 pages 2000
SQL>
SQL> col name for a74
SQL>
SQL> select * from v$dbfile;
FILE# NAME CON_ID
---------- -------------------------------------------------------------------------- ----------
7 /u02/oradata/SRLAB/users01.dbf 1
4 /u02/oradata/SRLAB/undotbs01.dbf 1
1 /u02/oradata/SRLAB/system01.dbf 1
3 /u02/oradata/SRLAB/sysaux01.dbf 1
5 /u02/oradata/SRLAB/pdbseed/system01.dbf 2
6 /u02/oradata/SRLAB/pdbseed/sysaux01.dbf 2
8 /u02/oradata/SRLAB/pdbseed/undotbs01.dbf 2
9 /u02/oradata/SRLAB/srlabplug/system01.dbf 3
10 /u02/oradata/SRLAB/srlabplug/sysaux01.dbf 3
11 /u02/oradata/SRLAB/srlabplug/undotbs01.dbf 3
12 /u02/oradata/SRLAB/srlabplug/users01.dbf 3
11 rows selected.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------
/u02/oradata/SRLAB/temp01.dbf
/u02/oradata/SRLAB/pdbseed/temp012022-01-30_22-31-19-927-PM.dbf
/u02/oradata/SRLAB/srlabplug/temp01.dbf
SQL>
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cdb_cluster_name string
cell_offloadgroup_name string
db_file_name_convert string
db_name string srlab
db_unique_name string srlab
global_names boolean FALSE
instance_name string srlab
lock_name_space string
log_file_name_convert string
pdb_file_name_convert string
processor_group_name string
service_names string srlab
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlab79 backup]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Sat Mar 19 15:57:54 2022
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: SRLAB (DBID=31541674)
RMAN> list backup;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 247.41M DISK 00:04:25 03-FEB-22
BP Key: 4 Status: AVAILABLE Compressed: YES Tag: TAG20220203T080115
Piece Name: /u02/backup/srlab_040kt3vh_4_1_1
List of Datafiles in backup set 4
Container ID: 2, PDB Name: PDB$SEED
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
5 Full 2998739 31-JAN-22 NO /u02/oradata/SRLAB/pdbseed/system01.dbf
6 Full 2998739 31-JAN-22 NO /u02/oradata/SRLAB/pdbseed/sysaux01.dbf
8 Full 2998739 31-JAN-22 NO /u02/oradata/SRLAB/pdbseed/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Full 443.50M DISK 00:09:09 12-FEB-22
BP Key: 9 Status: AVAILABLE Compressed: YES Tag: TAG20220212T155658
Piece Name: /u02/backup/srlab_090llmqg_9_1_1
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 3147395 12-FEB-22 NO /u02/oradata/SRLAB/system01.dbf
3 Full 3147395 12-FEB-22 NO /u02/oradata/SRLAB/sysaux01.dbf
4 Full 3147395 12-FEB-22 NO /u02/oradata/SRLAB/undotbs01.dbf
7 Full 3147395 12-FEB-22 NO /u02/oradata/SRLAB/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Full 179.16M DISK 00:05:00 12-FEB-22
BP Key: 10 Status: AVAILABLE Compressed: YES Tag: TAG20220212T155658
Piece Name: /u02/backup/srlab_0a0llnbs_10_1_1
List of Datafiles in backup set 10
Container ID: 3, PDB Name: SRLABPLUG
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
9 Full 3147837 12-FEB-22 NO /u02/oradata/SRLAB/srlabplug/system01.dbf
10 Full 3147837 12-FEB-22 NO /u02/oradata/SRLAB/srlabplug/sysaux01.dbf
11 Full 3147837 12-FEB-22 NO /u02/oradata/SRLAB/srlabplug/undotbs01.dbf
12 Full 3147837 12-FEB-22 NO /u02/oradata/SRLAB/srlabplug/users01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
11 180.00K DISK 00:00:00 12-FEB-22
BP Key: 11 Status: AVAILABLE Compressed: YES Tag: TAG20220212T161134
Piece Name: /u02/backup/srlab_0b0llnln_11_1_1
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 28 3147332 12-FEB-22 3147998 12-FEB-22
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Full 1.05M DISK 00:00:01 12-FEB-22
BP Key: 12 Status: AVAILABLE Compressed: YES Tag: TAG20220212T161144
Piece Name: /u02/backup/c-31541674-20220212-00
SPFILE Included: Modification time: 02-FEB-22
SPFILE db_unique_name: SRLAB
Control File Included: Ckp SCN: 3148035 Ckp time: 12-FEB-22
RMAN>
RMAN> backup incremental level 0 tag '19-2022' database plus archivelog tag '19-2022';
Starting backup at 19-MAR-22
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=237 device type=DISK
skipping archived log of thread 1 with sequence 28; already backed up
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=24 STAMP=1097477585
input archived log thread=1 sequence=30 RECID=25 STAMP=1097649105
input archived log thread=1 sequence=31 RECID=26 STAMP=1099740994
input archived log thread=1 sequence=32 RECID=27 STAMP=1099755955
input archived log thread=1 sequence=33 RECID=28 STAMP=1099756739
channel ORA_DISK_1: starting piece 1 at 19-MAR-22
channel ORA_DISK_1: finished piece 1 at 19-MAR-22
piece handle=/u02/backup/srlab_0d0opt66_13_1_1 tag=19-2022 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
Finished backup at 19-MAR-22
Starting backup at 19-MAR-22
using channel ORA_DISK_1
skipping datafile 5; already backed up 1 time(s)
skipping datafile 6; already backed up 1 time(s)
skipping datafile 8; already backed up 1 time(s)
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/SRLAB/system01.dbf
input datafile file number=00003 name=/u02/oradata/SRLAB/sysaux01.dbf
input datafile file number=00004 name=/u02/oradata/SRLAB/undotbs01.dbf
input datafile file number=00007 name=/u02/oradata/SRLAB/users01.dbf
channel ORA_DISK_1: starting piece 1 at 19-MAR-22
channel ORA_DISK_1: finished piece 1 at 19-MAR-22
piece handle=/u02/backup/srlab_0e0opt8j_14_1_1 tag=19-2022 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:07:55
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/u02/oradata/SRLAB/srlabplug/sysaux01.dbf
input datafile file number=00009 name=/u02/oradata/SRLAB/srlabplug/system01.dbf
input datafile file number=00011 name=/u02/oradata/SRLAB/srlabplug/undotbs01.dbf
input datafile file number=00012 name=/u02/oradata/SRLAB/srlabplug/users01.dbf
channel ORA_DISK_1: starting piece 1 at 19-MAR-22
channel ORA_DISK_1: finished piece 1 at 19-MAR-22
piece handle=/u02/backup/srlab_0f0optnf_15_1_1 tag=19-2022 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:45
Finished backup at 19-MAR-22
Starting backup at 19-MAR-22
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=34 RECID=29 STAMP=1099757520
channel ORA_DISK_1: starting piece 1 at 19-MAR-22
channel ORA_DISK_1: finished piece 1 at 19-MAR-22
piece handle=/u02/backup/srlab_0g0optuh_16_1_1 tag=19-2022 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-MAR-22
Starting Control File and SPFILE Autobackup at 19-MAR-22
piece handle=/u02/backup/c-31541674-20220319-00 comment=NONE
Finished Control File and SPFILE Autobackup at 19-MAR-22
RMAN> exit
Recovery Manager complete.
[oracle@srlab79 backup]$ ls -lrt
total 1651668
-rw-r-----. 1 oracle oinstall 259440640 Feb 3 08:12 srlab_040kt3vh_4_1_1
-rw-r-----. 1 oracle oinstall 465051648 Feb 12 16:06 srlab_090llmqg_9_1_1
-rw-r-----. 1 oracle oinstall 187867136 Feb 12 16:11 srlab_0a0llnbs_10_1_1
-rw-r-----. 1 oracle oinstall 184832 Feb 12 16:11 srlab_0b0llnln_11_1_1
-rw-r-----. 1 oracle oinstall 1114112 Feb 12 16:11 c-31541674-20220212-00
-rw-r-----. 1 oracle oinstall 111656960 Mar 19 16:00 srlab_0d0opt66_13_1_1
-rw-r-----. 1 oracle oinstall 471482368 Mar 19 16:08 srlab_0e0opt8j_14_1_1
-rw-r-----. 1 oracle oinstall 193191936 Mar 19 16:11 srlab_0f0optnf_15_1_1
-rw-r-----. 1 oracle oinstall 184832 Mar 19 16:12 srlab_0g0optuh_16_1_1
-rw-r-----. 1 oracle oinstall 1114112 Mar 19 16:12 c-31541674-20220319-00
[oracle@srlab79 backup]$
[oracle@srlab79 backup]$ pwd
/u02/backup
[oracle@srlab79 backup]$ scp * 192.168.56.101:/u02/backup
oracle@192.168.56.101's password:
c-31541674-20220212-00 100% 1088KB 11.3MB/s 00:00
c-31541674-20220319-00 100% 1088KB 12.9MB/s 00:00
srlab_040kt3vh_4_1_1 100% 247MB 12.7MB/s 00:19
srlab_090llmqg_9_1_1 100% 444MB 17.5MB/s 00:25
srlab_0a0llnbs_10_1_1 100% 179MB 6.0MB/s 00:29
srlab_0b0llnln_11_1_1 100% 181KB 8.5MB/s 00:00
srlab_0d0opt66_13_1_1 100% 106MB 16.1MB/s 00:06
srlab_0e0opt8j_14_1_1 100% 450MB 13.6MB/s 00:33
srlab_0f0optnf_15_1_1 100% 184MB 6.7MB/s 00:27
srlab_0g0optuh_16_1_1 100% 181KB 5.3MB/s 00:00
[oracle@srlab79 backup]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 16:16:00 2022
Version 19.12.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.12.0.0.0
SQL> create pfile from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlab79 backup]$ cd $ORACLE_HOME/dbs
[oracle@srlab79 dbs]$ ls -lrt
total 18312
-rwxr-xr-x. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 24 Jan 30 21:56 lkSRLAB
-rw-r-----. 1 oracle oinstall 2048 Jan 30 22:04 orapwsrlab
-rw-r-----. 1 oracle oinstall 3584 Mar 19 11:36 spfilesrlab.ora
-rw-rw----. 1 oracle oinstall 1544 Mar 19 11:36 hc_srlab.dat
-rw-r-----. 1 oracle oinstall 18726912 Mar 19 16:12 snapcf_srlab.f
-rw-r--r--. 1 oracle oinstall 1164 Mar 19 16:16 initsrlab.ora
[oracle@srlab79 dbs]$ scp orapwsrlab initsrlab.ora 192.168.56.101:/u01/app/oracle/product/19.0.0.0/dbs
oracle@192.168.56.101's password:
orapwsrlab 100% 2048 100.9KB/s 00:00
initsrlab.ora 100% 1164 624.9KB/s 00:00
[oracle@srlab79 dbs]$
[oracle@srlab79 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 16:20:16 2022
Version 19.12.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.12.0.0.0
SQL> show parameter audit
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/srlab/ad
ump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string DB
unified_audit_common_systemlog string
unified_audit_sga_queue_size integer 1048576
unified_audit_systemlog string
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlab79 admin]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 16:44:15 2022
Version 19.12.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.12.0.0.0
SQL> alter user sys identified by ora12345;
User altered.
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlab79 admin]$ cd ..
[oracle@srlab79 network]$ cd ..
[oracle@srlab79 19.0.0.0]$ cd dbs
[oracle@srlab79 dbs]$ ls -lrt
total 18312
-rwxr-xr-x. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 24 Jan 30 21:56 lkSRLAB
-rw-r-----. 1 oracle oinstall 3584 Mar 19 11:36 spfilesrlab.ora
-rw-rw----. 1 oracle oinstall 1544 Mar 19 11:36 hc_srlab.dat
-rw-r-----. 1 oracle oinstall 18726912 Mar 19 16:12 snapcf_srlab.f
-rw-r--r--. 1 oracle oinstall 1164 Mar 19 16:16 initsrlab.ora
-rw-r-----. 1 oracle oinstall 2048 Mar 19 16:44 orapwsrlab
[oracle@srlab79 dbs]$ scp orapwsrlab 192.168.56.101:/u01/app/oracle/product/19.0.0.0/dbs/orapwsrlabdup
oracle@192.168.56.101's password:
orapwsrlab 100% 2048 525.0KB/s 00:00
[oracle@srlab79 dbs]$
[oracle@srlab79 dbs]$
login as: oracle
oracle@192.168.56.101's password:
Last login: Sat Mar 19 13:07:53 2022 from gateway
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$ . oraenv
ORACLE_SID = [oracle] ? srlabdup
The Oracle base has been set to /u01/app/oracle
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$ cd $ORACLE_HOME/dbs
[oracle@srlab75 dbs]$ ls -lrt
total 12
-rw-r--r--. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 2048 Mar 19 16:17 orapwsrlabdup
-rw-r--r--. 1 oracle oinstall 1164 Mar 19 16:17 initsrlabdup.ora
[oracle@srlab75 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 16:26:30 2022
Version 19.8.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/dbs/initsrlabdup.ora';
ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory
SQL> exit
Disconnected
[oracle@srlab75 dbs]$
[oracle@srlab75 dbs]$ ps -ef |grep pmon
oracle 29634 29434 0 16:28 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlab75 dbs]$
[oracle@srlab75 dbs]$ vi initsrlabdup.ora
[oracle@srlab75 dbs]$
[oracle@srlab75 dbs]$
[oracle@srlab75 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 16:29:54 2022
Version 19.8.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/dbs/initsrlabdup.ora';
ORACLE instance started.
Total System Global Area 1560278096 bytes
Fixed Size 9135184 bytes
Variable Size 905969664 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.8.0.0.0
[oracle@srlab75 dbs]$ ps -ef |grep pmon
oracle 29791 1 0 16:30 ? 00:00:00 ora_pmon_srlabdup
oracle 29916 29434 0 16:31 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlab75 dbs]$
[oracle@srlab75 dbs]$ rman
Recovery Manager: Release 19.0.0.0.0 - Production on Sat Mar 19 16:31:25 2022
Version 19.8.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
RMAN> connect auxiliary sys/dba12345@srlabdup;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-04006: error from auxiliary database: ORA-12541: TNS:no listener
RMAN> exit
Recovery Manager complete.
[oracle@srlab75 dbs]$ ps -ef |grep pmon
oracle 29791 1 0 16:30 ? 00:00:00 ora_pmon_srlabdup
oracle 30874 29434 0 16:46 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlab75 dbs]$ rman
Recovery Manager: Release 19.0.0.0.0 - Production on Sat Mar 19 16:46:07 2022
Version 19.8.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
RMAN> connect auxiliary sys/ora12345@srlabdup;
connected to auxiliary database: SRLAB (not mounted)
RMAN> DUPLICATE DATABASE TO SRLABDUP BACKUP LOCATION '/u02/backup' nofilenamecheck until time "TO_DATE('19-MAR-2022 16:00:00','DD-MON-YYYY HH24:MI:SS')";
Starting Duplicate Db at 19-MAR-22
searching for database ID
found backup of database ID 31541674
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 1560278096 bytes
Fixed Size 9135184 bytes
Variable Size 905969664 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''SRLAB'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from '/u02/backup/c-31541674-20220212-00';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''SRLAB'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1560278096 bytes
Fixed Size 9135184 bytes
Variable Size 905969664 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
Starting restore at 19-MAR-22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 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=/u02/oradata/SRLAB/control01.ctl
output file name=/u02/fra/SRLAB/control02.ctl
Finished restore at 19-MAR-22
database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
duplicating Online logs to Oracle Managed File (OMF) location
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/pdbseed/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/pdbseed/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/pdbseed/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/srlabplug/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/srlabplug/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/srlabplug/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRLAB/srlabplug/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRLAB/temp01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRLAB/pdbseed/temp012022-01-30_22-31-19-927-PM.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRLAB/srlabplug/temp01.dbf conflicts with a file used by the target database
contents of Memory Script:
{
set until scn 3148035;
set newname for datafile 1 to
"/u02/oradata/SRLAB/system01.dbf";
set newname for datafile 3 to
"/u02/oradata/SRLAB/sysaux01.dbf";
set newname for datafile 4 to
"/u02/oradata/SRLAB/undotbs01.dbf";
set newname for datafile 5 to
"/u02/oradata/SRLAB/pdbseed/system01.dbf";
set newname for datafile 6 to
"/u02/oradata/SRLAB/pdbseed/sysaux01.dbf";
set newname for datafile 7 to
"/u02/oradata/SRLAB/users01.dbf";
set newname for datafile 8 to
"/u02/oradata/SRLAB/pdbseed/undotbs01.dbf";
set newname for datafile 9 to
"/u02/oradata/SRLAB/srlabplug/system01.dbf";
set newname for datafile 10 to
"/u02/oradata/SRLAB/srlabplug/sysaux01.dbf";
set newname for datafile 11 to
"/u02/oradata/SRLAB/srlabplug/undotbs01.dbf";
set newname for datafile 12 to
"/u02/oradata/SRLAB/srlabplug/users01.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
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 19-MAR-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 /u02/oradata/SRLAB/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u02/oradata/SRLAB/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u02/oradata/SRLAB/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u02/oradata/SRLAB/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_090llmqg_9_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_090llmqg_9_1_1 tag=TAG20220212T155658
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:04:24
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 00005 to /u02/oradata/SRLAB/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u02/oradata/SRLAB/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u02/oradata/SRLAB/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_040kt3vh_4_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_040kt3vh_4_1_1 tag=TAG20220203T080115
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:35
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 00009 to /u02/oradata/SRLAB/srlabplug/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u02/oradata/SRLAB/srlabplug/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u02/oradata/SRLAB/srlabplug/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u02/oradata/SRLAB/srlabplug/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_0a0llnbs_10_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_0a0llnbs_10_1_1 tag=TAG20220212T155658
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:21
Finished restore at 19-MAR-22
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1099760281 file name=/u02/oradata/SRLAB/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1099760281 file name=/u02/oradata/SRLAB/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1099760281 file name=/u02/oradata/SRLAB/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=1099760281 file name=/u02/oradata/SRLAB/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=1099760281 file name=/u02/oradata/SRLAB/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=1099760281 file name=/u02/oradata/SRLAB/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=1099760281 file name=/u02/oradata/SRLAB/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=1099760281 file name=/u02/oradata/SRLAB/srlabplug/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=1099760281 file name=/u02/oradata/SRLAB/srlabplug/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=1099760281 file name=/u02/oradata/SRLAB/srlabplug/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=11 STAMP=1099760281 file name=/u02/oradata/SRLAB/srlabplug/users01.dbf
contents of Memory Script:
{
set until time "to_date('MAR 19 2022 16:00:00', 'MON DD YYYY HH24:MI:SS')";
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 19-MAR-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=28
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_0b0llnln_11_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_0b0llnln_11_1_1 tag=TAG20220212T161134
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=/u02/archive/1_28_1095372208.dbf thread=1 sequence=28
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_28_1095372208.dbf RECID=1 STAMP=1099760285
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=29
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=30
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=31
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=32
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=33
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_0d0opt66_13_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_0d0opt66_13_1_1 tag=19-2022
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:26
archived log file name=/u02/archive/1_29_1095372208.dbf thread=1 sequence=29
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_29_1095372208.dbf RECID=5 STAMP=1099760355
archived log file name=/u02/archive/1_30_1095372208.dbf thread=1 sequence=30
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_30_1095372208.dbf RECID=6 STAMP=1099760368
archived log file name=/u02/archive/1_31_1095372208.dbf thread=1 sequence=31
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_31_1095372208.dbf RECID=3 STAMP=1099760294
archived log file name=/u02/archive/1_32_1095372208.dbf thread=1 sequence=32
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_32_1095372208.dbf RECID=4 STAMP=1099760333
archived log file name=/u02/archive/1_33_1095372208.dbf thread=1 sequence=33
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_33_1095372208.dbf RECID=2 STAMP=1099760288
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=34
channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/srlab_0g0optuh_16_1_1
channel ORA_AUX_DISK_1: piece handle=/u02/backup/srlab_0g0optuh_16_1_1 tag=19-2022
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=/u02/archive/1_34_1095372208.dbf thread=1 sequence=34
channel clone_default: deleting archived log(s)
archived log file name=/u02/archive/1_34_1095372208.dbf RECID=7 STAMP=1099760472
media recovery complete, elapsed time: 00:00:01
Finished recover at 19-MAR-22
Oracle instance started
Total System Global Area 1560278096 bytes
Fixed Size 9135184 bytes
Variable Size 905969664 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''SRLABDUP'' comment=
''Reset to original value by RMAN'' scope=spfile";
}
executing Memory Script
sql statement: alter system set db_name = ''SRLABDUP'' comment= ''Reset to original value by RMAN'' scope=spfile
Oracle instance started
Total System Global Area 1560278096 bytes
Fixed Size 9135184 bytes
Variable Size 905969664 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "SRLABDUP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 200 M ,
GROUP 2 SIZE 200 M ,
GROUP 3 SIZE 200 M
DATAFILE
'/u02/oradata/SRLAB/system01.dbf',
'/u02/oradata/SRLAB/pdbseed/system01.dbf',
'/u02/oradata/SRLAB/srlabplug/system01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
"/u02/oradata/SRLAB/temp01.dbf";
set newname for tempfile 2 to
"/u02/oradata/SRLAB/pdbseed/temp012022-01-30_22-31-19-927-PM.dbf";
set newname for tempfile 3 to
"/u02/oradata/SRLAB/srlabplug/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u02/oradata/SRLAB/sysaux01.dbf",
"/u02/oradata/SRLAB/undotbs01.dbf",
"/u02/oradata/SRLAB/pdbseed/sysaux01.dbf",
"/u02/oradata/SRLAB/users01.dbf",
"/u02/oradata/SRLAB/pdbseed/undotbs01.dbf",
"/u02/oradata/SRLAB/srlabplug/sysaux01.dbf",
"/u02/oradata/SRLAB/srlabplug/undotbs01.dbf",
"/u02/oradata/SRLAB/srlabplug/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /u02/oradata/SRLAB/temp01.dbf in control file
renamed tempfile 2 to /u02/oradata/SRLAB/pdbseed/temp012022-01-30_22-31-19-927-PM.dbf in control file
renamed tempfile 3 to /u02/oradata/SRLAB/srlabplug/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/sysaux01.dbf RECID=1 STAMP=1099760545
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/undotbs01.dbf RECID=2 STAMP=1099760545
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/pdbseed/sysaux01.dbf RECID=3 STAMP=1099760545
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/users01.dbf RECID=4 STAMP=1099760545
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/pdbseed/undotbs01.dbf RECID=5 STAMP=1099760545
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/srlabplug/sysaux01.dbf RECID=6 STAMP=1099760546
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/srlabplug/undotbs01.dbf RECID=7 STAMP=1099760546
cataloged datafile copy
datafile copy file name=/u02/oradata/SRLAB/srlabplug/users01.dbf RECID=8 STAMP=1099760546
datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1099760545 file name=/u02/oradata/SRLAB/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1099760545 file name=/u02/oradata/SRLAB/undotbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1099760545 file name=/u02/oradata/SRLAB/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1099760545 file name=/u02/oradata/SRLAB/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1099760545 file name=/u02/oradata/SRLAB/pdbseed/undotbs01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1099760546 file name=/u02/oradata/SRLAB/srlabplug/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1099760546 file name=/u02/oradata/SRLAB/srlabplug/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=1099760546 file name=/u02/oradata/SRLAB/srlabplug/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
contents of Memory Script:
{
sql clone "alter pluggable database all open";
}
executing Memory Script
sql statement: alter pluggable database all open
Cannot remove created server parameter file
Finished Duplicate Db at 19-MAR-22
Target DB server session:
[oracle@srlab75 ~]$ ls -ld /u02/oradata/SRLAB
ls: cannot access /u02/oradata/SRLAB: No such file or directory
[oracle@srlab75 ~]$
[oracle@srlab75 ~]$ cd /u02/backup/
[oracle@srlab75 backup]$ ls -lrt
total 4
drwxr-xr-x. 2 oracle oinstall 4096 Feb 27 08:34 rcat
[oracle@srlab75 backup]$ ls -lrt
total 1190420
drwxr-xr-x. 2 oracle oinstall 4096 Feb 27 08:34 rcat
-rw-r-----. 1 oracle oinstall 1114112 Mar 19 16:13 c-31541674-20220212-00
-rw-r-----. 1 oracle oinstall 1114112 Mar 19 16:13 c-31541674-20220319-00
-rw-r-----. 1 oracle oinstall 259440640 Mar 19 16:13 srlab_040kt3vh_4_1_1
-rw-r-----. 1 oracle oinstall 465051648 Mar 19 16:13 srlab_090llmqg_9_1_1
-rw-r-----. 1 oracle oinstall 187867136 Mar 19 16:14 srlab_0a0llnbs_10_1_1
-rw-r-----. 1 oracle oinstall 184832 Mar 19 16:14 srlab_0b0llnln_11_1_1
-rw-r-----. 1 oracle oinstall 111656960 Mar 19 16:14 srlab_0d0opt66_13_1_1
-rw-r-----. 1 oracle oinstall 192544768 Mar 19 16:14 srlab_0e0opt8j_14_1_1
[oracle@srlab75 backup]$ cd $ORACLE_HOME/network/admin
-bash: cd: /network/admin: No such file or directory
[oracle@srlab75 backup]$ cd /u01/app/oracle/product/19.0.0.0/network/admin/
[oracle@srlab75 admin]$ vi tnsnames.ora
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$ vi listener.ora
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$ lsnrctl start listener
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 19-MAR-2022 16:43:59
Copyright (c) 1991, 2020, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/srlab75/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 19-MAR-2022 16:43:59
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/srlab75/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "srlabdup" has 1 instance(s).
Instance "srlabdup", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlab75 admin]$ ps -ef |grep pmon
oracle 32182 1 0 17:02 ? 00:00:00 ora_pmon_srlabdup
oracle 32672 16023 0 17:04 pts/3 00:00:00 grep --color=auto pmon
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$ env |grep ORA
ORACLE_SID=srlabdup
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$
[oracle@srlab75 admin]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 19 17:05:43 2022
Version 19.8.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.8.0.0.0
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SRLABDUP
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRLABPLUG READ WRITE NO
SQL> set lines 200 pages 2000
SQL>
SQL> col name for a74
SQL>
SQL> select * from v$dbfile;
FILE# NAME CON_ID
---------- -------------------------------------------------------------------------- ----------
9 /u02/oradata/SRLAB/srlabplug/system01.dbf 3
5 /u02/oradata/SRLAB/pdbseed/system01.dbf 2
1 /u02/oradata/SRLAB/system01.dbf 1
3 /u02/oradata/SRLAB/sysaux01.dbf 1
4 /u02/oradata/SRLAB/undotbs01.dbf 1
6 /u02/oradata/SRLAB/pdbseed/sysaux01.dbf 2
7 /u02/oradata/SRLAB/users01.dbf 1
8 /u02/oradata/SRLAB/pdbseed/undotbs01.dbf 2
10 /u02/oradata/SRLAB/srlabplug/sysaux01.dbf 3
11 /u02/oradata/SRLAB/srlabplug/undotbs01.dbf 3
12 /u02/oradata/SRLAB/srlabplug/users01.dbf 3
11 rows selected.
SQL> select name from v$tepfile;
select name from v$tepfile
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------
/u02/oradata/SRLAB/temp01.dbf
/u02/oradata/SRLAB/pdbseed/temp012022-01-30_22-31-19-927-PM.dbf
/u02/oradata/SRLAB/srlabplug/temp01.dbf
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
0
SQL> col comp_name for a40
SQL>
SQL> select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
------------------------------ ---------------------------------------- ------------------------------ --------------------------------------------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 LOADING
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> col version for a20
SQL> /
COMP_ID COMP_NAME VERSION STATUS
------------------------------ ---------------------------------------- -------------------- --------------------------------------------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 LOADING
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
SQL> alter system switch logfile;
System altered.
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cdb_cluster_name string
cell_offloadgroup_name string
db_file_name_convert string
db_name string SRLABDUP
db_unique_name string SRLABDUP
global_names boolean FALSE
instance_name string srlabdup
lock_name_space string
log_file_name_convert string
pdb_file_name_convert string
processor_group_name string
service_names string SRLABDUP
SQL> show parameter reco
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
db_recovery_file_dest string /u02/fra
db_recovery_file_dest_size big integer 12732M
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
remote_recovery_file_dest string
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
SQL>
Conclusion:
So there is number of ways to duplicate or clone the database depending upon you business/project requirements. Here we don’t want to engage our live environment.
Hope this helps!
Cheers!
Ramesh.
Post a Comment: