1. expdp导出步骤

1.1 用sys管理员登录sqlplus

[root@hxjk_test_mysql_redis_file oracle]# sqlplus

SQL*Plus: Release 11.2.0.1. Production on Wed Nov  :: 

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

Enter user-name: orcl
Enter password: Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>

创建逻辑目录;

SQL> create directory BACKDIR as '/opt/oracle/oradata/orcl/';

Directory created.

查看

SQL> select * from dba_directories;

OWNER                   DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS XMLDIR
/ade/b//oracle/rdbms/xml SYS BACKDIR
/opt/oracle/oradata/orcl/ SYS DATA_PUMP_DIR
/opt/oracle/admin/orcl/dpdump/ OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS ORACLE_OCM_CONFIG_DIR
/opt/oracle/product/11.2./db_1/ccr/state

1.2 用expdp导出dmp,有五种导出方式:

第一种:“full=y”,全量导出数据库;

expdp carloan/carloan@192.168.40.69:1521/orcl dumpfile=carloan_20181121.dmp directory=backdir full=y logfile=carloan_20181121.log;

carloan_20181121.log日志文件内容如下,会导出整个库内所有的表空间:

;;;
Export: Release 11.2.0.1.0 - Production on Wed Nov 21 21:35:44 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
;;;
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "CARLOAN"."SYS_EXPORT_FULL_01": carloan/********@192.168.40.64:1521/orcl dumpfile=carloan_20181121.dmp directory=backdir full=y logfile=carloan_20181121.log
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 592.4 MB
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/ROLE
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA
Processing object type DATABASE_EXPORT/RESOURCE_COST
Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/SEQUENCE
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/DIRECTORY/DIRECTORY
Processing object type DATABASE_EXPORT/DIRECTORY/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/CONTEXT
Processing object type DATABASE_EXPORT/SCHEMA/PUBLIC_SYNONYM/SYNONYM
Processing object type DATABASE_EXPORT/SCHEMA/SYNONYM
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/PRE_TABLE_ACTION
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/FUNCTION
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/PROCEDURE
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/ALTER_FUNCTION
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/VIEW
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODY
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/TYPE_BODY
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/POST_TABLE_ACTION
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TRIGGER
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/TRIGGER
Processing object type DATABASE_EXPORT/SCHEMA/EVENT/TRIGGER
Processing object type DATABASE_EXPORT/SCHEMA/MATERIALIZED_VIEW
Processing object type DATABASE_EXPORT/SCHEMA/JOB
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/POST_INSTANCE/PROCACT_INSTANCE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/POST_INSTANCE/PROCDEPOBJ
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCOBJ
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/AUDIT
. . exported "ORCL"."MA_ASSET_RELATED_DETAIL" 104.7 MB 2743778 rows
. . exported "MA_HXPH0709"."MA_ASSET_RELATED_DETAIL" 52.51 MB 1375642 rows
. . exported "CARLOAN"."BASE_CITYS" 39.89 MB 713987 rows …… Master table "CARLOAN"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
******************************************************************************
Dump file set for CARLOAN.SYS_EXPORT_FULL_01 is:
/opt/oracle/oradata/orcl/carloan_20181121.dmp
Job "CARLOAN"."SYS_EXPORT_FULL_01" successfully completed at 21:41:11

第二种:schemas按用户导出;

expdp carloan/carloan@192.168.40.64:1521/orcl schemas=carloan dumpfile=carloan_20181121_2.dmp directory=backdir logfile=carloan_20181121_2.log;

carloan_20181121_2.log,会导出用户carloan默认表空间carloan的数据。

;;;
Export: Release 11.2.0.1.0 - Production on Wed Nov 21 21:48:17 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
;;;
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "CARLOAN"."SYS_EXPORT_SCHEMA_01": carloan/********@192.168.40.64:1521/orcl schemas=carloan dumpfile=carloan_20181121_2.dmp directory=backdir logfile=carloan_20181121_2.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 63.06 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/JOB
. . exported "CARLOAN"."BASE_CITYS" 39.89 MB 713987 rows
. . exported "CARLOAN"."ACT_EVT_LOG" 2.036 MB 5590 rows
. . exported "CARLOAN"."BASE_CARS" 1.758 MB 24488 rows
. . exported "CARLOAN"."MSG_INTERFACE_LOG" 1.851 MB 1869 rows
. . exported "CARLOAN"."BASE_CAR_TYPE" 1.224 MB 12244 rows
. . exported "CARLOAN"."ACT_HI_ACTINST" 112.1 KB 833 rows
. . exported "CARLOAN"."ACT_HI_COMMENT" 49.88 KB 643 rows …… Master table "CARLOAN"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for CARLOAN.SYS_EXPORT_SCHEMA_01 is:
/opt/oracle/oradata/orcl/carloan_20181121_2.dmp
Job "CARLOAN"."SYS_EXPORT_SCHEMA_01" successfully completed at 21:48:50

第三种:按表空间导出;

expdp carloan/carloan@192.168.40.64:1521/orcl TABLESPACES=carloan dumpfile=carloan_20181121_3.dmp directory=backdir logfile=carloan_20181121_3.log;

carloan_20181121_3.log内容如下:

;;;
Export: Release 11.2.0.1.0 - Production on Wed Nov 21 22:08:43 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
;;;
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "CARLOAN"."SYS_EXPORT_TABLESPACE_01": carloan/********@192.168.40.64:1521/orcl TABLESPACES=carloan dumpfile=carloan_20181121_3.dmp directory=backdir logfile=carloan_20181121_3.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 63.06 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
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/COMMENT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "CARLOAN"."BASE_CITYS" 39.89 MB 713987 rows
. . exported "CARLOAN"."ACT_EVT_LOG" 2.036 MB 5590 rows
. . exported "CARLOAN"."BASE_CARS" 1.758 MB 24488 rows
. . exported "CARLOAN"."MSG_INTERFACE_LOG" 1.851 MB 1869 rows …… Master table "CARLOAN"."SYS_EXPORT_TABLESPACE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for CARLOAN.SYS_EXPORT_TABLESPACE_01 is:
/opt/oracle/oradata/orcl/carloan_20181121_3.dmp
Job "CARLOAN"."SYS_EXPORT_TABLESPACE_01" successfully completed at 22:09:05

第四种:导出表;

expdp carloan/carloan@192.168.40.64:1521/orcl TABLES=ACT_RU_TASK dumpfile=carloan_20181121_4.dmp directory=backdir logfile=carloan_20181121_4.log;

第五种:按查询条件导;

2.impdp导入步骤

如果不是同一台服务器,需要先将上面的dmp文件下载到目标服务器上,建立逻辑目录,放入逻辑目录下

用impdp命令导入,下面介绍两种

第一种同名用户导入,从用户A导入到用户A;

impdp carloan/carloan@192.168.40.64:1521/orcl directory=backdir dumpfile='carloan_20181113144951.dmp' schemas=carlo

第二种. 从carloan用户中把表ACT_GE_BYTEARRAY 导入到carloan2用户中;

impdp carloan2/carloan2@192.168.40.64:1521/orcl tables=carloan.ACT_GE_BYTEARRAY remap_schema=carloan:carloan2 directory=backdir dumpfile=carloan_20181113144951.dmp;

oracle服务端导出/导入方式expdp/impdp的更多相关文章

  1. Oracle数据泵导出导入(expdp/impdp)

    一.创建表空间 create tablespace atp logging datafile 'D:\oracle\oradata\orcl\atp.dbf' size 50m autoextend ...

  2. oracle两种导出导入方式,即imp与impdp之比较

    尽管使用了很多次impexp及impdpexpdp但是使用起来还是会遇到很多问题,现总结如下: 应用:将一个用户的所有表结构及索引,触发器,过程,函数等导入到另一用户里 imp/exp 导出用户表结构 ...

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

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

  4. Oracle数据库备份还原工具之Expdp/IMPdp

    使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ...

  5. [PL/SQL]oracle数据库的导出导入

    一.PL/SQL Developer工具一般对oracle的导入导出有以下4中方式: 1.Oracle导出导入方式 这种方式导出导入为.dmp的文件格式,.dmp文件是二进制的,可以跨平台,还能包含权 ...

  6. Oracle服务端及客户端搭建帮助文档

    Oracle服务端及客户端搭建帮助文档 目录 简介 Oracle服务端安装 Oracle客户端安装 PLSQL安装 登录测试 系统配置修改 用户操作 解锁账户.密码 创建账户及密码 配置监听文件 监听 ...

  7. PL/SQL Developer 连接 64位Oracle 服务端 解决方案

    PL/SQL是32位程序,只能通过32位的Oracle驱动连接Oracle服务器.如果Oracle服务器是64位的,那么只能通过需要通过一个32位的Oracle客户端,来搭建连接. 到官网下载一个客户 ...

  8. ORACLE服务端详细安装步骤(配图解)

    ORACLE服务端的安装及配置 l 将下载的安装包解压缩,双击[setup.exe]文件,系统检查监听参数,耐心等待,完成后出现如下界面,电子邮件可不填,"我希望..."建议不勾选 ...

  9. 安装Oracle服务端后配置注册表与PL/SQL

    1.流程: 1.安装Oracle客户端(绿色版和安装版均可,建议安装在和Oracle服务端文件夹并行的路径下,例:E:\app\yginuo\product\11.2.0) 2.配置环境变量和注册表( ...

随机推荐

  1. js俩习题

    需求,现在要求两个按钮,点击1,背景为红色,点击2,背景为黄色 *****html代码——————————————————————————————————————————————————<!DO ...

  2. python中冒泡 排序法练习题

    # 第四题:写出冒泡排序函数,可以排序任意类型的元素,可以逆序 # 1.实现冒泡排序算法 # 2.可以排序任意类型的元素 # 3.能够通过参数设置进行逆序,默认升序 def my_sort(lt,ke ...

  3. Ubuntu配置jdk环境变量

    下载jdk,解压到你想要的目录 在/etc/profile里最后添加 export JAVA_HOME=/home/zzs0/Programs/jdk1.8.0_102export JRE_HOME= ...

  4. springBoot JPA PageAble分页查询出错,PropertyReferenceException: No property creation found for type

    PropertyReferenceException: No property creation found for type @RequestParam(required = false, defa ...

  5. Python 进阶_OOP 面向对象编程_类和继承

    目录 目录 类 最简单的类 类方法 构造器 __init__ 创建一个类 实例化一个对象 调用实例的方法和属性 创建子类 使用 super 来调用父类的构造器 实例化子类对象 调用子类的属性和方法 类 ...

  6. Cocos2d Box2D之静态刚体

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. b2_staticBody 在模拟环境下静态物体是不会移动的,就好像有无限大的质量.在Box2D的内部会将质量至反,存储为零.静态物体也可 ...

  7. Python 学习笔记13 类 - 创建和简单使用

    介绍: 面向对象编程是一种非常有效的软件编写方法之一,在面向对象编程中,我们会编写表示现实世界中的事物或者情景的类,并基于类来创建对象. 在编写类的的时候,这些类对象一般都有通用的行为或者属性.基于类 ...

  8. javaIO流(二)--字节流与字符流

    一.流的基本概念 在java.io包中,File类是唯一一个与文件本身有关的程序处理类,但是File类只能操作文件本身,而不能操作文件内容,IO操作的核心意义在于输入和输出操作.而对于程序而言,输入和 ...

  9. JavaFx开发桌面软件

    JavaFx开发桌面软件 */--> code {color: #FF0000} pre.src {background-color: #002b36; color: #839496;} Jav ...

  10. Linux Kernel中所應用的數據結構及演算法

    Linux Kernel中所應用的數據結構及演算法 Basic Data Structures and Algorithms in the Linux kernel Links are to the  ...