SUMSEN

Oracle&Sql爱好者,用友NC管理员

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

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

目录的数据字典是dba_directories

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

要求导出scott用户下的emp表

这里两处错误

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

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

3,file改为dumpfile

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

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

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

C:\Documents and Settings\dell>expdp scott/tiger directory=su file=scottnoemp.dmp exclude=table:"IN('EMP')"

 

试一下NC用户的导出操作

有亮点


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

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

 

大小和exp的差不多

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

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

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

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

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

但是有错误提示:

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 完成)

posted on 2013-01-12 17:15  sumsen  阅读(2048)  评论(0编辑  收藏  举报