暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle IMPDP方法之间的区别

ASKTOM 2020-05-27
410

问题描述

你好团队
不久前,我在数据库导入方面遇到问题。我设法做到了,但我仍然有一个问题

1.有什么区别

expdp system/system schemas=ieulive directory=dir1 dumpfile=dump1.dmp logfile=exp.log
impdp system/system remap_schema=ieulive:ieulive2 directory=dir2 dumpfile=dump1.dmp logfile=imp.log




expdp ieulive/ieulive directory=dir1 dumpfile=dump1.dmp logfile=exp.log

sql>grant connect, resource, dba to ieulive2 identified by ieulive2;

impdp ieulive2/ieulive2 directory=dir2 dumpfile=dump1.dmp logfile=imp.log


2.我可以交互使用它们吗,比如:
expdp system/system schemas=ieulive directory=dir1 dumpfile=dump1.dmp logfile=exp.log
impdp ieulive2/ieulive2 directory=dir2 dumpfile=dump1.dmp logfile=imp.log

或者
expdp ieulive/ieulive directory=dir1 dumpfile=dump1.dmp logfile=exp.log
impdp system/system remap_schema=ieulive:ieulive2 directory=dir2 dumpfile=dump1.dmp logfile=imp.log


3.添加时的情况是一样的
full=y

对吗?

希望你明白我的问题
问候

专家解答

他们是不同的。例如,我导出了SCOTT架构,然后尝试将该连接作为演示导入

C:\temp>impdp userid=demo/demo@db19_pdb1 dumpfile=SCOTT.DMP directory=temp

Import: Release 19.0.0.0.0 - Production on Thu May 28 11:07:21 2020
Version 19.6.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39154: Objects from foreign schemas have been removed from import
Master table "DEMO"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "DEMO"."SYS_IMPORT_FULL_01":  userid=demo/********@db19_pdb1 dumpfile=SCOTT.DMP directory=temp
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "DEMO"."SYS_IMPORT_FULL_01" successfully completed at Thu May 28 11:07:27 2020 elapsed 0 00:00:04


它 * 看起来 * 成功,但我这样做:

SQL> conn demo/demo@db19_pdb1
Connected.

SQL> select * from obj;

no rows selected



那里什么都没有,因为我在寻找属于演示的东西,而转储中没有。

最终,无论我连接的是谁,我仍然需要相同的remp_schema参数

C:\temp>impdp userid=demo/demo@db19_pdb1 dumpfile=SCOTT.DMP directory=temp remap_schema=scott:demo

Import: Release 19.0.0.0.0 - Production on Thu May 28 11:09:13 2020
Version 19.6.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table "DEMO"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "DEMO"."SYS_IMPORT_FULL_01":  userid=demo/********@db19_pdb1 dumpfile=SCOTT.DMP directory=temp remap_schema=scott:demo
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 "DEMO"."EMP"                                8.773 KB      14 rows
. . imported "DEMO"."DEPT"                               6.023 KB       4 rows
. . imported "DEMO"."SALGRADE"                           5.953 KB       5 rows
. . imported "DEMO"."BONUS"                                  0 KB       0 rows
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
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
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "DEMO"."SYS_IMPORT_FULL_01" successfully completed at Thu May 28 11:09:27 2020 elapsed 0 00:00:14


在所有情况下,您都可以使用交互模式。

全数据泵需要DBA特权 (或底层的全导出/导入特权)
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论