数据泵导出文件更换名称,对导入操作无影响

问题描述: expdp 导出 dmp文件 ,但是导出操作时,dmp文件命名有误。 mv将导出后的dmp文件重命名。这样对 impdp 操作会有什么影响呢?
结论:  只要命令敲对,文件名写正确,impdp操作不受影响



一、模拟开始

      scott用户下的表

点击(此处)折叠或打开

  1. SQL> conn scott/tiger
  2. Connected.
  3. SQL>
  4. SQL> select count(*) from tab;

  5.   COUNT(*)
  6. ----------
  7.      4

  8. SQL> select * from tab;

  9. TNAME             TABTYPE    CLUSTERID
  10. ------------------------------ ------- ----------
  11. BONUS             TABLE
  12. DEPT             TABLE
  13. EMP             TABLE
  14. SALGRADE         TABLE
  新建用户liuyaya下的表

点击(此处)折叠或打开

  1. SQL> conn / as sysdba
  2. Connected.
  3. SQL>
  4. SQL>
  5. SQL> create user liuyaya identified by oracle account unlock;


  6. User created.

  7. SQL> SQL>
  8. SQL>
  9. SQL>
  10. SQL> grant connect,resource to liuyaya;

  11. Grant succeeded.

  12. SQL>
  13. SQL> conn liuyaya/oracle
  14. Connected.
  15. SQL> select count(1) from tab;

  16.   COUNT(1)
  17. ----------
  18.      0
   数据泵导出scott用户下的表

点击(此处)折叠或打开

SQL> conn sys/oracle as sysdba
Connected.
SQL> create or replace directory expdp_dir_scott01 as '/soft';

Directory created.

SQL> grant read,write on directory expdp_dir_scott01 to scott;

Grant succeeded.

SQL> exit


点击(此处)折叠或打开

[oracle@redhat6 ~]$ expdp scott/tiger directory=expdp_dir_scott01 schemas=scott datafile=scott01.dmp logfile=scott01.log parallel=2;
LRM-00101: unknown parameter name 'datafile'

[oracle@redhat6 ~]$ expdp scott/tiger directory=expdp_dir_scott01 schemas=scott dumpfile=scott01.dmp logfile=scott01.log parallel=2;

Export: Release 11.2.0.4.0 - Production on Thu Jun 21 19:15:52 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=expdp_dir_scott01 schemas=scott dumpfile=scott01.dmp logfile=scott01.log parallel=2
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
. . exported "SCOTT"."SALGRADE" 5.859 KB 5 rows
. . exported "SCOTT"."BONUS" 0 KB 0 rows
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
  /soft/scott01.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Thu Jun 21 19:16:13 2018 elapsed 0 00:00:20
   修改dumpfile文件名


点击(此处)折叠或打开

[oracle@redhat6 ~]$ cd /soft
[oracle@redhat6 soft]$ ls
database scott01.dmp scott01.log zjgd_back
[oracle@redhat6 soft]$ mv scott01.dmp liuyaya.dmp
[oracle@redhat6 soft]$ ls
database liuyaya.dmp scott01.log zjgd_back

导入到新建用户liuyaya

点击(此处)折叠或打开

[oracle@redhat6 soft]$ impdp \'/ as sysdba\' directory=expdp_dir_scott01 dumpfile=liuyaya.dmp remap_schema=scott:liuyaya logfile=liuyaya.log parallel=2

Import: Release 11.2.0.4.0 - Production on Thu Jun 21 20:18:01 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_FULL_01": "/******** AS SYSDBA" directory=expdp_dir_scott01 dumpfile=liuyaya.dmp remap_schema=scott:liuyaya logfile=liuyaya.log parallel=2
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "LIUYAYA"."DEPT" 5.929 KB 4 rows
. . imported "LIUYAYA"."EMP" 8.562 KB 14 rows
. . imported "LIUYAYA"."SALGRADE" 5.859 KB 5 rows
. . imported "LIUYAYA"."BONUS" 0 KB 0 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYS"."SYS_IMPORT_FULL_01" successfully completed at Thu Jun 21 20:18:05 2018 elapsed 0 00:00:02

[oracle@redhat6 soft]$ sqlplus liuyaya/oracle

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 21 20:18:18 2018

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from tab;

TNAME             TABTYPE    CLUSTERID
------------------------------ ------- ----------
BONUS             TABLE
DEPT             TABLE
EMP             TABLE
SALGRADE         TABLE

二、 总结

将改了名字的dmp文件顺利导入到其他schema下,证明

    
数据库导出文件可以改名字,对导入操作无影响







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

转载于:http://blog.itpub.net/31405405/viewspace-2156496/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值