数据泵是服务器端工具,导出的文件是放在数据库所在的服务器上,当然我们知道可以通过directory目录对象来控制。目录对象默认有四个级别,当然是有优先级顺序的,优先级从上往下

1.每个文件单独的指定具体的目录

2.expdp导出时,指定的目录参数

3.用户定义的环境变量DATA_PUMP_DIR指定的目录

4.默认的目录对象DATA_PUMP_DIR

当然了对于Oracle11g R2来说,又引入了一个可选项,我们就当是5

5.DATA_PUMP_DIR_SCHEMA_NAME目录

create or replace directory DATA_PUMP_DIR as 'D:\app\Administrator\admin\orcl\dpdump';  修改默认的DATA_PUMP_DIR路径

一、默认的目录对象DATA_PUMP_DIR测试

create or replace directory DATA_PUMP_DIR as 'D:\app\Administrator\admin\orcl\dpdump';    //改变默认DATA_PUMP_DIR位置

SQL>  desc dba_directories

Name                                                              Null?    Type

----------------------------------------------------------------- -------- ---------------------- OWNER                                                            NOT NULL VARCHAR2(30)

DIRECTORY_NAME                                                    NOT NULL VARCHAR2(30)

DIRECTORY_PATH                                                            VARCHAR2(4000)

SQL> set linesize 120 pagesize 100

SQL> col OWNER for a5

SQL> col DIRECTORY_NAME for a22

SQL> col DIRECTORY_PATH for a80

SQL> select * from dba_directories;

OWNER DIRECTORY_NAME        DIRECTORY_PATH

----- ---------------------- ----------------------------------------------------------

SYS  SUBDIR                /u01/app/oracle/product/11.2.0/db/demo/schema/order_entry//2002/Sep

SYS  SS_OE_XMLDIR          /u01/app/oracle/product/11.2.0/db/demo/schema/order_entry/

SYS  LOG_FILE_DIR          /u01/app/oracle/product/11.2.0/db/demo/schema/log/

SYS  MEDIA_DIR              /u01/app/oracle/product/11.2.0/db/demo/schema/product_media/

SYS  XMLDIR                /u01/app/oracle/product/11.2.0/db/rdbms/xml

SYS  DATA_FILE_DIR          /u01/app/oracle/product/11.2.0/db/demo/schema/sales_history/

SYS  DATA_PUMP_DIR          /u01/app/oracle/admin/tj01/dpdump/

SYS  ORACLE_OCM_CONFIG_DIR  /u01/app/oracle/product/11.2.0/db/ccr/state

通过查询我们看到,所有的目录都属于SYS用户,而不管是哪个用户创建的,在数据库里已经提前建好了这个目录对象DATA_PUMP_DIR。如果在使用expdp导出时,不指定目录对象参数,Oracle会使用数据库缺省的目录DATA_PUMP_DIR,不过如果想使用这个目录的话,用户需要具有exp_full_database的权限才行

SQL> conn scott/tiger

Connected.

SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID

------------------------------ ------- ----------

BONUS                          TABLE

DEPT                          TABLE

EMP                            TABLE

SALGRADE                      TABLE

SQL> create table demo as select empno,ename,sal,deptno from emp;

Table created.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

由于没有exp_full_database,所以这样的导出会报错,你可以选择授权或者使用有权限的用户

[oracle@asm11g ~]$ expdp scott/tiger dumpfile=emp.dmp tables=emp

Export: Release 11.2.0.3.0 - Production on Fri Nov 16 13:48:19 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

ORA-39002: invalid operation

ORA-39070: Unable to open the log file.

ORA-39145: directory object parameter must be specified and non-null

[oracle@asm11g ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 16 13:58:14 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> grant exp_full_database to scott;

Grant succeeded.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

授权之后,导出成功,并且导出的文件和日志会到DATA_PUMP_DIR对象指定的目录

[oracle@asm11g ~]$ expdp scott/tiger dumpfile=emp.dmp tables=emp

Export: Release 11.2.0.3.0 - Production on Fri Nov 16 13:58:52 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** dumpfile=emp.dmp tables=emp

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

. . exported "SCOTT"."EMP"                              8.562 KB      14 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/u01/app/oracle/admin/tj01/dpdump/emp.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 13:59:05

对于oracle11g来说,我们还可以定义一个新的目录对象,对象名称是DATA_PUMP_DIR_SCHEMA_NAME,如果定义了这个目录对象,并授予权限,在用户导出没有指定

具体的目录参数的情况下,导出文件会到这个目录

[oracle@asm11g ~]$ mkdir sdir

[oracle@asm11g ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 16 14:13:06 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> create directory data_pump_dir_scott as '/home/oracle/sdir';

Directory created.

SQL> grant read,write on  directory data_pump_dir_scott to scott;

Grant succeeded.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[oracle@asm11g ~]$ expdp scott/tiger dumpfile=emp1.dmp tables=emp

Export: Release 11.2.0.3.0 - Production on Fri Nov 16 14:14:29 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

Database Directory Object has defaulted to: "DATA_PUMP_DIR_SCOTT".

Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** dumpfile=emp5.dmp tables=emp

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

. . exported "SCOTT"."EMP"                              8.562 KB      14 rows

Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

/home/oracle/sdir/emp1.dmp

Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 14:14:34

来自:https://www.linuxidc.com/Linux/2013-05/83774.htm

Oracle 数据库导出数据泵(EXPDP)文件存放的位置的更多相关文章

  1. Oracle数据库采用数据泵方式导入导出数据

    特别说明:Oralce的数据泵导入导出技术只能用在数据库服务器上,在只有客户端的机器上是无法使用数据泵技术的. 1.创建备份文件目录  mkdir d:\dmp 2.在Oralce中注册该目录,将目录 ...

  2. oracle 数据库导出数据

    cmd导出数据: exp  ZD_ZD_ZDWW/zdzd1402!@11.111.111.213/orcl file=c:\1234.dmp owner=ZD_ZD_ZDWW

  3. oracle之 数据泵dump文件存放nfs报ORA-27054

    问题描述:源端 10.2.0.4  目标端:11.2.0.4   在目标端划分1T存储与源端做一个NFS 错误:指定dump导出为本地文件系统,正常.   指定dump导出为nfs文件系统,报错. 报 ...

  4. Oracle SQLPlus导出数据到csv文件

    时不时地我们需要导出一些数据用作备份.查看报表等,如果用Sql Developer导出会非常慢.而用SqlPlus,则速度非常快. 准备SQL执行文件export.sql: set colsep , ...

  5. 使用数据泵expdp、impdp备份和还原oracle数据库

    前面我已经整理过EXP 和 IMP备份和还原Oracle数据库的方法 今天我们只讲使用数据泵 expdp 和impdp的方法,有的同学会问他们有什么差别呢? EXP和IMP是客户端工具程序,它们既可以 ...

  6. Oracle使用数据泵导入/导出数据(expdp/impdp)

    Oracle使用数据泵导入/导出数据(expdp/impdp) A电脑上的操作(expdp数据导出) 运行cmd: 登录数据库,输入命令:sqlplus 使用管理员角色登录需要在用户名后加" ...

  7. 用数据泵技术实现逻辑备份Oracle 11g R2 数据泵技术详解(expdp impdp)

    用数据泵技术实现逻辑备份 from:https://blog.csdn.net/weixin_41078837/article/details/80618916 逻辑备份概述 逻辑备份时创建数据库对象 ...

  8. ORACLE 数据泵 expdp/impdp

    ORACLE 数据泵 expdp/impdp 一.概念 Oracle Database 10g 引入了最新的数据泵(Data Dump)技术,数据泵导出导入 (EXPDP 和 IMPDP)的作用: 1 ...

  9. 利用PL/SQL从Oracle数据库导出和导入数据

    转自:https://www.jb51.net/article/109768.htm 本文实例为大家分享了使用PL/SQL从Oracle数据库导出和导入数据的方法,供大家参考,具体内容如下 1.导出数 ...

随机推荐

  1. 不适合使用hadoop来解决的问题

    1.Hadoop能解决的问题必须是可以mapreduce的.一是问题可以拆分,二是子问题必须独立.比如斐波那契数列就不适合. 2.数据结构不满足key-value形式的.比如结构化的数据查询. 3.不 ...

  2. JVM垃圾收集器与内存分配策略(一)

    在前面的Java自动内存管理机制(上)和Java自动内存管理机制(下)中介绍了关于JVM的一些基础知识,包括运行时数据区域划分和一些简单的参数配置,而其中也谈到了GC,但是没有深入了解,所以这里开始简 ...

  3. Javascript高级编程学习笔记(37)—— DOM(3)Element

    Element类型 除了Document类型之外,Element类型应该就是web编程中最常用的类型了 Element类型主要用于表现XML.HTML元素,提供对元素标签名.子节点以及特性的访问 特性 ...

  4. #Java学习之路——基础阶段(第二篇)

    我的学习阶段是跟着CZBK黑马的双源课程,学习目标以及博客是为了审查自己的学习情况,毕竟看一遍,敲一遍,和自己归纳总结一遍有着很大的区别,在此期间我会参杂Java疯狂讲义(第四版)里面的内容. 前言: ...

  5. 单元测试mock当前时间

    在实际项目中很多地方用到DateTime.Now,这个时间是时时变化的.如果要进行单元测试对比预期结果时,这个时间无法预测,可以添加如下两个时间类 namespace Common.Helper { ...

  6. js控制多层单选,多选按钮,做隐藏操作

    项目中遇到多层级单选,多选按钮的置灰/隐藏操作.特意写了一个公用组件: //置灰方式 //controllerArr数组添加如下数据: //{ctrlName:"gds_anquanyuan ...

  7. dpkg: 处理软件包 qjackctl (--configure)时出错解决方法

    第一步:备份 $ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bk 第二步:新建 $ sudo mkdir /var/lib/dpkg/info 第三步 ...

  8. Python的GUI编程(TK)

    TK在大多数 Unix平台.Windows平台和Macintosh系统都是预装好的,TKinter 模块是 Tk GUI 套件的标准Python接口.可实现Python的GUI编程. Tkinter模 ...

  9. 树莓派GPIO口的使用

    树莓派的优势在于Liunx操作系统加GPIO口,其中IO口时物联网组成中不可缺少的,高低电平的控制是很有必要的存在,再加有python的支持,玩转GPIO相对就容易多了 管脚编号 BCM: 编号侧重 ...

  10. [ASP.NET MVC]笔记(四) UnobtruSive AJAX和客户端验证

    UnobtruSive AJAX和客户端验证 ASP.NET MVC 已经默认开启非侵入试js和客户端验证,在web.config可以看到如下配置: <configuration> < ...