exp.imp与expdp,impdp在用法上有什么不同?
时间:2011-09-08
来源:互联网
1.语法有没有不同?
2.导出/导入数据是否只是速度上有区别?其他都一样?
2.导出/导入数据是否只是速度上有区别?其他都一样?
作者: delphisanding1 发布时间: 2011-09-08
1:把用户usera的对象导到用户userb,用法区别在于fromuser=usera touser=userb ,remap_schema='usera':'usera' 。例如
imp system/passwd fromuser=usera touser=userb file=/oracle/exp.dmp log=/oracle/exp.log;
impdp system/passwd directory=expdp dumpfile=expdp.dmp remap_schema='usera':'userb' logfile=/oracle/exp.log;
2:更换表空间,用exp/imp的时候,要想更改表所在的表空间,需要手工去处理一下,
如alter table xxx move tablespace_new之类的操作。
用impdp只要用remap_tablespace='tabspace_old':'tablespace_new'
3:当指定一些表的时候,使用exp/imp 时,tables的用法是 tables=('table1','table2','table3')。
expdp/impdp的用法是tables='table1','table2','table3'
4:
是否要导出数据行
exp (ROWS=Y 导出数据行,ROWS=N 不导出数据行)
expdp content(ALL:对象+导出数据行,DATA_ONLY:只导出对象,METADATA_ONLY:只导出数据的记录)
A: exp/imp的使用 (服务器端和客户端都可以执行。并且备份文件可以在客户端产生。)
exp user/password@servicename file=dump.dmp
imp user/password@servicename fromuser=fuser touser=tuser file=dump.dmp
2: expdp/impdp的使用 (服务器端和客户端都可以执行。备份文件只能存在服务器里面。)
I:在使用expdp导出时在Oracle需要定义目录变量,在导出的时候需要制定这个变量。如果可以,你可以为每个用户都建立一个单独的备份目录。
SQL>create directory dmpdir_user1 as '/home/oracle/backup';
SQL>grant read,write on directory dmpdir_user1 to user1;
对了,操作系统内必须创建这个目录。在SQL命令行下,并不会产生这个目录的。
[oracle@kook ~]$ mkdir backup
如果你没有制定这个目录的话,默认exp导出存放的目录是$HOME/rdbms/log里面。至少我的是这样。很奇怪,为什么在这里。
II:执行导出导入命令
expdp user1/password@servicename schemas=user1 directory=dmpdir_user1 dumpfile=user1.dmp
impdp user2/password@servicename directory=dmpdir_user1 dumpfile=user1.dmp remap_schema=user1:user2 remap_tablespace=user1ts:user2ts
使用expdp/impdp最大的好处可以让我转换表空间。而exp/imp这个是不支持的。处理起来非常麻烦。
imp system/passwd fromuser=usera touser=userb file=/oracle/exp.dmp log=/oracle/exp.log;
impdp system/passwd directory=expdp dumpfile=expdp.dmp remap_schema='usera':'userb' logfile=/oracle/exp.log;
2:更换表空间,用exp/imp的时候,要想更改表所在的表空间,需要手工去处理一下,
如alter table xxx move tablespace_new之类的操作。
用impdp只要用remap_tablespace='tabspace_old':'tablespace_new'
3:当指定一些表的时候,使用exp/imp 时,tables的用法是 tables=('table1','table2','table3')。
expdp/impdp的用法是tables='table1','table2','table3'
4:
是否要导出数据行
exp (ROWS=Y 导出数据行,ROWS=N 不导出数据行)
expdp content(ALL:对象+导出数据行,DATA_ONLY:只导出对象,METADATA_ONLY:只导出数据的记录)
A: exp/imp的使用 (服务器端和客户端都可以执行。并且备份文件可以在客户端产生。)
exp user/password@servicename file=dump.dmp
imp user/password@servicename fromuser=fuser touser=tuser file=dump.dmp
2: expdp/impdp的使用 (服务器端和客户端都可以执行。备份文件只能存在服务器里面。)
I:在使用expdp导出时在Oracle需要定义目录变量,在导出的时候需要制定这个变量。如果可以,你可以为每个用户都建立一个单独的备份目录。
SQL>create directory dmpdir_user1 as '/home/oracle/backup';
SQL>grant read,write on directory dmpdir_user1 to user1;
对了,操作系统内必须创建这个目录。在SQL命令行下,并不会产生这个目录的。
[oracle@kook ~]$ mkdir backup
如果你没有制定这个目录的话,默认exp导出存放的目录是$HOME/rdbms/log里面。至少我的是这样。很奇怪,为什么在这里。
II:执行导出导入命令
expdp user1/password@servicename schemas=user1 directory=dmpdir_user1 dumpfile=user1.dmp
impdp user2/password@servicename directory=dmpdir_user1 dumpfile=user1.dmp remap_schema=user1:user2 remap_tablespace=user1ts:user2ts
使用expdp/impdp最大的好处可以让我转换表空间。而exp/imp这个是不支持的。处理起来非常麻烦。
作者: xl_smlie 发布时间: 2011-09-08
作者: viszl 发布时间: 2011-09-08
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28