[转载]关于Oracle10g跨平台传输表空间
<P>信息来源:邪恶八进制信息安全团队</P><P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414005 style="FONT-SIZE: 12px">1.准备工作:<BR>查询源数据库平台信息<BR><BR>SQL> col platform_name for a40<BR>SQL> SELECT d.PLATFORM_NAME, ENDIAN_FORMAT<BR>2 FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d<BR>3 WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;<BR><BR>PLATFORM_NAME ENDIAN_FORMAT<BR>---------------------------------------- --------------<BR>Solaris[tm] OE (64-bit) Big<BR><BR>查询目标数据库平台信息<BR><BR>SQL> col platform_name for a40<BR>SQL> SELECT d.PLATFORM_NAME, ENDIAN_FORMAT<BR>2 FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d<BR>3 WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;<BR><BR>PLATFORM_NAME ENDIAN_FORMAT<BR>---------------------------------------- --------------<BR>Microsoft Windows IA (32-bit) Little<BR><BR>查询Oracle10g支持的平台转换<BR></FONT>
<BLOCKQUOTE><PRE><FONT size=2><FONT face=verdana,arial,helvetica>代码:</FONT><HR></FONT><CODE><FONT color=#000000>
<FONT color=#0000bb><BR>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>select </FONT><FONT color=#007700>* </FONT><FONT color=#0000bb>fromv$transportable_platform</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>PLATFORM_ID PLATFORM_NAMEENDIAN_FORMAT
<BR></FONT><FONT color=#007700>----------- ---------------------------------------- --------------
<BR></FONT><FONT color=#0000bb>1 Solaris</FONT><FONT color=#007700>[</FONT><FONT color=#0000bb>tm</FONT><FONT color=#007700>] </FONT><FONT color=#0000bb>OE </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>32</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Big
<BR>2 Solaris</FONT><FONT color=#007700>[</FONT><FONT color=#0000bb>tm</FONT><FONT color=#007700>] </FONT><FONT color=#0000bb>OE </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Big
<BR>7 Microsoft Windows IA </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>32</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Little
<BR>10 Linux IA </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>32</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Little
<BR>6 AIX</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>Based Systems </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Big
<BR>3 HP</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>UX </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Big
<BR>5 HP Tru64 UNIXLittle
<BR>4 HP</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>UX IA </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Big
<BR>11 Linux IA </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Little
<BR>15 HP Open VMSLittle
<BR>8 Microsoft Windows IA </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit</FONT><FONT color=#007700>)</FONT><FONT color=#0000bb>Little
<BR>
<BR>PLATFORM_ID PLATFORM_NAMEENDIAN_FORMAT
<BR></FONT><FONT color=#007700>----------- ---------------------------------------- --------------
<BR></FONT><FONT color=#0000bb>9 IBM zSeries Based LinuxBig
<BR>13 Linux 64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit </FONT><FONT color=#007700>for </FONT><FONT color=#0000bb>AMDLittle
<BR>16 Apple Mac OSBig
<BR>12 Microsoft Windows 64</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>bit </FONT><FONT color=#007700>for </FONT><FONT color=#0000bb>AMDLittle
<BR>
<B< font></CODE><HR></FONT></FONT></PRE></BLOCKQUOTE></SPAN> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414010 style="FONT-SIZE: 12px">2.创建一个独立的自包含表空间<BR><BR>用于测试.<BR></FONT>
<BLOCKQUOTE><PRE><FONT size=2><FONT face=verdana,arial,helvetica>代码:</FONT><HR></FONT><CODE><FONT color=#000000>
<FONT color=#0000bb><BR></FONT><FONT color=#007700>$ </FONT><FONT color=#0000bb>sqlplus </FONT><FONT color=#dd0000>"/ as sysdba"
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>*</FONT><FONT color=#0000bb>Plus</FONT><FONT color=#007700>: </FONT><FONT color=#0000bb>Release 10.1.0.2.0 </FONT><FONT color=#007700>- </FONT><FONT color=#0000bb>Production on Tue Apr 27 14</FONT><FONT color=#007700>:</FONT><FONT color=#0000bb>04</FONT><FONT color=#007700>:</FONT><FONT color=#0000bb>08 2004
<BR>
<BR>Copyright </FONT><FONT color=#007700>(</FONT><FONT color=#0000bb>c</FONT><FONT color=#007700>) </FONT><FONT color=#0000bb>1982</FONT><FONT color=#007700>, </FONT><FONT color=#0000bb>2004</FONT><FONT color=#007700>, </FONT><FONT color=#0000bb>Oracle</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>All rights reserved</FONT><FONT color=#007700>.
<BR>
<BR>
<BR></FONT><FONT color=#0000bb>Connected to</FONT><FONT color=#007700>:
<BR></FONT><FONT color=#0000bb>Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 </FONT><FONT color=#007700>- </FONT><FONT color=#0000bb>64bit Production
<BR>With the Partitioning</FONT><FONT color=#007700>, </FONT><FONT color=#0000bb>OLAP </FONT><FONT color=#007700>and </FONT><FONT color=#0000bb>Data Mining options
<BR>
<BR>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>select name from v$datafile</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>NAME
<BR></FONT><FONT color=#007700>--------------------------------------------------------------------------------
<BR>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>system01</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>undotbs01</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>sysaux01</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>users01</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>data1</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>systemfile</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle01</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>EYGLE</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>datafile</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>o1_mf_test_03xv34ny_</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR></FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>opt</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oracle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>oradata</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>eygle</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>EYGLE</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>datafile</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>o1_mf_itpub_03xv5g66_</FONT><FONT color=#007700>.</FONT><FONT color=#0000bb>dbf
<BR>
<BR>7 rows selected</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>create tablespace trans
<BR>2datafile </FONT><FONT color=#dd0000>'/data1/oradata/systemfile/trans01.dbf'
<BR></FONT><FONT color=#0000bb>3size 10M</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>Tablespace created</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>create user trans identified by trans
<BR>2</FONT><FONT color=#007700>default </FONT><FONT color=#0000bb>tablespace trans</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>User created</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>grant connect</FONT><FONT color=#007700>,</FONT><FONT color=#0000bb>resource to trans</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>Grant succeeded</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>connect trans</FONT><FONT color=#007700>/</FONT><FONT color=#0000bb>trans
<BR>Connected</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>create table test </FONT><FONT color=#007700>as </FONT><FONT color=#0000bb>select </FONT><FONT color=#007700>* </FONT><FONT color=#0000bb>from user_objects</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>Table created</FONT><FONT color=#007700>.
<BR>
<BR></FONT><FONT color=#0000bb>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>selectcount</FONT><FONT color=#007700>(*) </FONT><FONT color=#0000bb>from test</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>COUNT</FONT><FONT color=#007700>(*)
<BR>----------
<BR></FONT><FONT color=#0000bb>1
<BR>
<BR>SQL</FONT><FONT color=#007700>> </FONT><FONT color=#0000bb>select </FONT><FONT color=#007700>* </FONT><FONT color=#0000bb>from test</FONT><FONT color=#007700>;
<BR>
<BR></FONT><FONT color=#0000bb>OBJECT_NAME
<BR></FONT><FONT color=#007700>--------------------------------------------------------------------------------
<BR></FONT><FONT color=#0000bb>SUBOBJECT_NAMEOBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
<BR></FONT><FONT color=#007700>------------------------------ ---------- -------------- -------------------
<BR></FONT><FONT color=#0000bb>CREATEDLAST_DDL_TIM TIMESTAMPSTATUST G S
<BR></FONT><FONT color=#007700>------------ ------------ ------------------- ------- - - -
<BR></FONT><FONT color=#0000bb>TEST
<BR>1560415604 TABLE
<BR>27</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>APR</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>0427</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>APR</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>042004</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>04</FONT><FONT color=#007700>-</FONT><FONT color=#0000bb>27</FONT><FONT color=#007700>:</FONT><FONT color=#0000bb>14</FONT><FONT color=#007700>:</FONT><FONT color=#0000bb>05</FONT><FONT color=#007700>:</FONT><FONT color=#0000bb>42 VALIDN N N
<BR>
<BR>
<BR>SQL</FONT><FONT color=#007700>> exit
<BR></FONT><FONT color=#0000bb>Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 </FONT><FONT color=#007700>- </FONT><FONT color=#0000bb>64bit Production
<BR>With the Partitioning</FONT><FONT color=#007700>, </FONT><FONT color=#0000bb>OLAP </FONT><FONT color=#007700>and </FONT><FONT color=#0000bb>Dat</FONT></CODE><HR></PRE></BLOCKQUOTE><FONT face="verdana, arial, helvetica" size=2></SPAN></FONT>
<P></P>
<P><FONT face="verdana, arial, helvetica" size=2><BR></FONT></P></FONT> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414016 style="FONT-SIZE: 12px">3.导出要传输的表空间<BR>$ pwd<BR>/opt/oracle<BR>$ cd dpdata<BR>$ ls<BR>$ expdp eygle/eygle dumpfile=trans.dmp directory=dpdata transport_tablespace=trans<BR>LRM-00101: unknown parameter name 'transport_tablespace'<BR><BR>$ expdp eygle/eygle dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans<BR><BR>Export: Release 10.1.0.2.0 - 64bit Production on Tuesday, 27 April, 2004 14:07<BR><BR>Copyright (c) 2003, Oracle. All rights reserved.<BR><BR>Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production<BR>With the Partitioning, OLAP and Data Mining options<BR>Starting "EYGLE"."SYS_EXPORT_TRANSPORTABLE_01": eygle/******** dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans <BR>ORA-39123: Data Pump transportable tablespace job aborted<BR>ORA-29335: tablespace 'TRANS' is not read only<BR><BR>Job "EYGLE"."SYS_EXPORT_TRANSPORTABLE_01" stopped due to fatal error at 14:08<BR><BR><FONT color=red>注意:传输表空间必须置为只读状态</FONT><BR><BR>$ sqlplus "/ as sysdba"<BR><BR>SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr 27 14:08:13 2004<BR><BR>Copyright (c) 1982, 2004, Oracle. All rights reserved.<BR><BR><BR>Connected to:<BR>Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production<BR>With the Partitioning, OLAP and Data Mining options<BR><BR>SQL> alter tablespace trans read only;<BR><BR>Tablespace altered.<BR><BR>SQL> exit<BR>Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production<BR>With the Partitioning, OLAP and Data Mining options<BR><BR><BR>$ expdp eygle/eygle dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans<BR><BR>Export: Release 10.1.0.2.0 - 64bit Production on Tuesday, 27 April, 2004 14:08<BR><BR>Copyright (c) 2003, Oracle. All rights reserved.<BR><BR>Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production<BR>With the Partitioning, OLAP and Data Mining options<BR>Starting "EYGLE"."SYS_EXPORT_TRANSPORTABLE_01": eygle/******** dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans <BR>Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK<BR>Processing object type TRANSPORTABLE_EXPORT/TABLE<BR>Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK<BR>Master table "EYGLE"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded<BR>******************************************************************************<BR>Dump file set for EYGLE.SYS_EXPORT_TRANSPORTABLE_01 is:<BR>/opt/oracle/dpdata/trans.dmp<BR>Job "EYGLE"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 14:09</SPAN></FONT></P>
<P><FONT face="verdana, arial, helvetica" size=2><BR></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414021 style="FONT-SIZE: 12px">4.使用rman转换文件格式<BR><BR>$ rman target /<BR><BR>Recovery Manager: Release 10.1.0.2.0 - 64bit Production<BR><BR>Copyright (c) 1995, 2004, Oracle. All rights reserved.<BR><BR>connected to target database: EYGLE (DBID=1337390772)<BR><BR>RMAN> convert tablespace trans<BR>2> <FONT color=red>to platform 'Microsoft Windows IA (32-bit)'</FONT><BR>3> Format '/tmp/%U';<BR><BR>Starting backup at 27-APR-04<BR>using target database controlfile instead of recovery catalog<BR>allocated channel: ORA_DISK_1<BR>channel ORA_DISK_1: sid=148 devtype=DISK<BR>channel ORA_DISK_1: starting datafile conversion<BR>input datafile fno=00008 name=/data1/oradata/systemfile/trans01.dbf<BR>converted datafile=/tmp/data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg<BR>channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01<BR>Finished backup at 27-APR-04<BR><BR>RMAN> exit<BR><BR><BR>Recovery Manager complete.</SPAN></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414024 style="FONT-SIZE: 12px">5.确认导出文件已生成.<BR><BR>$ ls /tmp/data*<BR>/tmp/data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg<BR>$ ls -l /tmp/data*<BR>-rw-r----- 1 oracle dba 10493952 Apr 27 14:12 /tmp/data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg<BR>$ chmod 777 /tmp/data*<BR>$ chmod 777 /opt/oracle/dpdata/*<BR><BR>6.通过ftp传输文件至目标主机<BR><BR><BR>220 billing-center.hurray.com.cn FTP server (SunOS 5.8) ready.<BR>User (172.16.33.32<IMG alt=皱眉 src="http://www.itpub.net/images/smilies/2.gif" border=0>none)): gqgai<BR>331 Password required for gqgai.<BR>Password:<BR>230 User gqgai logged in.<BR>ftp> bin<BR>200 Type set to I.<BR>ftp> cd /tmp<BR>250 CWD command successful.<BR>ftp> mget data*<BR>200 Type set to I.<BR>mget data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg? y<BR>200 PORT command successful.<BR>150 Binary data connection for data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg (172.16.32.65,2885) (10493952 bytes).<BR>226 Binary Transfer complete.<BR>ftp: 10493952 bytes received in 15.90Seconds 659.87Kbytes/sec.<BR>ftp> cd /opt/oracle/dpdata<BR>250 CWD command successful.<BR>ftp> ls<BR>200 PORT command successful.<BR>150 ASCII data connection for /bin/ls (172.16.32.65,2889) (0 bytes).<BR>export.log<BR>trans.dmp<BR>226 ASCII Transfer complete.<BR>ftp: 23 bytes received in 0.01Seconds 2.30Kbytes/sec.<BR>ftp> bin<BR>200 Type set to I.<BR>ftp> mget trans.dmp<BR>200 Type set to I.<BR>mget trans.dmp? y<BR>200 PORT command successful.<BR>150 Binary data connection for trans.dmp (172.16.32.65,2893) (73728 bytes).<BR>226 Binary Transfer complete.<BR>ftp: 73728 bytes received in 0.03Seconds 2457.60Kbytes/sec.<BR>ftp> bye<BR>221 Goodbye.</SPAN></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414028 style="FONT-SIZE: 12px">7.使用rman在目标数据库转换文件<BR><BR>E:\Oracle\oradata\vilen\dpdata>rman target /<BR><BR>恢复管理器: 版本10.1.0.2.0 - Production<BR><BR>Copyright (c) 1995, 2004, Oracle. All rights reserved.<BR><BR>连接到目标数据库: VILEN (DBID=1587222708)<BR><BR><BR>RMAN> <FONT color=red>CONVERT DATAFILE </FONT>'E:\Oracle\oradata\vilen\dpdata\data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg'<BR>2> DB_FILE_NAME_CONVERT<BR>3> 'E:\Oracle\oradata\vilen\dpdata\data_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01fk92hg','E:\Oracle\oradata\vilen\VILEN\DATAFILE\trans01.dbf';<BR><BR>启动 backup 于 27-4月 -04<BR>使用通道 ORA_DISK_1<BR>通道 ORA_DISK_1: 启动数据文件转换<BR>输出文件名=E:\ORACLE\ORADATA\VILEN\DPDATA\DATA_D-EYGLE_I-1337390772_TS-TRANS_FNO-8_01FK92HG<BR>已转换的数据文件 = E:\ORACLE\ORADATA\VILEN\VILEN\DATAFILE\TRANS01.DBF<BR>通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:04<BR>完成 backup 于 27-4月 -04<BR><BR>RMAN></SPAN></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414032 style="FONT-SIZE: 12px">8.在目标数据库plugin数据文件<BR><BR><FONT color=blue>注意目标数据库中的目标用户必须存在<BR>否则会报错.</FONT><BR><BR>E:\Oracle\oradata\vilen\dpdata>impdp eygle/eygle dumpfile=trans.dmp directory=dpdata transport_datafiles='E:\Oracle\orad<BR>ata\vilen\VILEN\DATAFILE\TRANS01.DBF'<BR><BR>Import: Release 10.1.0.2.0 - Production on 星期二, 27 4月, 2004 15:02<BR><BR>Copyright (c) 2003, Oracle. All rights reserved.<BR><BR>连接到: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options<BR>已成功加载/卸载了主表 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01"<BR>启动 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01": eygle/******** dumpfile=trans.dmp directory=dpdata transport_datafiles='E:\<BR>Oracle\oradata\vilen\VILEN\DATAFILE\TRANS01.DBF'<BR>处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK<BR>ORA-39123: 数据泵可传输的表空间作业中止<BR><FONT color=red>ORA-29342: 数据库中不存在用户 TRANS<BR></FONT><BR>作业 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01" 因致命错误于 15:02 停止<BR><BR><BR>E:\Oracle\oradata\vilen\dpdata>sqlplus "/ as sysdba"<BR><BR>SQL*Plus: Release 10.1.0.2.0 - Production on 星期二 4月 27 15:03:03 2004<BR><BR>Copyright (c) 1982, 2004, Oracle. All rights reserved.<BR><BR><BR>连接到:<BR>Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options<BR><BR>SQL> create user trans identified by trans;<BR><BR>用户已创建。<BR><BR>SQL> grant connect,resource to trans;<BR><BR>授权成功。<BR><BR>SQL> exit<BR>从 Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options 断开<BR><BR>E:\Oracle\oradata\vilen\dpdata>impdp eygle/eygle dumpfile=trans.dmp directory=dpdata transport_datafiles='E:\Oracle\orad<BR>ata\vilen\VILEN\DATAFILE\TRANS01.DBF'<BR><BR>Import: Release 10.1.0.2.0 - Production on 星期二, 27 4月, 2004 15:03<BR><BR>Copyright (c) 2003, Oracle. All rights reserved.<BR><BR>连接到: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options<BR>已成功加载/卸载了主表 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01"<BR>启动 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01": eygle/******** dumpfile=trans.dmp directory=dpdata transport_datafiles='E:\<BR>Oracle\oradata\vilen\VILEN\DATAFILE\TRANS01.DBF'<BR>处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK<BR>处理对象类型 TRANSPORTABLE_EXPORT/TABLE<BR>处理对象类型 TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK<BR>作业 "EYGLE"."SYS_IMPORT_TRANSPORTABLE_01" 已于 15:03 成功完成</SPAN></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414036 style="FONT-SIZE: 12px">9.检查数据<BR><BR>E:\Oracle\oradata\vilen\dpdata>sqlplus trans/trans<BR><BR>SQL*Plus: Release 10.1.0.2.0 - Production on 星期二 4月 27 15:03:50 2004<BR><BR>Copyright (c) 1982, 2004, Oracle. All rights reserved.<BR><BR><BR>连接到:<BR>Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options<BR><BR>SQL> select count(*) from test;<BR><BR>COUNT(*)<BR>----------<BR>1<BR><BR>SQL> exit<BR>从 Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production<BR>With the Partitioning, OLAP and Data Mining options 断开<BR><BR>E:\Oracle\oradata\vilen\dpdata><BR><BR>可以选择把表空间更改为读写<BR><BR>SQL> alter tablespace trans read write;<BR><BR>表空间已更改。</SPAN></FONT></P> <P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text1414042 style="FONT-SIZE: 12px">10.总结<BR><BR>10g的表空间跨平台迁移,较9i就是增加了一个使用Rman进行的文件格式转换的过程.<BR>实际上也就是转换了数据文件头的格式信息而已.<BR><BR>然而这一简单改进带来的方便之处是显而易见的.</SPAN></FONT></P>
页:
[1]