1、创建DIRECTORY (必须在数据库用户下创建目录)
sqlplus system/manager create directory test_dir as '/home/orauat/zzj';
2、授权
Grant read,write on directory test_dir to cux;
--查看目录及权限
SELECT PRIVILEGE, DIRECTORY_NAME, DIRECTORY_PATH FROM USER_TAB_PRIVS T, ALL_DIRECTORIES D WHERE T.TABLE_NAME(+) = D.DIRECTORY_NAME ORDER BY 2, 1;
3、执行导出导入
su - orauat/orauat expdp cux/cux TABLES=cux_expdp_test_table DUMPFILE=cux_expdp_test_table.dmp DIRECTORY=test_dir LOGFILE=cux_expdp_test_table.log impdp cux/cux DIRECTORY=test_dir DUMPFILE=cux_expdp_test_table.dmp TABLE_EXISTS_ACTION=TRUNCATE LOGFILE=cux_expdp_test_table.log
例子:将UAT环境中表cux.cux_expdp_test_table中的数据导入到CRP2环境中;
一、从UAT环境中将数据导出:
1、创建DIRECTORY(必须在数据库用户下创建目录)
login: orauat orauat's Password: . . . . . . $ sqlplus system/manager SQL*Plus: Release 11.2.0.2.0 Production on Wed May 15 15:20:58 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> create directory test_dir as '/home/orauat/zzj'; Directory created. SQL> Grant read,write on directory test_dir to cux; Grant succeeded. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options $ cd /home/orauat/zzj $ expdp cux/cux TABLES=cux_expdp_test_table DUMPFILE=cux_expdp_test_table.dmp DIRECTORY=test_dir LOGFILE=cux_expdp_test_table.log Export: Release 11.2.0.2.0 - Production on Wed May 15 15:06:12 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "CUX"."SYS_EXPORT_TABLE_01": cux/******** TABLES=cux_expdp_test_table DUMPFILE=cux_expdp_test_table.dmp DIRECTORY=test_dir LOGFILE=cux_expdp_test_table.log Estimate in progress using BLOCKS method... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 128 KB Processing object type TABLE_EXPORT/TABLE/TABLE . . exported "CUX"."CUX_EXPDP_TEST_TABLE" 5.460 KB 5 rows Master table "CUX"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded ****************************************************************************** Dump file set for CUX.SYS_EXPORT_TABLE_01 is: /export/home/orauat/zzj/cux_expdp_test_table.dmp Job "CUX"."SYS_EXPORT_TABLE_01" successfully completed at 15:07:02 $ ls cux_expdp_test_table.dmp cux_expdp_test_table.log $
2、将cux_expdp_test_table.dmp从/home/orauat/zzj目录下载下来,然后上传到CRP2环境的/home/oracrp2/zzj
二、将数据上传到CRP2环境:
1、创建DIRECTORY(必须在数据库用户下创建目录)
login: oracrp2 oracrp2's Password: . . . $ sqlplus system/manager SQL*Plus: Release 11.2.0.2.0 Production on Wed May 15 15:20:58 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> create directory test_dir as '/home/oracrp2/zzj'; Directory created. SQL> Grant read,write on directory test_dir to cux; Grant succeeded. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options $ cd /home/oracrp2/zzj $ ls cux_expdp_test_table.dmp $ impdp cux/cux DIRECTORY=test_dir DUMPFILE=cux_expdp_test_table.dmp TABLE_EXISTS_ACTION=TRUNCATE LOGFILE=cux_expdp_test_table.log Import: Release 11.2.0.2.0 - Production on Wed May 15 15:21:55 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "CUX"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "CUX"."SYS_IMPORT_FULL_01": cux/******** DIRECTORY=test_dir DUMPFILE=cux_expdp_test_table.dmp TABLE_EXISTS_ACTION=TRUNCATE LOGFILE=cux_expdp_test_table.log Processing object type TABLE_EXPORT/TABLE/TABLE Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported "CUX"."CUX_EXPDP_TEST_TABLE" 5.460 KB 5 rows Job "CUX"."SYS_IMPORT_FULL_01" successfully completed at 15:22:22 $ ls cux_expdp_test_table.dmp cux_expdp_test_table.log $
相关推荐
NULL 博文链接:https://zzzwp.iteye.com/blog/2313486
oracle的impdp和expdp数据泵导入导出全备数据库-详细笔记文档总结
详细介绍oracle11g expdp impdp导入导出的使用
数据泵技术是Oracle Database 10g 中的新技术,它比原来导入/导出(imp,exp)技术快15-45倍。速度的提高源于使用了并行技术来读写导出转储文件。 expdp/impdp和exp/imp的区别 exp和imp是客户端工具程序,它们既可以在...
oracle数据库导入数据
3、也可以将这个逻辑目录授权给其他用户 grant read,write on directory out_dir to 用户名; 删除逻辑目录 drop directory out_dir; drop directory 逻辑目录名; 导出本地数据(在系统命令下执行,不能在数据库里...
介绍如何使用数据泵,对使用数据库有很大的帮助
将数据库中的用户对象导出到一个二进制文件中,逻辑备份使用导入导出工具:EXPDP/IMPDP或EXP/IMP,由于将数据库对象导出到操作系统二进制文件中,或由二进制文件中把数据导入到数据库中。逻辑备份可以作为备份的补充...
在10g之前,传统的导出和导入分别使用EXP工具和IMP工具,从10g开始,不仅保留了原有的EXP和IMP工具,还提供了数据泵导出导入工具EXPDP和IMPDP.使用EXPDP和IMPDP时应该注意的事项: 1)EXP和IMP是客户端工具程序,它们既...
Oracle Database 10g引入了最新的数据泵(Data Dump)技术,使DBA或开发人员可以将数据库元数据(对象定义)和数据快速移动到另一个oracle数据库中. 数据泵导出导入(EXPDP和IMPDP)
oracle 数据库expdp 和impdp 详细操作说明 针对imp、exp 做简要说明
oracle数据库导入导出用法详解,内容比较详细
oracle11g数据库导入导出: ①传统方式——exp(导出)和(imp)导入; ②数据泵方式——expdp导出和(impdp)导入; ③第三方工具——PL/sql Develpoer
Centos7.6下oracle impdp导入和expdp导出,
-- remap_tablespace=JIAOWU:USERS 数据库对象本来存在于JIAOWU表空间,现在你不想放那儿了,想换到USERS,就用这个remap_tablespace=JIAOWU:USERS 结果是所有JIAOWU中的对象都会建在USERS表空间中。 这样做的前提是...
11g备份,导入10g的时候会抛错,直接阻止导入。但是有时候还必须得把11g的数据库导入到10g,使用如下方法: 一、在11g服务器上,使用expdp命令备份数据 二、在10g服务器上,使用impdp命令恢复数据
1.数据泵(expdp)的导出模式 2.数据泵(impdp)的导入模式 3.expdp和impdp高级功能 3.1字符集 3.2 trace文件 3.3 自动备份策略
expdp和impdp是oracle数据库之间移动数据的工具。expdp和impdp只能在数据库服务端使用,不能在客户端使用。本文简单总结了expdp和impdp常用的命令,详细信息参考oracle官方文档Utilities。
介绍了oracle数据库中使用exp,expdp,imp,impdp导出导入数据主方法,适合刚接触oracle数据的同学了解下。共同学习。