从服务器导出数据库文件到本地,当地使用impdp导出服务器转储文件,本地使用impdp导入远程数据库用户...

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 -

Production

With 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>

1

----------

1

SQL> create directory chenzw as

‘D:\‘;

目录已创建。

SQL> grant read,write on directory chenzw to

public;

授权成功。

SQL> commit;

提交完成。

SQL>expdp [email protected] directory = chenzw

dumpfile=wsjb20130110.dmp network_link=wsjb logfile=exp20130110.log

schemas=wsjb

从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -

Production

With the Partitioning, OLAP, Data Mining and Real Application Testing

options 断开

C:\windows\system32>expdp [email protected] 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 -

Production

With the Partitioning, OLAP, Data Mining and Real Application Testing

options

启动 "SYSTEM"."SYS_EXPORT_SCHEMA_01":  [email protected] 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_E本地使用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 -

Production

With 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>

1

----------

1

SQL> create directory chenzw as

‘D:\‘;

目录已创建。

SQL> grant read,write on directory chenzw to

public;

授权成功。

SQL> commit;

提交完成。

SQL>expdp [email protected] directory = chenzw

dumpfile=wsjb20130110.dmp network_link=wsjb logfile=exp20130110.log

schemas=wsjb

从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -

Production

With the Partitioning, OLAP, Data Mining and Real Application Testing

options 断开

C:\windows\system32>expdp [email protected] 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 -

Production

With the Partitioning, OLAP, Data Mining and Real Application Testing

options

启动 "SYSTEM"."SYS_EXPORT_SCHEMA_01":  [email protected] 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 [email protected] directory = chenzw network_link =

wsjb schemas = wsjb remap_schema=wsjb:test

XPORT/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 成功完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值