ITPub博客

首页 > Linux操作系统 > Linux操作系统 > impdp 中要是没有remap方式

impdp 中要是没有remap方式

原创 Linux操作系统 作者:haqqcn 时间:2012-06-25 13:49:21 0 删除 编辑
impdp 中要是没有remap方式,那么个人认为datapump 将是一个死板的工具。
remap_table方式
语法格式:REMAP_TABLE=[schema.]old_tablename[.partition]:new_tablename
在hr 模式中根据employees 创建如下一张表。
SQL>create table emp as select * from employees where 1=2;
执行导入操作,tables 中指定了employees,因为dumpfile table.dmp
中除了employees 表中的数据以外,还有其他表的数据。关键是remap_table
参数的使用把employees 表中的数据从映射到emp 表,并且我们还使用了
conntent=data_only 参数,因为emp表已经存在,我们需要导入的只是数据。
C:\Users\hello>impdp hr/hr tables=employees remap_table=employees:emp dumpfile=dmp_dir:table.dmp nologfile=yes content=data_only
Import: Release 11.2.0.1.0 - Production on Sun Jun 24 09:35:22 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "HR"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "HR"."SYS_IMPORT_TABLE_01":  hr/******** tables=employees remap_table=employees:emp dumpfile=dmp_dir:table.dmp nologfile=yes content=data_only
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "HR"."EMP"                                  16.80 KB     107 rows
Job "HR"."SYS_IMPORT_TABLE_01" successfully completed at 09:35:26
导入成功,下面确定数据是否存在于remap_table 参数指定的表中。
SQL>select count(*) from emp;
  COUNT(*)
----------

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27098871/viewspace-733715/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2012-06-25

  • 博文量
    1
  • 访问量
    1391