oracle數據導出工具sqluldr2可以將數據以csv、txt等格式導出,適用於大批量數據的導出,導出速度非常快。
導出后可以使用oracle loader工具將數據導入。
簡介:
Sqluldr2:專業用於大數據量導出工具之一,效率比普通導出快70%。
Sqlldr: 專業用於導入的工具之一, 在使用時,最好用磁盤寫入速度快,網絡好,網速快的做。
導出數據:
sqluldr2 user=c##scott/tiger@192.168.1.250/orcl field=0x03 sql=lead_table.sql file=lead_table.dat charset=ZHS16GBK head=no safe=yes fast=yes serial=ture
[oracle@master2 test]$ more lead_table.sql
select CASEID,STEPID,ACTIONDATE from LEAD_TABLE;
生成文件
[oracle@master2 test]$ sqluldr2 user=c##scott/tiger@192.168.1.250/orcl field=0x03 sql=lead_table.sql file=lead_table.dat charset=ZHS16GBK head=no safe=yes fast=yes serial=ture
0 rows exported at 2019-01-23 11:15:10, size 0 MB.
10 rows exported at 2019-01-23 11:15:10, size 0 MB.
output file lead_table.dat closed at 10 rows, size 0 MB.
導入數據:
[oracle@master2 test]$ sqlldr userid=c##scott/tiger@192.168.1.250/orcl data=lead_table.dat control=lead_table.ctl log=lead_table.log skip=0 rows=10000 direct=true streamsize=30720000 date_cache=30720000 SQL*Loader: Release 12.1.0.2.0 - Production on Wed Jan 23 11:50:18 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Path used: Direct Load completed - logical record count 1. Table LEAD_TABLE: 1 Row successfully loaded. Check the log file: lead_table.log for more information about the load. [oracle@master2 test]$ echo $? 0
控制文件:
[oracle@master2 test]$ more lead_table.ctl LOAD DATA CHARACTERSET 'ZHS16GBK' INFILE * INTO TABLE LEAD_TABLE FIELDS TERMINATED BY X'03' optionally enclosed by '"' trailing nullcols ( CASEID, STEPID, ACTIONDATE "to_timestamp(:ACTIONDATE,'YYYY-MM-DD-HH24:MI:SS.FF')" )