expimp与expdpimpdp区别

来源:互联网 发布:java package 用法 编辑:程序博客网 时间:2024/05/21 14:04

一、用法区别

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:只导出数据的记录)

5:expdp是10g的新特性而且只能在服务器执行。而exp/imp是通用的。

二、效率比较

测试条件:单个表测试,1363292行记录,116.6 MB左右数据量。

使用并行expdp花费时间约43秒,语句:expdp scott/oracle dumpfile=big_table.dmp directory=dpdata tables=big_table job_name=exptab parallel=4

使用正常的expdp(无parallel=4),花费时间约34秒,并行的差异可能需要更大数据量的测试。

exp直接路径导出约71秒,语句:exp scott/oracle file=big_table3.dmp tables=big_table direct=y
exp常规路径(无direct=y)导出,约126秒,花费时间最长。

从效率比较上看,expdp是一般exp的4倍左右。而导出的文件大小,传统方式exp文件要大于expdp的文件大小,大约大出10M左右。

原创粉丝点击