Oracle 數據快速導出工具:sqluldr2

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 幫助

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

 


原文鏈接:https://blog.csdn.net/b285795298/article/details/81872434

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章