如果是10g及以上版本,可以使用参数REMAP_TABLESPACE 来映射表空间 1.在ascii数据库中建立3个tablespaces:tbs1,tbs2,tbs3;
SQL> create tablespace tbs1 datafile 'tbs1_data1' size 10M;
SQL> create tablespace tbs2 datafile 'tbs2_data1' size 10M;
SQL> create tablespace tbs3 datafile 'tbs3_data1' size 10M;
SQL> create
tbs_t(a int ) partition by range(a)
3 partition tbs1 values less than (100),
4 partition tbs2 values less than (200),
5 partition tbs3 values less than (maxvalue));
SQL> select * from tbs_t;
E:/tmp>expdp scott/tiger directory=dump_dest tables=tbs_t parallel=2
Export: Release 10.2.0.1.0 - Production on Wednesday, 20 April, 2011 16:41:46
Copyright (c) 2003,
, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and
Mining options
Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** directory=dump_dest tables=tbs_t parallel=2
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "SCOTT"."TBS_T":"TBS1" 4.937 KB 3 rows
. . exported "SCOTT"."TBS_T":"TBS2" 4.945 KB 4 rows
. . exported "SCOTT"."TBS_T":"TBS3" 4.945 KB 4 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 16:41:55
5.将产生的”E:/TMP/EXPDAT.DMP”文件导入无分区数据库ocp10g;
SQL> select instance_name from v$instance;
SQL> select tablespace_name from dba_tablespaces;
------------------------------
E:/tmp>impdp scott/tiger dumpfile=expdat.dmp directory=dump_dest remap_tablespace=tbs1:usertbs remap_tablespace=tbs2:usertbs remap_tablespace=tbs3:usertbs
Import: Release 10.2.0.1.0 - Production on Wednesday, 20 April, 2011 16:47:09
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "SCOTT"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SCOTT"."SYS_IMPORT_FULL_01": scott/******** dumpfile=expdat.dmp directory=dump_dest remap_tablespace=tbs1:usertbs remap_tablespace=tbs2:use
rtbs remap_tablespace=tbs3:usertbs
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "SCOTT"."TBS_T":"TBS1" 4.937 KB 3 rows
. . imported "SCOTT"."TBS_T":"TBS2" 4.945 KB 4 rows
. . imported "SCOTT"."TBS_T":"TBS3" 4.945 KB 4 rows
Job "SCOTT"."SYS_IMPORT_FULL_01" successfully completed at 16:47:22
SQL> select * from tbs_t;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26015009/viewspace-1059905/,如需转载,请注明出处,否则将追究法律责任。