oracle服务端导出/导入方式expdp/impdp
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的更多相关文章
- Oracle数据泵导出导入(expdp/impdp)
一.创建表空间 create tablespace atp logging datafile 'D:\oracle\oradata\orcl\atp.dbf' size 50m autoextend ...
- oracle两种导出导入方式,即imp与impdp之比较
尽管使用了很多次impexp及impdpexpdp但是使用起来还是会遇到很多问题,现总结如下: 应用:将一个用户的所有表结构及索引,触发器,过程,函数等导入到另一用户里 imp/exp 导出用户表结构 ...
- Oracle使用数据泵导入/导出数据(expdp/impdp)
Oracle使用数据泵导入/导出数据(expdp/impdp) A电脑上的操作(expdp数据导出) 运行cmd: 登录数据库,输入命令:sqlplus 使用管理员角色登录需要在用户名后加" ...
- Oracle数据库备份还原工具之Expdp/IMPdp
使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ...
- [PL/SQL]oracle数据库的导出导入
一.PL/SQL Developer工具一般对oracle的导入导出有以下4中方式: 1.Oracle导出导入方式 这种方式导出导入为.dmp的文件格式,.dmp文件是二进制的,可以跨平台,还能包含权 ...
- Oracle服务端及客户端搭建帮助文档
Oracle服务端及客户端搭建帮助文档 目录 简介 Oracle服务端安装 Oracle客户端安装 PLSQL安装 登录测试 系统配置修改 用户操作 解锁账户.密码 创建账户及密码 配置监听文件 监听 ...
- PL/SQL Developer 连接 64位Oracle 服务端 解决方案
PL/SQL是32位程序,只能通过32位的Oracle驱动连接Oracle服务器.如果Oracle服务器是64位的,那么只能通过需要通过一个32位的Oracle客户端,来搭建连接. 到官网下载一个客户 ...
- ORACLE服务端详细安装步骤(配图解)
ORACLE服务端的安装及配置 l 将下载的安装包解压缩,双击[setup.exe]文件,系统检查监听参数,耐心等待,完成后出现如下界面,电子邮件可不填,"我希望..."建议不勾选 ...
- 安装Oracle服务端后配置注册表与PL/SQL
1.流程: 1.安装Oracle客户端(绿色版和安装版均可,建议安装在和Oracle服务端文件夹并行的路径下,例:E:\app\yginuo\product\11.2.0) 2.配置环境变量和注册表( ...
随机推荐
- JS中获取元素使用getElementByID()、getElementsByName()、getElementsByTagName()的用法和区别
Web标准下可以通过getElementById(), getElementsByName(), and getElementsByTagName()访问Documnent中的任一个标签: 1 g ...
- swoole 多进程共享数据
进程作为程序执行过程中资源分配的基本单位,拥有独立的地址空间,同一进程的线程可以共享本进程的全局变量,静态变量等数据和地址空间,但进程之间资源相互独立.由于PHP语言不支持多线程,因此Swoole使用 ...
- iText例子
参考:http://itextpdf.com/book/examples.php daniel@daniel-mint ~/latex/linux/itext/daniel $ cat HelloWo ...
- js判断一件商品加还是减
<div class="right"> <div onclick="javascript: ClickJian(this);" data-i= ...
- php的注释方法
注释是每个程序员学习时的基础,我们通过可以注释来备注一信息.增加代码的可读性.下面我们就为大家介绍一下PHP的注释方法. 1, // 这是单行注释 2,# 这也是单行注释 3,/* */多行注释块 ...
- 实验报告(七)&第九周课程总结
班级 计科二班 学号 20188425 姓名 IM 完成时间2019/10/24 评分等级 实验任务详情: 完成火车站售票程序的模拟. 要求: (1)总票数1000张: (2)10个窗口同时开始卖票: ...
- java File I/O
File类: 常用方法: boolean exists( ):判断文件或目录是否存在 boolean isFile( ):判断是否是文件 boolean isDirectory( ):判断是否是目录 ...
- Python之str型转成int型
str转int: def fn(x,y): return x*10+y def char2num(s): ':9}[s] # 特别注意这里,后面还有个 [s] ')))) '))) 输出如下: < ...
- Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory
执行下面的代码报错: $pdo = new PDO('mysql:dbname=db_test;host=localhost', 'root', '123456'); PHP Fatal error: ...
- β版本apk下载地址及源代码github地址
β版本下载地址 源代码下载地址:https://github.com/U-Help/Version-1.0 安装包下载地址:百度网盘:(密码q3sy)https://pan.baidu.com/s ...