今学习了ORACLE数据泵导入导出数据,先用SCOTT示例数据库测试了一把,导出挺顺利,但是导入问题就出现了,怎么导都导不进提示找不到方案,最后终于找到问题发现结尾多打了一个分号,希望给刚学习ORACLE的朋友一些帮助.
1. sqlplus system/密码 as sysdba; //以数据管理员身份登陆数据库.
2. create directory scott_bak as 'D:\app\niewd\admin\orcl\dpdump'; //DIRECTORY指定数据库备份路径及备份文件名称,切记备份文件名在恢复时注意大小写,
3.grant read.write on directory scott_bak to scott; //赋予SCOTT其读写备份目录;
4. expdp scott/tiger schemas=scott dumpfile=scott_bak.dmp logfile=scott_bak.log directory=scott_bak //导出数据
5. impdp scott/tiger directory=SCOTT_BAK logfile=scott1_bak.log dumpfile=scott_bak.dmp schemas=scott //导入备份数据
以下为操作时出现的错误:
C:\Users\Administrator>impdp scott/tiger directory=SCOTT_BAK logfile=scott_bak.log dumpfile=scott_ba
k.dmp schemas=scott;
Import: Release 11.2.0.1.0 - Production on 星期四 5月 14 20:45:00 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: 操作无效
ORA-39165: 未找到方案 scott;。
C:\Users\Administrator>sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on 星期四 5月 14 20:47:42 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
请输入用户名: scott
输入口令:
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
C:\Users\Administrator>impdp sys/clyg1234 directory=SCOTT_BAK logfile=scott_bak.log dumpfile=scott_b
ak.dmp schemas=scott;
Import: Release 11.2.0.1.0 - Production on 星期四 5月 14 21:11:18 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
UDI-01017: 操作产生了 ORACLE 错误 1017
ORA-01017: invalid username/password; logon denied
用户名:
UDI-00005: 读取输入值时出现意外的文件结尾。
C:\Users\Administrator>
C:\Users\Administrator>impdp scott/tiger directory=SCOTT_BAK logfile=scott1_bak.log dumpfile=scott_b
ak.dmp schemas=scott
Import: Release 11.2.0.1.0 - Production on 星期四 5月 14 21:13:35 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已成功加载/卸载了主表 "SCOTT"."SYS_IMPORT_SCHEMA_01"
启动 "SCOTT"."SYS_IMPORT_SCHEMA_01": scott/******** directory=SCOTT_BAK logfile=scott1_bak.log dump
file=scott_bak.dmp schemas=scott
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE
ORA-31684: 对象类型 SEQUENCE:"SCOTT"."SEQ_PERSONAL_INFO" 已存在
ORA-31684: 对象类型 SEQUENCE:"SCOTT"."SEQ_STUDENT" 已存在
ORA-31684: 对象类型 SEQUENCE:"SCOTT"."SEQ_TB_SHOP" 已存在
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
. . 导入了 "SCOTT"."MEMBER" 1.137 MB 17357 行
. . 导入了 "SCOTT"."BONUS" 6.210 KB 1 行
. . 导入了 "SCOTT"."DEPT" 6.015 KB 8 行
. . 导入了 "SCOTT"."EMP" 8.570 KB 14 行
. . 导入了 "SCOTT"."PERSONAL_INFO" 7.101 KB 2 行
. . 导入了 "SCOTT"."SALGRADE" 5.867 KB 5 行
. . 导入了 "SCOTT"."SCORE" 6.414 KB 9 行
. . 导入了 "SCOTT"."STUDENT" 7.281 KB 6 行
. . 导入了 "SCOTT"."TB_SHOPTYPE" 5.882 KB 2 行
. . 导入了 "SCOTT"."DEPT1" 0 KB 0 行
. . 导入了 "SCOTT"."TB_SHOP" 0 KB 0 行
处理对象类型 SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/INDEX
处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
处理对象类型 SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
作业 "SCOTT"."SYS_IMPORT_SCHEMA_01" 已经完成, 但是有 3 个错误 (于 21:13:40 完成)