[oracle@seiang ~]$ impdp scott directory=imp_wjq tables=emp dumpfile=scott_emp_dept.dmplogfile=imp_scott_emp.log
Import: Release 12.2.0.1.0 - Production on Mon Apr 24 15:45:03 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0- 64bit Production
Master table "SCOTT"."SYS_IMPORT_TABLE_01"successfully loaded/unloaded
Starting "SCOTT"."SYS_IMPORT_TABLE_01": scott/******** directory=imp_wjq tables=empdumpfile=scott_emp_dept.dmp logfile=imp_scott_emp.log
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39151:Table "SCOTT"."EMP" exists. All dependent metadata and datawill be skipped due to table_exists_action of skip
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Job "SCOTT"."SYS_IMPORT_TABLE_01" completed with1 error(s) at Mon Apr 24 15:45:13 2017 elapsed 0 00:00:04
2.4 只导入scott用户下的emp,dept表结构;由于之前2.1、2.2、2.3导入的执行,所有的表都已成功导入,为了接下来的实验,我们把scott用户下存在的表都删掉;
[oracle@seiang ~]$ impdp scott directory=imp_wjq tables=emp,dept dumpfile=scott_emp_dept_meta.dmplogfile=imp_scott_emp_dept_meta.log
Import: Release 12.2.0.1.0 - Production on Mon Apr 24 15:59:16 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to: Oracle Database 12c Enterprise Edition Release12.2.0.1.0 - 64bit Production
Master table "SCOTT"."SYS_IMPORT_TABLE_01"successfully loaded/unloaded
Starting "SCOTT"."SYS_IMPORT_TABLE_01": scott/******** directory=imp_wjqtables=emp,dept dumpfile=scott_emp_dept_meta.dmplogfile=imp_scott_emp_dept_meta.log
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Job "SCOTT"."SYS_IMPORT_TABLE_01" successfullycompleted at Mon Apr 24 15:59:22 2017 elapsed 0 00:00:02
由于导出就是emp,dept两张表,所以也可以不指定tables,以下两种写法在这里都是可以的:
[oracle@seiang ~]$ impdp scott directory=imp_wjqdumpfile=scott_emp_dept_meta.dmp logfile=imp_scott_emp_dept_meta.log
或者
[oracle@seiang ~]$ impdp scott directory=imp_wjqdumpfile=scott_emp_dept_meta.dmp logfile=imp_scott_emp_dept_meta.log full=y