[oracle@seiang ~]$ impdp system directory=imp_wjq dumpfile=scott_meta.dmplogfile=imp_scott_meta.log
Import: Release 12.2.0.1.0 - Production on Mon Apr 24 15:26:30 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 "SYSTEM"."SYS_IMPORT_FULL_01"successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** directory=imp_wjqdumpfile=scott_meta.dmp logfile=imp_scott_meta.log
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfullycompleted at Mon Apr 24 15:27:15 2017 elapsed 0 00:00:20
2.2 导入scott用户的数据;只有在2.1导入元数据后才可以导入数据。
[oracle@seiang ~]$ impdp system directory=imp_wjq dumpfile=scott_data.dmplogfile=imp_scott_data.log
Import: Release 12.2.0.1.0 - Production on Mon Apr 24 15:29:27 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 "SYSTEM"."SYS_IMPORT_FULL_01"successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** directory=imp_wjqdumpfile=scott_data.dmp logfile=imp_scott_data.log
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SCOTT"."DEPT" 5.929 KB 4 rows
. . imported "SCOTT"."EMP" 8.562 KB 14 rows
. . imported "SCOTT"."SALGRADE" 5.859 KB 5 rows
. . imported "SCOTT"."BONUS" 0 KB 0 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfullycompleted at Mon Apr 24 15:29:44 2017 elapsed 0 00:00:12
2.3 只导入scott用户下的emp表及数据;[oracle@seiang ~]$ impdp scott directory=imp_wjq tables=empdumpfile=scott_emp_dept.dmp logfile=imp_scott_emp.log
Import: Release 12.2.0.1.0 - Production on Mon Apr 24 15:40:56 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
ORA-39002:invalid operation
ORA-39070:Unable to open the log file.
ORA-39087:directory name IMP_WJQ is invalid
因为在导入的时候没有给imp_wjq目录赋予read和write的权限,所以会出现上面的错误,下面就给imp_wjq目录授权: