今天做了个Oracle数据库导入导出测试,出现了好多错误:
[oracle@linuxvm tmp]$ expdp GGS/GGS@SOURCEDB DIRECTORY=dpdata1 DUMPFILE=YZCX.dmp logfile=export.log TABLES=YZCX SCHEMAS=GGS;
Export: Release 11.2.0.3.0 - Production on Tue Mar 28 02:25:53 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
UDE-01017: operation generated ORACLE error 1017
ORA-01017: invalid username/password; logon denied
Username: UDE-00001: user requested cancel of current operation
这是由于impdp不允许schemas和tables同时存在而导致的,如果是按表导出就不能再写用户。
按需去掉其中之一即可。
同样在导入的时候也不能同时存在,要按需写。
[oracle@linuxvm tmp]$ impdp SOURCE_USER/oracle@SOURCEDB DIRECTORY=dpdata2 DUMPFILE=YZCX.dmp logfile=export1.log SCHEMAS=ggs REMAP_SCHEMA=GGS:SOURCE_USER REMAP_TABLESPACE=GGS:TS_SOURCE;
Import: Release 11.2.0.3.0 - Production on Tue Mar 28 02:18:15 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31655: no data or metadata objects selected for job
ORA-39039: Schema expression " IN ('GGS')" contains no valid schemas.
Master table "SOURCE_USER"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SOURCE_USER"."SYS_IMPORT_SCHEMA_01": SOURCE_USER/********@SOURCEDB DIRECTORY=dpdata2 DUMPFILE=YZCX.dmp logfile=export.log SCHEMAS=ggs REMAP_SCHEMA=GGS:SOURCE_USER REMAP_TABLESPACE=GGS:TS_SOURCE
Job "SOURCE_USER"."SYS_IMPORT_SCHEMA_01" successfully completed at 02:18:20
新手学习..大神请绕过...