从Oracle数据库导出千万数据到txt文件使用什么方式好?

我自己是使用的spool工具导出,但是效率太低,而且还总是出现TNS问题,
set trimspool on
set linesize 300
set pagesize 0
set newpage 0
set heading off
set term off
spool D:\outdata\sup_commission.txt
select id || chr(9) || supplier_code from t_oil_supplier_commission a where a.end_date is null or a.end_date >= date'2014-05-01';
spool off
exit

  • 1. 希望能找到一个高效导入数据的方法,由于数据最终是要导入到linux进行MapReduce运算,所以有直接导入到Linux下的方法也行,谢谢!

http://ajita.iteye.com/blog/1488159
方法2

Oracle数据优先使用导入导出imp/exp,效率最高。

下面介绍的是导入导出的实例
数据导出:
1 将数据库database完全导出,用户名user 密码pass 导出到output.dmp中
exp user/pass@database file=output.dmp full=y
2 将数据库database中user用户与sys用户的表导出
exp user/pass@database file=output.dmp owner=(user,sys)
3 将数据库database中的表table1 、table2导出
exp user/pass@database file=output.dmp tables=(table1,table2)
4 将数据库中的表table1中的字段filed1以"00"打头的数据导出
exp user/pass@database file=output.dmp tables=(table1) query=\" where filed1 like '00%'\"
exp的时候,只能导出具有select权限的表和对象,要导出其他用户的对象或整个数据库需要 exp_full_database 权限。

数据导入:
1 将output.dmp 中的数据导入数据库database中。
imp user/pass@database file=out.dmp
上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
在后面加上 ignore=y 就可以了。
2 将output.dmp中的表table1 导入
imp user/pass@database file=output.dmp tables=(table1)
另外数据导入,sqlldr的效率也不错。

http://m.blog.csdn.net/blog/likeshare_11109/7542614