11g RMAN新特性active database duplicate 数据库异构
上一篇 / 下一篇 2008-08-01 12:32:57 / 个人分类:oracle 11g 新技术
主库:linux rh4+oracle 11.1.0.6
数据文件 /oradata/asm11g
复制到:windows 2003 server+oracle 11.1.0.6
数据文件 f:\asm11g 下
简称 主库和复制库
主库只需要复制密码文件 $ORACLE_HOME/dbs/orapwasm11g 到 windows $ORACLE_HOME/database/目录下
并且重命名为PWDasm11g.ora
现在我们做需要复制到windows 2003库的准备:
在windows 2003 server F盘上 新建asm11g 目录
oracle_base d:\app\administrator\admin 目录下新建asm11g 目录
d:\app\administrator\admin\asm11g\目录下 新建adump,dpdump,pfile 三个目录
在F盘上 新建个 init.ora 文件 里面输入db_name=asm11g
1,复制库启动到 nomount 下
C:\Documents and Settings\复制Administrator>set oracle_sid=asm11g
C:\Documents and Settings\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Aug 1 12:19:01 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='f:\init.ora';ITPUB个人空间8E dM C_kr[
ORACLE instance started.
Total System Global Area 146472960 bytesITPUB个人空间]J
LmlCGP
Fixed Size 1331740 bytes
7lx+_'E4TX.s0Variable Size 92278244 bytesITPUB个人空间bl
r|(H9hX
Database Buffers 50331648 bytesITPUB个人空间;YZ.V$vR8_
|9w
Redo Buffers 2531328 bytesITPUB个人空间l
H$e3z[zK8bt'c
SQL> exit
主库开始运行以下命令开始复制:
[oracle@asm11g ~]$ rman target / auxiliarysys/abcdefg@asm11g_s
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Jul 27 06:40:22 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ASM11G (DBID=4214158610)ITPUB个人空间!WpvD8I {Tl\S3Q
connected to auxiliary database: ASM11G (not mounted)ITPUB个人空间oh/hm!{6W_%w
RMAN> duplicate target database to 'asm11g'
/ZOF?1b ^5?C:u5i02> from active database ITPUB个人空间pIp OqJ
3> spfile set DB_UNIQUE_NAME 'asm11g'
Q$r/i5RG`04> set control_files 'f:\asm11g\control01.ctl';
Starting Duplicate Db at 27-JUL-08
'fV+D6z(^0using channel ORA_AUX_DISK_1
contents of Memory Script.:
[K:?s)L\*s0{ITPUB个人空间JzJHAPHE:yF,g
backup as copy reuse
U%?;xRc|0 file '/u01/app/oracle/product/11.1.6/db_1/dbs/spfileasm11g.ora' auxiliary formatITPUB个人空间;R*_F Z5bvzT(SH.t
'D:\APP\ADMINISTRATOR\PRODUCT\11.1.0\DB_1\DATABASE\SPFILEASM11G.ORA' ;ITPUB个人空间|k
bp}~i
sql clone "alter system set spfile= ''D:\APP\ADMINISTRATOR\PRODUCT\11.1.0\DB_1\DATABASE\SPFILEASM11G.ORA''";ITPUB个人空间@h%]` J$H#cs
}ITPUB个人空间Ak.@4^eN-H"Yy
executing Memory Script
Starting backup at 27-JUL-08ITPUB个人空间HJ3_1hNOQ'A1[Y
allocated channel: ORA_DISK_1ITPUB个人空间4vD4O_D0[6o)K
channel ORA_DISK_1: SID=103 device type=DISK
+J&ZT GG2Gn0Finished backup at 27-JUL-08
sql statement: alter system set spfile= ''D:\APP\ADMINISTRATOR\PRODUCT\11.1.0\DB_1\DATABASE\SPFILEASM11G.ORA''
contents of Memory Script.:ITPUB个人空间q9zH4B+gBcU
{ITPUB个人空间!A2O]r O%T-]0CZ;At
sql clone "alter system set db_name =
C3z2g
a4W)Ka-K0 ''ASM11G'' comment=
;LtDCVZ!V G k,f0 ''duplicate'' scope=spfile";ITPUB个人空间\*Isr8ix4PO@
sql clone "alter system set db_unique_name =
+E fY
F-At0 ''ASM11G'' comment=
?[/V"bv6GrdI0 ''duplicate'' scope=spfile";ITPUB个人空间*v KRi)c(qt*f
sql clone "alter system set db_unique_name =
kf0~v%qA%U0 ''asm11g'' comment=
!n{
{ EQK
[t0 '''' scope=spfile";
s6m"a[M0GPyGy)[0 sql clone "alter system set control_files =ITPUB个人空间
}7U CjB.c;_
''f:\asm11g\control01.ctl'' comment=
,Qb$nlg8b0 '''' scope=spfile";ITPUB个人空间&`I0Z,D(L
^+R
shutdown clone immediate;
"z a`/W
s"I0 startup clone nomount ;
#Zg/Yb%?{0}
s)uA4X ]EnD2KM0executing Memory Script
sql statement: alter system set db_name = ''ASM11G'' comment= ''duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''ASM11G'' comment= ''duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''asm11g'' comment= '''' scope=spfile
sql statement: alter system set control_files = ''f:\asm11g\control01.ctl'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
+h1?6{/B&tp&iS
h0RMAN-00571: ===========================================================
,["J1t9m"G\7V#H0RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============ITPUB个人空间.SF@hl1Jo
RMAN-00571: ===========================================================ITPUB个人空间r`1B }Y5m3q#u
RMAN-03002: failure of Duplicate Db command at 07/27/2008 06:41:37ITPUB个人空间{dx9e3I+^
RMAN-03015: error occurred in stored script. Memory ScriptITPUB个人空间(G5@;^!bXXg
RMAN-04014: startup failed: ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
zx7J2LA/K_0ORA-48140: the specified ADR Base directory does not exist [d:\u01\app\oracle]ITPUB个人空间kL#k,M G7w5N PKc
ORA-48187: specified directory does not existITPUB个人空间
A tcb3pr"O
OSD-00002: additional error information
;`,LpQ7g5Tr0O/S-Error: (OS 3) The system cannot find the path specified.
这个错误是因为从主库拷贝spfileasm11g.ora 到复制库的 所以两边oracle_base 不一致 造成复制库启动不了
这个时候只需要修改相关参数为复制库的oracle_base 和修改文件转换路径参数
复制库修改参数文件如下:
C:\Documents and Settings\Administrator>set oracle_sid=asm11g
C:\Documents and Settings\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Aug 1 12:26:24 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create pfile from spfile;
File created.
首先创建出pfile 文件 用ue 编辑最后修改的参数文件如下:
asm11g.__db_cache_size=276824064
(V/mB_&n`;d0asm11g.__java_pool_size=4194304
XTttl TC/z0asm11g.__large_pool_size=4194304
.u0{,PvOmO0asm11g.__oracle_base='D:\app\Administrator'#ORACLE_BASE set from environment
hqn6qY*p3l0asm11g.__pga_aggregate_target=138412032
E.GG3l-i0asm11g.__sga_target=411041792ITPUB个人空间
HxVRP"{t z5X
asm11g.__shared_io_pool_size=0ITPUB个人空间CZ^-K3NSne0\
asm11g.__shared_pool_size=121634816ITPUB个人空间9R5B(\ YBxS6u A0J2B
asm11g.__streams_pool_size=0
X5I2ao}0E%H0*.audit_file_dest='D:\app\Administrator\admin\asm11g\adump'
o0i7b0};Nx^b
f'@0*.audit_trail='db'ITPUB个人空间 P/V-YXl
*.compatible='11.1.0.0.0'ITPUB个人空间'AtQTh]T2m0U OI
*.control_files='f:\asm11g\control01.ctl'
5k+[&a