Linux操作系统上用数据泵导库
2015-05-31 20:52
330 查看
[b]数据泵技术是Oracle Database 10g 中的新技术,它比原来导入/导出(imp,exp)技术快15-45倍。速度的提高源于使用了并行技术来读写导出转储文件。
[/b]
ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
使用expdp和impdp时应该注重的事项:
1、exp和imp是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用。
2、expdp和impdp是服务端的工具程序,他们只能在oracle服务端使用,不能在客户端使用。
3、imp只适用于exp导出的文件,不适用于expdp导出文件;impdp只适用于expdp导出的文件,而不适用于exp导出文件。
4、对于10g以上的服务器,使用exp通常不能导出0行数据的空表,而此时必须使用expdp导出。
SQL>create directory dump_dir as 'd:\test\dump';
expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp directory=dump_dir;
2)导出表
expdp scott/tiger@orcl tables=emp,dept dumpfile=expdp.dmp directory=dump_dir;
3)按查询条件导
expdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp tables=empquery='where deptno=20';
4)按表空间导
expdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmptablespaces=temp,example;
5)导整个数据库
expdp system/manager@orcl directory=dump_dir dumpfile=full.dmp full=y;
impdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp schemas=scott;
2)导入表(从scott用户中把表dept和emp导入到system用户中)
impdp system/manager@orcl directory=dump_dir dumpfile=expdp.dmptables=scott.dept,scott.emp remap_schema=scott:system;
3)导入表空间
impdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmp tablespaces=example;
4)导入数据库
impdb system/manager@orcl directory=dump_dir dumpfile=full.dmp full=y;
5)追加数据
impdp system/manager@orcl directory=dump_dir dumpfile=expdp.dmp schemas=systemtable_exists_action
在任何项目中,数据是最重要的,切记一定事先规划好备份空间,及时的关注备份状态。
[/b]
ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
使用expdp和impdp时应该注重的事项:
1、exp和imp是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用。
2、expdp和impdp是服务端的工具程序,他们只能在oracle服务端使用,不能在客户端使用。
3、imp只适用于exp导出的文件,不适用于expdp导出文件;impdp只适用于expdp导出的文件,而不适用于exp导出文件。
4、对于10g以上的服务器,使用exp通常不能导出0行数据的空表,而此时必须使用expdp导出。
一、创建逻辑目录,该命令不会在操作系统创建真正的目录(请先创建真正的目录),最好以system等管理员创建逻辑目录。
SQL>conn system/manger@orcl as sysdbaSQL>create directory dump_dir as 'd:\test\dump';
二、查看管理员目录(同时查看操作系统是否存在,因为oracle并不关心该目录是否存在,假如不存在,则出错)
SQL>select * from dba_directories;三、给scott用户赋予在指定目录的操作权限,最好以system等管理员赋予。
SQL>grant read,write on directory dump_dir to scott;四、用expdp导出数据
1)导出用户expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp directory=dump_dir;
2)导出表
expdp scott/tiger@orcl tables=emp,dept dumpfile=expdp.dmp directory=dump_dir;
3)按查询条件导
expdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp tables=empquery='where deptno=20';
4)按表空间导
expdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmptablespaces=temp,example;
5)导整个数据库
expdp system/manager@orcl directory=dump_dir dumpfile=full.dmp full=y;
五、用impdp导入数据
1)导入用户(从用户scott导入到用户scott)impdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp schemas=scott;
2)导入表(从scott用户中把表dept和emp导入到system用户中)
impdp system/manager@orcl directory=dump_dir dumpfile=expdp.dmptables=scott.dept,scott.emp remap_schema=scott:system;
3)导入表空间
impdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmp tablespaces=example;
4)导入数据库
impdb system/manager@orcl directory=dump_dir dumpfile=full.dmp full=y;
5)追加数据
impdp system/manager@orcl directory=dump_dir dumpfile=expdp.dmp schemas=systemtable_exists_action
在任何项目中,数据是最重要的,切记一定事先规划好备份空间,及时的关注备份状态。
相关文章推荐
- Qt移植 Window --Linux
- Centos6.5学习之添加用户
- 查看文件系统类型的Linux命令
- Linux-dd命令详解
- Linux的sysctl 命令参数详解
- linux syslogd服务
- linux tune2fs命令详解
- linux 初始化工作环境
- Linux正则表达式-POSIX字符类
- 远程操作linux的利器:putty和psftp
- linux下stc89c52及其他国产芯片烧写方案
- linux的page cache策略
- linux进程间通信-共享内存
- linux编程学习3-ISO C标准定义的头文件
- yum源的超级简单配置
- Linux下文件复制
- How to Install GUI (Gnome 3) Using CD/DVD on RHEL/CentOS 7
- Setup Local Yum Repository On CentOS 7
- linux程序设计——入门(第一章)
- Linux进程控制命令之ps