设为首页 加入收藏

TOP

数据泵expdp,impdp使用结(二)
2015-07-24 11:20:58 来源: 作者: 【 】 浏览:23
Tags:数据 expdp impdp 使用
20 成功完成


C:\Users\Administrator>

6.授权:expdp,impdp权限授予


SQL> grant imp_full_database,exp_full_database to hr_exp;

授权成功。

SQL>
7.本机导入

C:\Users\Administrator>impdp hr_exp/hr_exp directory=DIR_EXP dumpfile=hr_201410
7.dmp remap_schema=hr:hr_exp exclude=statistics

Import: Release 10.2.0.1.0 - Production on 星期一, 27 10月, 2014 16:54:42

Copyright (c) 2003, 2005, Oracle. All rights reserved.

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已成功加载/卸载了主表 "HR_EXP"."SYS_IMPORT_FULL_02"
启动 "HR_EXP"."SYS_IMPORT_FULL_02": hr_exp/******** directory=DIR_EXP dumpfile
hr_20141027.dmp remap_schema=hr:hr_exp exclude=statistics
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
. . 导入了 "HR_EXP"."COUNTRIES" 5.992 KB 25 行
. . 导入了 "HR_EXP"."DEPARTMENTS" 6.632 KB 27 行
. . 导入了 "HR_EXP"."EMPLOYEES" 15.76 KB 107 行
. . 导入了 "HR_EXP"."JOBS" 6.609 KB 19 行
. . 导入了 "HR_EXP"."JOB_HISTORY" 6.585 KB 10 行
. . 导入了 "HR_EXP"."LOCATIONS" 7.710 KB 23 行
. . 导入了 "HR_EXP"."REGIONS" 5.289 KB 4 行
处理对象类型 SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/INDEX
处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
处理对象类型 SCHEMA_EXPORT/TABLE/COMMENT
处理对象类型 SCHEMA_EXPORT/PROCEDURE/PROCEDURE
处理对象类型 SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
处理对象类型 SCHEMA_EXPORT/VIEW/VIEW
处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
处理对象类型 SCHEMA_EXPORT/TABLE/TRIGGER
作业 "HR_EXP"."SYS_IMPORT_FULL_02" 已于 16:54:51 成功完成


遇到的问题:未授权

C:\Users\Administrator>impdp hr_exp/hr_exp directory=DIR_EXP dumpfile=hr_20141027.dmp remap_schema=hr:hr_exp exclude=statistics


Import: Release 10.2.0.1.0 - Production on 星期一, 27 10月, 2014 16:51:35

Copyright (c) 2003, 2005, Oracle. All rights reserved.

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORA-31631: 需要权限
ORA-39122: 未授权的用户不能执行 REMAP_SCHEMA 重新映射。


解决方法
C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 10月 27 16:52:40 2014

Copyright (c) 1982, 2005, Oracle. All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> grant imp_full_database,exp_full_database to hr_exp;

授权成功。

SQL>


其他备注:
hr_exp 本地用户,用来连接远端数据库服务器
DIR_EXP 本地用户下hr_exp的 directory 用户本地指定expdp写入目录,这里是D盘direxp文件夹
to_exp_hr 本地hr_exp用户下的 db link ,用来连接远端数据库服务器

本机EXP数据导出方式:
--这里以SCOTT为例
C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 10月 27 17:11:23 2014

Copyright (c) 1982, 2005, Oracle. All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> grant connect,resource,create database link to scott;

授权成功。

SQL> grant imp_full_database,exp_full_database to hr_exp;

授权成功。

SQL> grant read,write on directory DIR_EXP to scott;

授权成功。

--全部导出(expdp scott/scott@192.168.11.1:1521/orcl directory=DIR_EXP dumpfile=scott_full.dmp logfile=scott_full.log )

C:\Users\Administrator>expdp scott/scott@192.168.11.1:1521/orcl directory=DIR_EXP dumpfile=scott_full.dmp logfile=scott_full.log


Export: Release 1

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 2/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇DB2使用Hibernate拦截器实现脏读.. 下一篇数据库中导出表中相应字段到指定..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·工业机器人TCP校准中 (2025-12-25 05:19:17)
·opc 通讯协议与 TCP (2025-12-25 05:19:15)
·labview中tcp/ip通信 (2025-12-25 05:19:13)
·新书介绍《Python数 (2025-12-25 04:49:47)
·怎么利用 Python 进 (2025-12-25 04:49:45)