0% found this document useful (0 votes)
15 views8 pages

Auxiliary Cloning

The document outlines the configuration and cloning process for Oracle databases named 'dev' and 'maths', detailing parameters such as file destinations, memory settings, and control files. It includes commands for creating necessary directories, starting the database instance, and using RMAN to duplicate the target database. The cloning process involves restoring datafiles, performing media recovery, and resetting database parameters for the new instance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

Auxiliary Cloning

The document outlines the configuration and cloning process for Oracle databases named 'dev' and 'maths', detailing parameters such as file destinations, memory settings, and control files. It includes commands for creating necessary directories, starting the database instance, and using RMAN to duplicate the target database. The cloning process involves restoring datafiles, performing media recovery, and resetting database parameters for the new instance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

[oracle@server2 dbs]$ cat initdev.

ora
*.audit_file_dest='/u01/app/oracle/admin/dev/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/dev/control01.ctl','/u01/app/oracle/
fast_recovery_area/dev/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='dev'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4385144832
*.diagnostic_dest='/u01/app/oracle'
#*.dispatchers='(PROTOCOL=TCP) (SERVICE=proddbXDB)'
*.memory_target=1652555776
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
db_file_name_convert='/u01/app/oracle/oradata/proddb','/u01/app/oracle/oradata/dev'
log_file_name_convert='/u01/app/oracle/oradata/proddb','/u01/app/oracle/oradata/
dev'

cat initdev.ora
*.audit_file_dest='/u01/app/oracle/admin/maths/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/maths/control01.ctl','/u01/app/oracle/
fast_recovery_area/maths/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='maths'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4385144832
*.diagnostic_dest='/u01/app/oracle'
#*.dispatchers='(PROTOCOL=TCP) (SERVICE=proddbXDB)'
*.memory_target=1652555776
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
db_file_name_convert='/u01/app/oracle/oradata/test','/u01/app/oracle/oradata/maths'
log_file_name_convert='/u01/app/oracle/oradata/test','/u01/app/oracle/oradata/
maths'

mandatory in cloning except in manaul:


========================================
db_file_name_convert='/u01/app/oracle/oradata/test','/u01/app/oracle/oradata/maths'
log_file_name_convert='/u01/app/oracle/oradata/test','/u01/app/oracle/oradata/
maths'

[oracle@server2 dbs]$ mkdir -p /u01/app/oracle/admin/maths/adump


[oracle@server2 dbs]$ mkdir -p /u01/app/oracle/oradata/maths/
[oracle@server2 dbs]$ mkdir -p /u01/app/oracle/fast_recovery_area/maths/
[oracle@server2 dbs]$ mkdir -p /u01/app/oracle/oradata/maths
[oracle@server2 dbs]$ !sq
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jan 23 20:44:35 2022


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

Connected to an idle instance.

SQL> stratup nomount;


SP2-0734: unknown command beginning "stratup no..." - rest of line ignored.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1653518336 bytes


Fixed Size 2253784 bytes
Variable Size 956304424 bytes
Database Buffers 687865856 bytes
Redo Buffers 7094272 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@server2 dbs]$ cd /backups/rmanbkp/
[oracle@server2 rmanbkp]$ pwd
/backups/rmanbkp
[oracle@server2 rmanbkp]$ rman auxiliary /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jan 23 20:45:24 2022

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

connected to auxiliary database: DEV (not mounted)

RMAN> duplicate target database to english backup location


'/backups/dell/'nofilenamecheck;

nofilenamecheck enduku ante datafiles conflict avtadi.


nofilenamecheck isthe confict ravu.

duplicate target database to english backup location


'/backups/dell'nofilenamecheck;

Starting Duplicate Db at 23-JAN-22

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

Fixed Size 2253784 bytes


Variable Size 973081640 bytes
Database Buffers 671088640 bytes
Redo Buffers 7094272 bytes

contents of Memory Script:


{
sql clone "alter system set db_name =
''PRODDB'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''DEV'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from
'/backups/rmanbkp/CONTROLFILE_PRODDB_040k1cfm_4_20220123.bkp';
alter clone database mount;
}
executing Memory Script

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

sql statement: alter system set db_unique_name = ''DEV'' comment= ''Modified by


RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 1653518336 bytes

Fixed Size 2253784 bytes


Variable Size 973081640 bytes
Database Buffers 671088640 bytes
Redo Buffers 7094272 bytes

Starting restore at 23-JAN-22


allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK

channel ORA_AUX_DISK_1: restoring control file


channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/dev/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/dev/control02.ctl
Finished restore at 23-JAN-22

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

contents of Memory Script:


{
set until scn 1138046;
set newname for datafile 1 to
"/u01/app/oracle/oradata/dev/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/dev/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/dev/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/dev/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/dev/arun01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/dev/baba01.dbf";
set newname for datafile 7 to
"/u01/app/oracle/oradata/dev/charan01.dbf";
set newname for datafile 8 to
"/u01/app/oracle/oradata/dev/dinesh01.dbf";
set newname for datafile 9 to
"/u01/app/oracle/oradata/dev/ekanth01.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

Starting restore at 23-JAN-22


using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore


channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to
/u01/app/oracle/oradata/dev/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to
/u01/app/oracle/oradata/dev/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to
/u01/app/oracle/oradata/dev/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to
/u01/app/oracle/oradata/dev/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to
/u01/app/oracle/oradata/dev/arun01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to
/u01/app/oracle/oradata/dev/baba01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to
/u01/app/oracle/oradata/dev/charan01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to
/u01/app/oracle/oradata/dev/dinesh01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to
/u01/app/oracle/oradata/dev/ekanth01.dbf
channel ORA_AUX_DISK_1: reading from backup piece
/backups/rmanbkp/FULL_PRODDB_010k1ccv_1_20220123.bkp
channel ORA_AUX_DISK_1: piece
handle=/backups/rmanbkp/FULL_PRODDB_010k1ccv_1_20220123.bkp tag=TAG20220123T194015
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 23-JAN-22

contents of Memory Script:


{
switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy


input datafile copy RECID=10 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=11 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=13 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=14 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/arun01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=15 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/baba01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=16 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/charan01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=17 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/dinesh01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=18 STAMP=1094762854 file
name=/u01/app/oracle/oradata/dev/ekanth01.dbf

contents of Memory Script:


{
set until scn 1138046;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 23-JAN-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=14
channel ORA_AUX_DISK_1: reading from backup piece
/backups/rmanbkp/Archivelogs_PRODDB_030k1cf8_3_20220123.bkp
channel ORA_AUX_DISK_1: piece
handle=/backups/rmanbkp/Archivelogs_PRODDB_030k1cf8_3_20220123.bkp
tag=TAG20220123T194128
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=/u01/app/oracle/fast_recovery_area/DEV/archivelog/2022_01_23/
o1_mf_1_14_jytwdgv9_.arc thread=1 sequence=14
channel clone_default: deleting archived log(s)
archived log file
name=/u01/app/oracle/fast_recovery_area/DEV/archivelog/2022_01_23/
o1_mf_1_14_jytwdgv9_.arc RECID=1 STAMP=1094762854
media recovery complete, elapsed time: 00:00:00
Finished recover at 23-JAN-22
Oracle instance started

Total System Global Area 1653518336 bytes

Fixed Size 2253784 bytes


Variable Size 973081640 bytes
Database Buffers 671088640 bytes
Redo Buffers 7094272 bytes

contents of Memory Script:


{
sql clone "alter system set db_name =
''DEV'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

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

sql statement: alter system reset db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)


Oracle instance started

Total System Global Area 1653518336 bytes


Fixed Size 2253784 bytes
Variable Size 973081640 bytes
Database Buffers 671088640 bytes
Redo Buffers 7094272 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DEV" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/dev/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/dev/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/dev/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/dev/system01.dbf'
CHARACTER SET WE8MSWIN1252

contents of Memory Script:


{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/dev/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/dev/sysaux01.dbf",
"/u01/app/oracle/oradata/dev/undotbs01.dbf",
"/u01/app/oracle/oradata/dev/users01.dbf",
"/u01/app/oracle/oradata/dev/arun01.dbf",
"/u01/app/oracle/oradata/dev/baba01.dbf",
"/u01/app/oracle/oradata/dev/charan01.dbf",
"/u01/app/oracle/oradata/dev/dinesh01.dbf",
"/u01/app/oracle/oradata/dev/ekanth01.dbf";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/dev/temp01.dbf in control file

cataloged datafile copy


datafile copy file name=/u01/app/oracle/oradata/dev/sysaux01.dbf RECID=1
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/undotbs01.dbf RECID=2
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/users01.dbf RECID=3
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/arun01.dbf RECID=4
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/baba01.dbf RECID=5
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/charan01.dbf RECID=6
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/dinesh01.dbf RECID=7
STAMP=1094762864
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dev/ekanth01.dbf RECID=8
STAMP=1094762864

datafile 2 switched to datafile copy


input datafile copy RECID=1 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/arun01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/baba01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/charan01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/dinesh01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=1094762864 file
name=/u01/app/oracle/oradata/dev/ekanth01.dbf

contents of Memory Script:


{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 23-JAN-22

QL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
DEV READ WRITE

You might also like