自包含性检查:
SQL> exec dbms_tts.transport_set_check('tb1,index1',TRUE);
PL/SQL procedure successfully completed
[@more@]SQL> select * from transport_set_violations;
VIOLATIONS
--------------------------------------------------------------------------------
表明 tb1和index1是自包含的
开始dump:
expdp system/admin dumpfile=expdat.dmp directory=dump_dir transport_tablespaces=tb1,index1 transport_full_check=Y
dump日志显示:
[oracle@tserver dump]$ cat export.log
;;;
Export: Release 10.2.0.1.0 - Production on Wednesday, 02 May, 2007 1:48:16
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
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": system/******** dumpfile=expdat.dmp directory=dump_dir transport_tablespaces=tb1,index1 transport_full_check=Y
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
/oradata/test/dump/expdat.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 01:48:32
在目标库上创建用户和directory:
SQL> create directory dd as 'd:oradataxtsdump';
目录已创建。
SQL>
SQL>
SQL>
SQL> grant read on directory dd to public;
授权成功。
SQL> grant write on directory dd to public;
授权成功。
SQL> create user test1 identified by "test1" default tablespace users quota unlimited on users;
用户已创建。
SQL> grant resource,connect to test1;
授权成功。
将dump文件和data文件传输到目标数据库dd directory下
在目标数据库上开始imp:
impdp system/admin dumpfile=expdat.dmp directory=dd transport_datafiles=d:oradataxtstb1_01.dbf d:orad
ataxtsindex1_01.dbf remap_schema=(ct:test1)
imp日志显示:
D:oradataxtsdump>type import.log
;;;
Import: Release 10.2.0.2.0 - Production on 星期三, 02 5月, 2007 2:07:03
Copyright (c) 2003, 2005, Oracle. All rights reserved.
;;;
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
已成功加载/卸载了主表 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01"
启动 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/******** dumpfile=expdat.dmp directory=dd transport_datafiles=d:oradata
xtstb1_01.dbf d:oradataxtsindex1_01.dbf remap_schema=(ct:test1)
处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
处理对象类型 TRANSPORTABLE_EXPORT/TABLE
处理对象类型 TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
作业 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" 已于 02:07:26 成功完成
在目标库上将tb1和index1表空间改为读写模式:
SQL> alter tablespace tb1 read write;
Tablespace altered
SQL> alter tablespace index1 read write;
Tablespace altered
检测table1表内容:
SQL> conn test1/test1
已连接。
SQL> select * from table1;
A B
---------- ----------
0 0
1 1
2 2
3 3
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7437037/viewspace-913118/ ,如需转载,请注明出处,否则将追究法律责任。