ITPub博客

首页 > 数据库 > Oracle > impdp 把表数据和索引分别导入不同的表空间

impdp 把表数据和索引分别导入不同的表空间

原创 Oracle 作者:myocp 时间:2015-05-21 13:29:39 0 删除 编辑
一、数据导出
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博客 ” ,链接:https://blog.itpub.net/26589291/viewspace-1665331/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-01-04

  • 博文量
    3
  • 访问量
    20600