解决 sqluldr2 导出乱码问题

今天试了一下sqluldr2 导出数据,果然是超级快。

官方下载: http://www.anysql.net/software/sqluldr.zip

sqluldr2_linux32_10204.bin

sqluldr2_linux64_10204.bin

sqluldr2.exe

sqluldr264.exe

 

第一次执行报错:

[oracle@tora80 backup]$ ./sqluldr2_linux32_10204.bin user=scott/tiger query="select * from t1 where rownum<10001" head=yes file=/home/oracle/x.csv;
./sqluldr2_linux32_10204.bin: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
 

设置环境变量:

[oracle@tora80 ~]$ vi .bash_profile

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

 

 

但是这次导出发现都是乱码

查看一下参数:

[oracle@tora80 ~]$ ./sqluldr2_linux32_10204.bin -help

SQL*UnLoader: Fast Oracle Text Unloader (GZIP, Parallel), Release 4.0.1
(@) Copyright Lou Fangxin (AnySQL.net) 2004 - 2010, all rights reserved.

License: Free for non-commercial useage, else 100 USD per server.

Usage: SQLULDR2 keyword=value [,keyword=value,...]

Valid Keywords:
   user    = username/password@tnsname
   sql     = SQL file name
   query   = select statement
   field   = separator string between fields
   record  = separator string between records
   rows    = print progress for every given rows (default, 1000000)
   file    = output file name(default: uldrdata.txt)
   log     = log file name, prefix with + to append mode
   fast    = auto tuning the session level parameters(YES)
   text    = output type (MYSQL, CSV, MYSQLINS, ORACLEINS, FORM, SEARCH).
   charset = character set name of the target database.
   ncharset= national character set name of the target database.
   parfile = read command option from parameter file

  for field and record, you can use '0x' to specify hex character code,
  \r=0x0d \n=0x0a |=0x7c ,=0x2c, \t=0x09, :=0x3a, #=0x23, "=0x22 '=0x27

发现有个参数charset

尝试一下:

[oracle@tora80 backup]$ ./sqluldr2_linux32_10204.bin user=scott/tiger query="select * from t1 where rownum<10001" head=yes charset=ZHS16GBK  file=/home/oracle/x.csv;

          0 rows exported at 2014-01-09 16:10:07, size 0 MB.
       10000 rows exported at 2014-01-09 16:10:08, size 3 MB.
         output file /home/oracle/x.txt closed at 10000 rows, size 3 MB.

 

ok! 没有乱码了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值