一、数据导出
expdp test/test directory=dump_dir dumpfile=test.dmp logfile=test_expdp.log tables=userinfo
——利用expdp 语句导出具体数据,如果是导出整个用户下数据,去掉 tables 参数
二、把数据导入数据表空间
impdp test/test directory=dump_dir dumpfile=test.dmp logfile=impdp_data.log remap_tablespace=system:datatb exclude=index
注释:
remap_tablespace=system:datatb ——更换数据的原system表空间为datatb数据表空间
exclude=index ——导入过程中不创建索引,导入除索引外的其它所有对象
三、把索引创建到指定的索引表空间
impdp test/test directory=dump_dir dumpfile=test.dmp logfile=impdp_index.log remap_tablespace=system:idxtb include=index
注释:
remap_tablespace=system:idxtb 更换索引表空间
include=index 创建索引,仅仅导入索引
四、查询确认
select segment_name,tablespace_name from dba_segments where owner='TEST';
通过以上语句确认表数据和索引数据是否导入到指定的表空间中。
expdp test/test directory=dump_dir dumpfile=test.dmp logfile=test_expdp.log tables=userinfo
——利用expdp 语句导出具体数据,如果是导出整个用户下数据,去掉 tables 参数
二、把数据导入数据表空间
impdp test/test directory=dump_dir dumpfile=test.dmp logfile=impdp_data.log remap_tablespace=system:datatb exclude=index
注释:
remap_tablespace=system:datatb ——更换数据的原system表空间为datatb数据表空间
exclude=index ——导入过程中不创建索引,导入除索引外的其它所有对象
三、把索引创建到指定的索引表空间
impdp test/test directory=dump_dir dumpfile=test.dmp logfile=impdp_index.log remap_tablespace=system:idxtb include=index
注释:
remap_tablespace=system:idxtb 更换索引表空间
include=index 创建索引,仅仅导入索引
四、查询确认
select segment_name,tablespace_name from dba_segments where owner='TEST';
通过以上语句确认表数据和索引数据是否导入到指定的表空间中。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26589291/viewspace-1665331/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26589291/viewspace-1665331/