1、sqluldr2简介与使用
sqluldr2是一款Oracle数据快速导出工具,包含32、64位程序,sqluldr2在大数据量导出方面速度超快,能导出亿级数据为excel文件,另外它的导入速度也是非常快速,功能是将数据以TXT/CSV等格式导出。
2、语法
[oracle@erp51:/home/oracle/sqlludr]$./sqluldr2_linux64_10204.bin
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
head=yes 输出表头
sql=query.sql
log=xxx.log +xxx.log表示追加 xxx.log表示替换
file=xxx.csv xxx.gz
field ="|" 分隔符
charset=字符集 输出字文件的字符集
table=table_name 指定导入目标表的名称(即默认生成的ctl中导入表的名称,注意=右边不能有空格)
field=“” 设置导出文件的字段间的分割符
record=“” 设置导出文件数据行的结束符(回车=0x0d,换行=0x0a,TAB键=0x09,|=0x7c,&=0x26,双引号=0x22,单引号=0x27)
mode={truncate|insert|append|replace}导入默认选择(这个也是决定生成ctl文件中导入的模式)
bacth={yes|no} 是否把大表输出到多个文件中,可以按行数rows= ,或者size=(MB)来分割文件,多个文件名可按照下表来生成
ctl=ctl_name 设置控制文件名
#### 3、常规导入
sqlldr useid/password control=ctl_file log=log_file date=date_file ERRORS=0 ROWS=50000 readsize=214747364 bindsize=214747364
[oracle@erp51:/home/oracle/sqlludr]$./sqluldr2_linux64_10204.bin user=scott/tiger query=“select * from t1” safe=yes




