Oracle 10g新特性之-跨平台表空间传输(二)

2014-11-24 18:59:04 · 作者: · 浏览: 50
duction on Tuesday, 27 April, 2004 14:07


Copyright (c) 2003, Oracle. All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "wwl"."SYS_EXPORT_TRANSPORTABLE_01": wwl/******** dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans
ORA-39123: Data Pump transportable tablespace job aborted
ORA-29335: tablespace 'TRANS' is not read only


Job "wwl"."SYS_EXPORT_TRANSPORTABLE_01" stopped due to fatal error at 14:08


注意:传输表空间必须置为只读状态


$ sqlplus "/ as sysdba"


SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr 27 14:08:13 2004


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



Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options


SQL> alter tablespace trans read only;


Tablespace altered.


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options



$ expdp wwl/wwl dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans


Export: Release 10.1.0.2.0 - 64bit Production on Tuesday, 27 April, 2004 14:08


Copyright (c) 2003, Oracle. All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "wwl"."SYS_EXPORT_TRANSPORTABLE_01": wwl/******** dumpfile=trans.dmp directory=dpdata TRANSPORT_TABLESPACES=trans
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK
Master table "wwl"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for wwl.SYS_EXPORT_TRANSPORTABLE_01 is:
/opt/oracle/dpdata/trans.dmp
Job "wwl"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 14:09


4.使用rman转换文件格式



$ rman target /


Recovery Manager: Release 10.1.0.2.0 - 64bit Production


Copyright (c) 1995, 2004, Oracle. All rights reserved.


connected to target database: wwl (DBID=1337390772)


RMAN> convert tablespace trans
2> to platform 'Microsoft Windows IA (32-bit)'
3> Format '/tmp/%U';


Starting backup at 27-APR-04
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=148 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00008 name=/data1/oradata/systemfile/trans01.dbf
converted datafile=/tmp/data_D-wwl_I-1337390772_TS-TRANS_FNO-8_01fk92hg
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Finished backup at 27-APR-04


RMAN> exit



Recovery Manager complete.


5.确认导出文件已生成


$ ls /tmp/data*
/tmp/data_D-wwl_I-1337390772_TS-TRANS_FNO-8_01fk92hg
$ ls -l /tmp/data*
-rw-r----- 1 oracle dba 10493952 Apr 27 14:12 /tmp/data_D-wwl_I-1337390772_TS-TRANS_FNO-8_01fk92hg
$ chmod 777 /tmp/data*
$ chmod 777 /opt/oracle/dpdata/*


6.通过ftp传输文件至目标主机


220 billing-center.hurray.com.cn FTP server (SunOS 5.8) ready.
User (192.168.96.10none)): gqgai
331 Password required for gqgai.
Password:
230 User gqgai logged in.
ftp> bin
200 Type set to I.
ftp> cd /tmp
250 CWD command successful.
ftp> mget data*