****************************************
---RMAN Active Duplication To Another Server--
****************************************
v
SERVER 01
PROD (source)
Ü
step 01: create pfile if does not exist
[oracle@prod ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 3
23:38:54 2024
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> create pfile from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Ü
step 02: Transfer pfile to server 2 (Target
Database)
[oracle@prod ~]$ cd $ORACLE_HOME/dbs
initmaxcdb.ora | orapwmaxcdb
[oracle@prod dbs]$ scp initmaxcdb.ora
oracle@192.168.73.135:$ORACLE_HOME/dbs
oracle@192.168.73.135's password:
initmaxcdb.ora 100% 1220 679.4KB/s 00:00
Ü
step 03: Transfer password files to server 2
(target database)
[oracle@prod dbs]$ scp orapwmaxcdb
oracle@192.168.73.135:$ORACLE_HOME/dbs
oracle@192.168.73.135's password:
orapwmaxcdb 100% 2048 1.0MB/s 00:00
v
SERVER 02
DEV (target)
Ü
step 04: add an entry in oratab
[oracle@clone ~]$ vi /etc/oratab
maxcdb:/u01/app/oracle/product/19.0.0/dbhome_1:N
Ü step 05: create necessary directories
[oracle@clone ~]$ mkdir -p
/u01/app/oracle/admin/maxcdb/adump
[oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/MAXCDB/
[oracle@clone ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/MAXCDB/
Ü
step 06: set TNS entry for source database
[oracle@clone admin]$ vi tnsnames.ora
MAXCDB_SOURCE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.73.134)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = maxcdb)
)
)
Ü
step 07: verify TNS entry
[oracle@clone ~]$ tnsping maxcdb_source
TNS Ping Utility for Linux: Version 19.0.0.0.0 -
Production on 03-AUG-2024 23:59:46
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.73.134)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = maxcdb)))
OK (0 msec)
Ü
step 08: startup database in nomount mode
[oracle@clone ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 4
00:00:21 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1828714320 bytes
Fixed Size 9135952 bytes
Variable Size 436207616 bytes
Database Buffers 1375731712 bytes
Redo Buffers 7639040 bytes
Ü
step 09: duplicate database
[oracle@clone ~]$ rman target sys/oracle@maxcdb_source
auxiliary /
Recovery Manager: Release 19.0.0.0.0 - Production on Sun
Aug 4 00:03:04 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: MAXCDB (DBID=2567024698)
connected to auxiliary database: MAXCDB (not mounted)
RMAN> duplicate database to maxcdb from active
database nofilenamecheck;
Starting Duplicate Db at 04-AUG-24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=237 device type=DISK
sql statement: alter pluggable database all open
Cannot remove created server parameter file
Finished Duplicate Db at 04-AUG-24
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
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
initmaxcdb.ora | orapwmaxcdb
oracle@192.168.73.135's password:
initmaxcdb.ora 100% 1220 679.4KB/s 00:00
oracle@192.168.73.135's password:
orapwmaxcdb 100% 2048 1.0MB/s 00:00
maxcdb:/u01/app/oracle/product/19.0.0/dbhome_1:N
Ü step 05: create necessary directories
[oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/MAXCDB/
[oracle@clone ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/MAXCDB/
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.73.134)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = maxcdb)
)
)
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.73.134)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = maxcdb)))
OK (0 msec)
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
Total System Global Area 1828714320 bytes
Fixed Size 9135952 bytes
Variable Size 436207616 bytes
Database Buffers 1375731712 bytes
Redo Buffers 7639040 bytes
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: MAXCDB (DBID=2567024698)
connected to auxiliary database: MAXCDB (not mounted)
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=237 device type=DISK
sql statement: alter pluggable database all open
Cannot remove created server parameter file
Finished Duplicate Db at 04-AUG-24
Tags
RMAN