本地使用impdp导出服务器转储文件,本地使用impdp导入远程数据库用户
1)expdp是可以在客户端上生成转储文件的2)impdp是可以在不同的实例之间进行数据的迁移复制的
练习1:1)将远程数据库WSJB用户使用expdp命令导出到本地磁盘的D:\下
Microsoft Windows [版本 6.1.7600]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\windows\system32>sqlplus system/system
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 1月 10 13:49:34 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> input 1 create public database link wsjb 2 connect to wsjb identified by wsjbcs 3 using 'xagxsi_16';数据库链接已创建。
SQL> select 1 from dual@wsjb; 1---------- 1
SQL> create directory chenzw as 'D:\';目录已创建。
SQL> grant read,write on directory chenzw to public;授权成功。
SQL> commit; 提交完成。
SQL>expdp system/system@orcl directory = chenzw dumpfile=wsjb20130110.dmp network_link=wsjb logfile=exp20130110.log schemas=wsjb
从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
C:\windows\system32>expdp system/system@orcl directory = chenzw dumpfile=wsjb20130110.dmp network_link=wsjb logfile=exp20130110.log schemas=wsjb
Export: Release 11.1.0.6.0 - Production on 星期四, 10 1月, 2013 13:54:23
Copyright (c) 2003, 2007, Oracle. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options启动 "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/********@orcl directory = chenzw dumpfile=wsjb20130110.dmp network_link=wsjb logfile=exp20130110.log schemas=wsjb 正在使用 BLOCKS 方法进行估计...处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA使用 BLOCKS 方法的总估计: 93.31 MB处理对象类型 SCHEMA_EXPORT/USER处理对象类型 SCHEMA_EXPORT/SYSTEM_GRANT处理对象类型 SCHEMA_EXPORT/ROLE_GRANT处理对象类型 SCHEMA_EXPORT/DEFAULT_ROLE处理对象类型 SCHEMA_EXPORT/TABLESPACE_QUOTA处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA处理对象类型 SCHEMA_EXPORT/SYNONYM/SYNONYM处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE处理对象类型 SCHEMA_EXPORT/TABLE/TABLE处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/INDEX处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS处理对象类型 SCHEMA_EXPORT/TABLE/COMMENT处理对象类型 SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC处理对象类型 SCHEMA_EXPORT/FUNCTION/FUNCTION处理对象类型 SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC处理对象类型 SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION处理对象类型 SCHEMA_EXPORT/VIEW/VIEW处理对象类型 SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT处理对象类型 SCHEMA_EXPORT/TABLE/TRIGGER处理对象类型 SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS. . 导出了 "WSJB"."IRAA07" 34.21 MB 5 行......此处省略N多行已成功加载/卸载了主表 "SYSTEM"."SYS_EXPORT_SCHEMA_01" ******************************************************************************SYSTEM.SYS_EXPORT_SCHEMA_01 的转储文件集为: D:\WSJB20130110.DMP作业 "SYSTEM"."SYS_EXPORT_SCHEMA_01" 已于 14:04:08 成功完成
练习2:1)将远程数据库WSJB用户使用impdp命令导入到本地的test用户下
impdp system/system@orcl directory = chenzw network_link = wsjb schemas = wsjb remap_schema=wsjb:test