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