数据泵需要在本地执行,不可以远程登录操作。

数据泵需要建立目录directory  --sys下 create directory su as 'd:\xs'

目录的数据字典是dba_directories

SYS@ncbeta>select owner,directory_name,directory_path from  dba_directories;

expdp数据泵导出操作

要求导出scott用户下的emp表

expdp数据泵导出操作

这里两处错误

1,导出命令没有限制emp表而是全部

2,scott用户没有directory SU的访问权

3,file改为dumpfile

SYS@ncbeta>grant read,write on directory su to scott;

expdp数据泵导出操作

C:\Documents and Settings\dell>expdp scott/tiger directory=su file=scottemp.dmp tables=scott.emp

expdp数据泵导出操作

如果操作要求是导出除去emp的scott表

C:\Documents and Settings\dell>expdp scott/tiger directory=su file=scottnoemp.dmp exclude=table:"IN('EMP')"
expdp数据泵导出操作

 

试一下NC用户的导出操作

有亮点


SYS@ncbeta>grant read,write on directory su to xmv502;

C:\Documents and Settings\dell>expdp xmv502/nc502 directory=su file=xmv5expdp.dmp

expdp数据泵导出操作

 

expdp数据泵导出操作

expdp数据泵导出操作

大小和exp的差不多

 2013-03-04 20:26:00 更新:

原来也可以直接在sql中写,只需要前面加上host

SYS@jsce>host expdp scott/tiger directory=su file=scottemp2.dmp tables=scott.emp

expdp数据泵导出操作

11g新特性,导入的时候重命名表:

SYS@jsce>host impdp scott/tiger directory=su file=scottemp2.dmp remap_table=emp:emp_new

expdp数据泵导出操作

但是有错误提示:

Import: Release 11.2.0.1.0 - Production on 星期一 3月 4 20:30:10 2013

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
;;; 由于以下参数, 旧有模式处于活动状态:
;;; 旧有模式参数: "file=scottemp2.dmp" 位置: Command Line, 替换为: "dumpfile=scottemp2.dmp"
已成功加载/卸载了主表 "SCOTT"."SYS_IMPORT_FULL_01"
启动 "SCOTT"."SYS_IMPORT_FULL_01": scott/******** directory=su dumpfile=scottemp2.dmp remap_table=emp:emp_new
处理对象类型 TABLE_EXPORT/TABLE/TABLE
处理对象类型 TABLE_EXPORT/TABLE/TABLE_DATA
. . 导入了 "SCOTT"."EMP_NEW" 8.632 KB 16 行
处理对象类型 TABLE_EXPORT/TABLE/INDEX/INDEX
ORA-31684: 对象类型 INDEX:"SCOTT"."PK_EMP" 已存在
处理对象类型 TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
ORA-31684: 对象类型 CONSTRAINT:"SCOTT"."PK_EMP" 已存在
处理对象类型 TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
ORA-39111: 跳过从属对象类型 INDEX_STATISTICS, 基本对象类型 INDEX:"SCOTT"."PK_EMP" 已存在
处理对象类型 TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-31684: 对象类型 REF_CONSTRAINT:"SCOTT"."FK_DEPTNO" 已存在
处理对象类型 TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
作业 "SCOTT"."SYS_IMPORT_FULL_01" 已经完成, 但是有 4 个错误 (于 20:30:16 完成)

相关文章:

  • 2021-08-02
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-11-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-06-24
  • 2021-09-24
  • 2022-01-23
  • 2022-02-09
相关资源
相似解决方案