Oracle 入门和sqluldr2 数据快速导出工具的使用

版权声明:转载请注明出处。 https://blog.csdn.net/b285795298/article/details/81872434

Oracle的安装

oracle的下载,安装
请参考:
https://www.cnblogs.com/hoobey/p/6010804.html
值得一提的是:
安装完成,首次启动Developer的时候,需要制定java.exe的路径。这个路径需要选择oracle安装目录下的路径。
我的机器上,该路径为:F:\App\Administrator\product\11.2.0\dbhome_1\jdk\bin
另外,若按照如上步骤安装连续报错:unable to find a JVM则是因为安装的Oracle 11g R2自带的SQL Develper是32bit的,但给它的JDK环境是64bit的,所以报错。
只需要从Oracle官网下载Oracle SQL dEVELOPER x64,然后替换掉原安装目录(如F:\App\Administrator\product\11.2.0\dbhome_1)下的sqldeveloper文件夹,然后重新启动SQL Developer即可。

sqluldr2

Sqluldr2是一款可以快速导出oracle数据库中的数据的小工具。

Oracle在PL/SQL Developer下,导出文件较慢,尤其在面对海量数据下载时,一款能够提速50%-75%数据下载速度的工具显得尤为重要。Sqluldr2是不错的选择。

下载链接:Sqluldr2
解压资源

这里写图片描述

在windows下,只需要在该地址下打开命令行窗口,直接执行对应的文件即可。
这里写图片描述
这里写图片描述
具体的数据格式和命令:


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 
   read    = set DB_FILE_MULTIBLOCK_READ_COUNT at session level
   sort    = set SORT_AREA_SIZE at session level (UNIT:MB) 
   hash    = set HASH_AREA_SIZE at session level (UNIT:MB) 
   array   = array fetch size
   head    = print row header(Yes|No)
   batch   = save to new file for every rows batch (Yes/No)
   size    = maximum output file piece size (UNIB:MB)
   serial  = set _serial_direct_read to TRUE at session level
   trace   = set event 10046 to given level at session level
   table   = table name in the sqlldr control file
   control = sqlldr control file and path.
   mode    = sqlldr option, INSERT or APPEND or REPLACE or TRUNCATE 
   buffer  = sqlldr READSIZE and BINDSIZE, default 16 (MB)
   long    = maximum long field size
   width   = customized max column width (w1:w2:...) 
   quote   = optional quote string 
   data    = disable real data unload (NO, OFF) 
   alter   = alter session SQLs to be execute before unload 
   safe    = use large buffer to avoid ORA-24345 error (Yes|No) 
   crypt   = encrypted user information only (Yes|No) 
   sedf/t  = enable character translation function 
   null    = replace null with given value 
   escape  = escape character for special characters
   escf/t  = escape from/to characters list 
   format  = MYSQL: MySQL Insert SQLs, SQL: Insert SQLs.
   exec    = the command to execute the SQLs.
   prehead = column name prefix for head line.
   rowpre  = row prefix string for each line.
   rowsuf  = row sufix string for each line.
   colsep  = separator string between column name and value.
   presql  = SQL or scripts to be executed before data unload.
   postsql = SQL or scripts to be executed after data unload.
   lob     = extract lob values to single file (FILE).
   lobdir  = subdirectory count to store lob files .
   split   = table name for automatically parallelization.
   degree  = parallelize data copy degree (2-128).

  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

oracle数据导出工具sqluldr2

基本简介

  下载完sqluldr解压后,文件夹内容如下:
  sqluldr2.exe 用于32位windows平台;
  sqluldr2_linux32_10204.bin 适用于linux32位操作系统;
  sqluldr2_linux64_10204.bin 适用于linux64位操作系统;
  sqluldr264.exe 用于64位windows平台。

使用方法

  1、首先将sqluldr2.exe复制到执行目录下,即可开始使用
  2、查看help 帮助

扫描二维码关注公众号,回复: 4753475 查看本文章

sqluldr2 官方下载

  3、执行数据导出命令
  3.1、常规导出
  sqluldr2 test/[email protected]/orcl query=”select * from temp_001” head=yes file=d:\tmp001.csv
  说明:head=yes 表示输出表头

  3.2、使用sql参数
  sqluldr2 test/[email protected]/orcl sql=test_sql.sql head=yes file=d:\tmp001.csv
  test_sql的内容为:
  select * from temp_001

  3.3、使用log参数
  当集成sqluldr2在脚本中时,就希望屏蔽上不输出这些信息,但又希望这些信息能保留,这时可以用“LOG”选项来指定日志文件名。
  sqluldr2 test/[email protected]/orcl sql=test_sql.sql head=yes file=d:\tmp001.csv log=+d:\tmp001.log

  3.4、使用 table 参数
  当使用 table 参数时,在目录下会生成对应的ctl控制文件,如下语句会生成temp_001_sqlldr.ctl文件。
  sqluldr2 test/[email protected]/orcl query=”select * from temp_001” table=temp_001 head=yes file=d:\tmp001.csv

猜你喜欢

转载自blog.csdn.net/b285795298/article/details/81872434
今日推荐