Beruflich Dokumente
Kultur Dokumente
Windows/Linux
11.2.0.2.0
ap2-ora01.ap2.ap2.se
rs-ora01.ap2.ap2.se
I start with a standard database created by dbca, i called the db MJ and I will create a copy
on another server named VJ.
We start on the server where the copy (VJ) should go:
Create tns alias for both instances MJ and VJ, in 11g you cannot use connect / anymore.
You have to connect both to target and auxiliary using a tns alias. Im using net configuration
assistant to create mine. When they are created edit the tnsnames.ora file and add (UR=A)
for the VJ entry
So it looks like this.
VJ =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rs-ora01.ap2.ap2.se)(PORT = 1521))
)
(CONNECT_DATA =
(UR=A)
(SERVICE_NAME = VJ)
)
)
You can use tnsping to verify the names
E:\app\oracle\product\11.2.0\dbhome_1\database>tnsping mj
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 05-JAN-2011 14:05:25
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
E:\app\oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ap2ora01.ap2.ap2.se)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = MJ)))
OK (0 msec)
E:\app\oracle\product\11.2.0\dbhome_1\database>tnsping vj
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 05-JAN-2011 14:05:30
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
E:\app\oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rsora01.ap2.ap2.se)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = VJ)))
OK (0 msec)
Now we should create a static entry in the listener for instance VJ, use net manager to do
that. You can do both the tns alias and static entry by manually edit the tnsnames.ora and
listener.ora file. Be careful if you do that, it can easily become an invalid entry.
I recommend using the tools.
After you have saved and exit net manager you have to reload the listener to register the
instanses.
Lsnrctl reload, verify it by issue lsnrctl status
C:\Windows\system32>lsnrctl reload
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 07-JAN-2011 15:20:23
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RS-ORA01.ap2.ap2.se)(PORT=1521)))
The command completed successfully
C:\Windows\system32>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 07-JAN-2011 15:20:27
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RS-ORA01.ap2.ap2.se)(PORT=1521)))
STATUS of the LISTENER
-----------------------Alias
LISTENER
Version
TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
Start Date
07-JAN-2011 13:27:28
Uptime
0 days 1 hr. 53 min. 2 sec
Trace Level
off
Security
ON: Local OS Authentication
SNMP
OFF
Listener Parameter File E:\app\oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File
e:\app\oracle\diag\tnslsnr\RS-ORA01\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RS-ORA01.ap2.ap2.se)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "VJ" has 1 instance(s).
Instance "VJ", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
3991842816 bytes
2259344 bytes
2147485296 bytes
1828716544 bytes
13381632 bytes
3991842816 bytes
2259344 bytes
2147485296 bytes
1828716544 bytes
13381632 bytes
"G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_%U_.ARC" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 07-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=10 RECID=7 STAMP=739810877
output file name=G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_ARCH_D-MJ_ID3394831997_S-10_T-1_A-739633790_08M1H7HT_.ARC RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 07-JAN-11
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_ARCH_D-MJ_ID-3394831997_S10_T-1_A-739633790_08M1H7HT_.ARC
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_ARCH_D-MJ_ID-3394831997_S10_T-1_A-739633790_08M1H7HT_.ARC
List of files in Recovery Area not managed by the database
==========================================================
File Name: G:\FLASH_RECOVERY_AREA\VJ\CONTROL02.CTL
RMAN-07526: Reason: File is not an Oracle Managed File
number of files not managed by recovery area is 1, totaling 9.28MB
datafile 1 switched to datafile copy
input datafile copy RECID=3 STAMP=739810880 file name=F:\ORADATA\VJ\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=4 STAMP=739810881 file name=F:\ORADATA\VJ\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=739810881 file name=F:\ORADATA\VJ\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=739810882 file name=F:\ORADATA\VJ\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=739810883 file name=F:\ORADATA\VJ\EXAMPLE01.DBF
contents of Memory Script:
{
set until scn 1165400;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 07-JAN-11
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 10 is already on disk as file
G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_ARCH_D-MJ_ID-3394831997_S-10_T1_A-739633790_08M1H7HT_.ARC
archived log file name=G:\FLASH_RECOVERY_AREA\VJ\ARCHIVELOG\2011_01_07\O1_MF_1_10_ARCH_D-MJ_ID3394831997_S-10_T-1_A-739633790_08M1H7HT_.ARC thread=1 sequence=1
0
media recovery complete, elapsed time: 00:00:02
Finished recover at 07-JAN-11
Oracle instance started
Total System Global Area
3991842816 bytes
Fixed Size
Variable Size
Database Buffers
Redo Buffers
2259344 bytes
2147485296 bytes
1828716544 bytes
13381632 bytes
3991842816 bytes
Fixed Size
2259344 bytes
Variable Size
2147485296 bytes
Database Buffers
1828716544 bytes
Redo Buffers
13381632 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "VJ" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS
3
MAXDATAFILES
100
MAXINSTANCES 8
MAXLOGHISTORY
292
LOGFILE
GROUP 1 ( 'F:\ORADATA\VJ\REDO01.LOG' ) SIZE 50 M REUSE,
GROUP 2 ( 'F:\ORADATA\VJ\REDO02.LOG' ) SIZE 50 M REUSE,
GROUP 3 ( 'F:\ORADATA\VJ\REDO03.LOG' ) SIZE 50 M REUSE
DATAFILE
'F:\ORADATA\VJ\SYSTEM01.DBF'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"F:\ORADATA\VJ\TEMP01.DBF";
switch clone tempfile all;
catalog clone datafilecopy "F:\ORADATA\VJ\SYSAUX01.DBF",
"F:\ORADATA\VJ\UNDOTBS01.DBF",
"F:\ORADATA\VJ\USERS01.DBF",
"F:\ORADATA\VJ\EXAMPLE01.DBF";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to F:\ORADATA\VJ\TEMP01.DBF in control file
cataloged datafile copy
datafile copy file name=F:\ORADATA\VJ\SYSAUX01.DBF RECID=1 STAMP=739810946
cataloged datafile copy
datafile copy file name=F:\ORADATA\VJ\UNDOTBS01.DBF RECID=2 STAMP=739810946
cataloged datafile copy
datafile copy file name=F:\ORADATA\VJ\USERS01.DBF RECID=3 STAMP=739810947
cataloged datafile copy
datafile copy file name=F:\ORADATA\VJ\EXAMPLE01.DBF RECID=4 STAMP=739810947
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=739810946 file name=F:\ORADATA\VJ\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=739810946 file name=F:\ORADATA\VJ\UNDOTBS01.DBF
NOTE:
I experienced ORA-12514 when I ran the duplicate script. This was seen because the
instance VJ was not statically registered with the listener on the target server. Use lsnrctl
status to verify that the instance is listed even if it is down.
If you analyze the output from the duplicate you will find
RMAN-07526: Reason: File is not an Oracle Managed File
It seems to be known why we see it, google the errorcode or look into oracle support.
It isnt an issue with the clone.