使用数据泵,进行数据导入导出
来源:互联网 发布:网络优化txwh123 编辑:程序博客网 时间:2024/04/28 23:36
1、数据导出(导出scott.emp)
结果:d:\mydir下导出两个文件exp_scott_emp.dmp和exp_scott_emp.log
(1)、 以sys/changoninstall@ORCL连接
(2)、 新建目录:d:\mydir
(3)、 创建目录对象:create directory mydir as 'd:\mydir';
(4)、 对目录对象进行授权(授权给导出用户):
grant read,write on directory mydir to scott;
(5)、 创建导出的参数文件:exp_scott_emp.txt
userid=scott/tiger@orcldirectory=mydirdumpfile=exp_scott_emp.dmplogfile=emp_scott_emp.logtables=(emp)job_name=emp_scott_emp
(6)、 执行导出命令:用cmd进入命令提示符窗口,把命令提示符窗口的当前路径转到参数文件的存放路径下,引用刚创建的参数文件exp_scott_emp.txt来执行导出(expdp)命令(如d:\mydir\exp_scott_emp.txt)
l d:
l cd d:\mydir
l expdp parfile=exp_scott_emp.txt (注意:千万不要加分号;)
2、数据导入(导入scott.emp)
(1)、 准备导入源:d:\mydir
exp_scott_emp.dmp 和exp_scott_emp.log
(2)、 创建SQL脚本文件(beforeimp.sql):保存导入前在目标数据库中要执行的命令
--目录对象create directory mydir as 'd:\mydir';--表空间(D:\mydir\tablespace目录必须存在,且目录下不能存在将要创建的数据文件)create tablespace mytbsdatafile 'D:\mydir\tablespace\mytbs1.dbf'size 5M autoextend on next 1k maxsize 10M , 'D:\mydir\tablespace\mytbs2.dbf' size 10M ;--profilecreate profile myprofile limitpassword_life_time 30failed_login_attempts 6;--导入用户(创建导入用户)create user scottprofile myprofileidentified by tigerdefault tablespace mytbsaccount unlock;grant connect to scott;grant dba to scott; exit;--一定记得要退出
(3)、 创建导入参数文件:imp_scott_emp.txt
userid=scott/tiger@ORCLdirectory=mydirdumpfile=exp_scott_emp.dmplogfile=exp_scott_emp.logjob_name=imp_scott_emp
(4)、 创建导入的批命令文件:imp_scott.bat
sqlplus sys/changeoninstall@orcl as sysdba @beforeimp.sqlimpdp parfile=imp_scott_emp.txt
(5)、 执行imp_scott.bat:将创建的三个文件(beforeImp.sql、imp_scott_emp.txt、imp_scott.bat)放到同一路径下,用cmd进入命令提示符窗口,将当前路径转到三个文件的路径下,输入:imp_scott.bat (注意,千万不要加分号;)
- 使用数据泵,进行数据导入导出
- 使用bcp进行数据导出导入
- sql 使用bcp进行导入导出数据
- oracle使用数据泵的方式进行导出导入
- oracle使用数据泵导入导出数据
- oracle11g 使用数据泵导出导入数据
- 使用sqoop工具进行数据导入导出 sqoop并行导入
- Sqoop进行数据导入导出
- 使用数据泵expdp命令和impdp命令对数据库的数据进行导入导出
- 如何使用VB调用DTS进行数据的导入、导出
- 如何使用VB调用DTS进行数据的导入、导出
- 使用Transact-SQL进行数据导入导出方法详解
- 使用Transact-SQL进行数据导入导出方法详
- 使用Transact-SQL进行数据导入导出方法详解
- 使用Transact-SQL进行数据导入导出方法详解
- 使用Transact-SQL进行数据导入导出方法详解
- 使用Transact-SQL进行数据导入导出方法详解
- 使用Transact-SQL进行数据导入导出方法详解
- 中国银行业钱荒令世界惊讶 外媒担心重现雷曼时刻
- ios 类文件中 ARC与非ARC的设置
- org.hibernate.PropertyAccessException: Exception occurred inside getter of com.sanxiau.entity.User.p
- 'dispath_get_current_queue'is deprecated:fist deprecated in iOS 6.0的解决办法
- 【浅析Windows系统下光驱常见问题及解决途径】
- 使用数据泵,进行数据导入导出
- Http之Get/Post请求区别
- 网站频繁出现304状态码及抓取蜘蛛次数较少的原因分析
- phpmyadmin 操作数据库
- 详解 Android 的 Activity 组件
- upnp解析
- iPhone开发关于UDID和UUID的一些理解
- nexus搭建
- Ant学习