Professional Documents
Culture Documents
CLONNIG
CLONNIG
=================
-bash-3.2$ rman
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jul 20 08:07:54 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target /
connected to target database: PROD (DBID=233097709)
RMAN>
RMAN> run
2> {
3> allocate auxiliary channel c1 device type disk;
4> allocate channel c2 device type disk;
5> duplicate target database to 'CLONE';
6> }
422670336 bytes
Fixed Size
1336960
Variable Size
285215104
Database Buffers
130023424
Redo Buffers
6094848
allocated channel: c1
channel c1: SID=19 device type=DISK
bytes
bytes
bytes
bytes
422670336 bytes
Fixed Size
1336960
Variable Size
285215104
Database Buffers
130023424
Redo Buffers
6094848
allocated channel: c1
channel c1: SID=18 device type=DISK
bytes
bytes
bytes
bytes
file name=/home/oracle/app/oracle/or
file name=/home/oracle/app/oracle/or
file name=/home/oracle/app/oracle/or
file name=/home/oracle/app/oracle/or
16
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/app/oracle/flash_recovery_area/CLONE/archive
log/2013_07_20/o1_mf_1_8_8yokjr1n_.arc thread=1 sequence=8
channel clone_default: deleting archived log(s)
archived log file name=/home/oracle/app/oracle/flash_recovery_area/CLONE/archive
log/2013_07_20/o1_mf_1_8_8yokjr1n_.arc RECID=6 STAMP=821269032
media recovery complete, elapsed time: 00:00:02
Finished recover at 20-JUL-13
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''CLONE'' 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
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area
422670336 bytes
Fixed Size
1336960
Variable Size
285215104
Database Buffers
130023424
Redo Buffers
6094848
allocated channel: c1
channel c1: SID=18 device type=DISK
bytes
bytes
bytes
bytes
sql statement: alter system set db_name = ''CLONE'' comment= ''Reset to origin
al 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
422670336 bytes
Fixed Size
1336960 bytes
Variable Size
285215104 bytes
Database Buffers
130023424 bytes
Redo Buffers
6094848 bytes
allocated channel: c1
channel c1: SID=18 device type=DISK
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELO
G
MAXLOGFILES
16
MAXLOGMEMBERS
3
MAXDATAFILES
100
MAXINSTANCES
8
MAXLOGHISTORY
292
LOGFILE
GROUP 1 ( '/home/oracle/app/oracle/oradata/CLONE/redo01.log' ) SIZE 50 M REU
SE,
GROUP 2 ( '/home/oracle/app/oracle/oradata/CLONE/redo02.log' ) SIZE 50 M REU
SE,
GROUP 3 ( '/home/oracle/app/oracle/oradata/CLONE/redo03.log' ) SIZE 50 M REU
SE
DATAFILE
'/home/oracle/app/oracle/oradata/CLONE/system01.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"/home/oracle/app/oracle/oradata/CLONE/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/home/oracle/app/oracle/oradata/CLONE/sysaux01.d
bf",
"/home/oracle/app/oracle/oradata/CLONE/undotbs01.dbf",
"/home/oracle/app/oracle/oradata/CLONE/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /home/oracle/app/oracle/oradata/CLONE/temp01.dbf in contro
l file
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/CLONE/sysaux01.dbf RECID
=1 STAMP=821269061
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/CLONE/undotbs01.dbf RECI
D=2 STAMP=821269061
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/CLONE/users01.dbf RECID=
3 STAMP=821269061
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=821269061 file name=/home/oracle/app/oracle/or
adata/CLONE/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=821269061 file name=/home/oracle/app/oracle/or
adata/CLONE/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=821269061 file name=/home/oracle/app/oracle/or
adata/CLONE/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database
Finished
released
released
opened
Duplicate Db at 20-JUL-13
channel: c2
channel: c1
RMAN>
Clonnig Done
==============
SQL> select name from v$database;
NAME
--------PROD
NAME
-------------------------------------------------------------------------------/home/oracle/app/oracle/oradata/PROD/system01.dbf
/home/oracle/app/oracle/oradata/PROD/sysaux01.dbf
/home/oracle/app/oracle/oradata/PROD/undotbs01.dbf
/home/oracle/app/oracle/oradata/PROD/users01.dbf
NAME
-------------------------------------------------------------------------------/home/oracle/app/oracle/oradata/CLONE/system01.dbf
/home/oracle/app/oracle/oradata/CLONE/sysaux01.dbf
/home/oracle/app/oracle/oradata/CLONE/undotbs01.dbf
/home/oracle/app/oracle/oradata/CLONE/users01.dbf
LOGFILE
GROUP 1 ( '/home/oracle/app/oracle/oradata/CLONE/redo01.log' ) SIZE 50 M REU
SE,
GROUP 2 ( '/home/oracle/app/oracle/oradata/CLONE/redo02.log' ) SIZE 50 M REU
SE,
GROUP 3 ( '/home/oracle/app/oracle/oradata/CLONE/redo03.log' ) SIZE 50 M REU
SE
DATAFILE
'/home/oracle/app/oracle/oradata/CLONE/system01.dbf'
CHARACTER SET WE8MSWIN1252