You are on page 1of 14

oracle sql loader

sql loader
oracle
exp imp

oracle

sql loader oracle


blob

sql loader

C:\>sqlldr

SQL*Loader: Release 9.2.0.1.0 - Production on 10 9 14:48:12 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

: SQLLDR keyword=value [,keyword=value,...]

userid -- ORACLE username/password


control -- Control file name
log -- Log file name
bad -- Bad file name
data -- Data file name
discard -- Discard file name
discardmax -- Number of discards to allow

()

skip -- Number of logical records to skip ( 0)


load -- Number of logical records to load ()
errors -- Number of errors to allow

( 50)

rows -- Number of rows in conventional path bind array or between direct p


ath data saves
: 64,
bindsize -- Size of conventional path bind array in bytes( 256000)
silent -- Suppress messages during run (header,feedback,errors,discards,part
itions)
direct -- use direct path

( FALSE)

parfile -- parameter file: name of file that contains parameter specification


s
parallel -- do parallel load

( FALSE)

file -- File to allocate extents from


skip_unusable_indexes -- disallow/allow unusable indexes or index partitions(
FALSE)
skip_index_maintenance -- do not maintain indexes, mark affected indexes as unus
able( FALSE)
readsize -- Size of Read buffer

( 1048576)

external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE(


NOT_USED)
columnarrayrows -- Number of rows for direct path column array( 5000)
streamsize -- Size of direct path stream buffer in bytes( 256000)
multithreading -- use multithreading in direct path
resumable -- enable or disable resumable for current session( FALSE)
resumable_name -- text string to help identify resumable statement
resumable_timeout -- wait time (in seconds) for RESUMABLE( 7200)
date_cache -- size (in entries) of date conversion cache( 1000)

PLEASE NOTE:
'sqlload
scott/tiger foo'; 'sqlldr control=foo
userid=scott/tiger'.
,
'sqlldr scott/tiger control=foo logfile=log',
'sqlldr scott/tiger control=foo log',
'log'

C:\>

sql loader
aSQLLoader Excel Oracle
1. SQL*Loader , C:\
input.ctl

load data
infile 'test.txt'
append into table test
fields terminated by X'09'
(id,username,password,sj)

--1
--2 test.txt
--3 test
--4 X'09'TAB
-----

ainsert
bappend
creplace
dtruncate

DOS SQL*Loader

C:\>sqlldr userid=system/manager control=input.ctl

input.log
input.bad

2.
EXCEL CSV(*.csv),
LOAD DATA
INFILE 'd:\car.csv'
APPEND INTO TABLE t_car_temp
FIELDS TERMINATED BY ","
(phoneno,vip_car)

1 test.ctl
-- The format for executing this file with SQL Loader is:
-- SQLLDR control=<filename> Be sure to substitute your
-- version of SQL LOADER and the filename for this file.
LOAD DATA
INFILE *
BADFILE 'C:\Documents and Settings\Jackey\\WMCOUNTRY.BAD'
DISCARDFILE 'C:\Documents and Settings\Jackey\\WMCOUNTRY.DSC'
INSERT INTO TABLE EMCCOUNTRY
Fields terminated by ";" Optionally enclosed by '"'
(
COUNTRYID NULLIF (COUNTRYID="NULL"),
COUNTRYCODE,
COUNTRYNAME,
CONTINENTID NULLIF (CONTINENTID="NULL"),
MAPID NULLIF (MAPID="NULL"),
CREATETIME DATE "MM/DD/YYYY HH24:MI:SS" NULLIF (CREATETIME="NULL"),

LASTMODIFIEDTIME DATE "MM/DD/YYYY HH24:MI:SS" NULLIF (LASTMODIFIEDTIME="NULL")


)
BEGINDATA
1;"JP";"Japan";1;9;"09/16/2004 16:31:32";NULL
2;"CN";"China";1;10;"09/16/2004 16:31:32";NULL
3;"IN";"India";1;11;"09/16/2004 16:31:32";NULL
4;"AU";"Australia";6;12;"09/16/2004 16:31:32";NULL
5;"CA";"Canada";4;13;"09/16/2004 16:31:32";NULL
6;"US";"United States";4;14;"09/16/2004 16:31:32";NULL
7;"MX";"Mexico";4;15;"09/16/2004 16:31:32";NULL
8;"GB";"United Kingdom";3;16;"09/16/2004 16:31:32";NULL
9;"DE";"Germany";3;17;"09/16/2004 16:31:32";NULL
10;"FR";"France";3;18;"09/16/2004 16:31:32";NULL
11;"IT";"Italy";3;19;"09/16/2004 16:31:32";NULL
12;"ES";"Spain";3;20;"09/16/2004 16:31:32";NULL
13;"FI";"Finland";3;21;"09/16/2004 16:31:32";NULL
14;"SE";"Sweden";3;22;"09/16/2004 16:31:32";NULL
15;"IE";"Ireland";3;23;"09/16/2004 16:31:32";NULL
16;"NL";"Netherlands";3;24;"09/16/2004 16:31:32";NULL
17;"DK";"Denmark";3;25;"09/16/2004 16:31:32";NULL
18;"BR";"Brazil";5;85;"09/30/2004 11:25:43";NULL
19;"KR";"Korea, Republic of";1;88;"09/30/2004 11:25:43";NULL
20;"NZ";"New Zealand";6;89;"09/30/2004 11:25:43";NULL
21;"BE";"Belgium";3;79;"09/30/2004 11:25:43";NULL
22;"AT";"Austria";3;78;"09/30/2004 11:25:43";NULL
23;"NO";"Norway";3;82;"09/30/2004 11:25:43";NULL
24;"LU";"Luxembourg";3;81;"09/30/2004 11:25:43";NULL
25;"PT";"Portugal";3;83;"09/30/2004 11:25:43";NULL
26;"GR";"Greece";3;80;"09/30/2004 11:25:43";NULL
27;"IL";"Israel";1;86;"09/30/2004 11:25:43";NULL

28;"CH";"Switzerland";3;84;"09/30/2004 11:25:43";NULL
29;"A1";"Anonymous Proxy";0;0;"09/30/2004 11:25:43";NULL
30;"A2";"Satellite Provider";0;0;"09/30/2004 11:25:43";NULL
31;"AD";"Andorra";3;0;"09/30/2004 11:25:43";NULL
32;"AE";"United Arab Emirates";1;0;"09/30/2004 11:25:43";NULL
33;"AF";"Afghanistan";1;0;"09/30/2004 11:25:43";NULL
34;"AG";"Antigua and Barbuda";7;0;"09/30/2004 11:25:43";NULL
35;"AI";"Anguilla";7;0;"09/30/2004 11:25:43";NULL
36;"AL";"Albania";3;0;"09/30/2004 11:25:43";NULL
37;"AM";"Armenia";3;0;"09/30/2004 11:25:43";NULL
38;"AN";"Netherlands Antilles";3;0;"09/30/2004 11:25:43";NULL
39;"AO";"Angola";2;0;"09/30/2004 11:25:43";NULL
40;"AP";"Asia/Pacific Region";2;0;"09/30/2004 11:25:43";NULL
41;"AQ";"Antarctica";8;0;"09/30/2004 11:25:43";NULL
42;"AR";"Argentina";5;0;"09/30/2004 11:25:43";NULL
43;"AS";"American Samoa";6;0;"09/30/2004 11:25:43";NULL
44;"AW";"Aruba";5;0;"09/30/2004 11:25:43";NULL
45;"AZ";"Azerbaijan";1;0;"09/30/2004 11:25:43";NULL
46;"BA";"Bosnia and Herzegovina";3;0;"09/30/2004 11:25:43";NULL
47;"BB";"Barbados";5;0;"09/30/2004 11:25:43";NULL
48;"BD";"Bangladesh";1;0;"09/30/2004 11:25:43";NULL
49;"BF";"Burkina Faso";2;0;"09/30/2004 11:25:43";NULL
50;"BG";"Bulgaria";3;0;"09/30/2004 11:25:43";NULL
51;"BH";"Bahrain";1;0;"09/30/2004 11:25:43";NULL
52;"BI";"Burundi";2;0;"09/30/2004 11:25:43";NULL
53;"BJ";"Benin";2;0;"09/30/2004 11:25:43";NULL
54;"BM";"Bermuda";4;0;"09/30/2004 11:25:43";NULL
55;"BN";"Brunei Darussalam";1;0;"09/30/2004 11:25:43";NULL
56;"BO";"Bolivia";5;0;"09/30/2004 11:25:43";NULL
57;"BS";"Bahamas";7;0;"09/30/2004 11:25:43";NULL

58;"BT";"Bhutan";1;0;"09/30/2004 11:25:43";NULL
59;"BV";"Bouvet Island";5;0;"09/30/2004 11:25:43";NULL
60;"BW";"Botswana";2;0;"09/30/2004 11:25:43";NULL
61;"BY";"Belarus";3;0;"09/30/2004 11:25:43";NULL
2
C:\>sqlldr userid=system/manager control=test.ctl

SQL*Loader
Excel

Oracle

1Windows 2000 Server 128M


2 Oracle 8i R2 (8.1.6) for NT
3C:\ORACLE

1 MicroSoft Excel 2000

2(F)(N)

3 test.xls

4(F)(A)

text.txt C:\

5 SQL*Plus

system/manager

SQL> conn system/manager

SQL> create table test

id

number,

--

username

varchar2(10),

--

password

varchar2(10),

--

sj

varchar2(20)

--

);

6 SQL*Loader C:\

input.ctl

load data

--1

infile 'test.txt'

--2

test.txt

append into table test

--3 test

fields terminated by X'09'

--4 X'09'

TAB

(id,username,password,sj)

-----

ainsert

bappend

creplace

dtruncate

7 DOS SQL*Loader

C:\>sqlldr userid=system/manager control=input.ctl

input.log

input.bad

8 SQL*Plus

SQL*Loader FOXPRO ORACLE

---- SQL&Loader ORACLE


ORACLE FOXPRO
SQL*Loader ORACLE

. FOXPRO
---- file/export,Type delimited text, To
,Fro FOXPRO ,

---- Options, ScopeForWhile Fields OK

----
ry.ctl
1,"","",04/16/1964
2,"","",/ /
3,"","",05/12/1970
... ...

.
LOAD DATA
INFILE *
REPLACE
INTO TABLE wxryb
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED '"'
(xh,name,sex,birth date(20) "mm/dd/yyyy")
BEGINDATA
1,"","",04/16/1964
2,"","",/ /
3,"","",05/12/1970
... ...
---- INFILE * REPLACE
INSERTAPPEND wxryb ORACLE (xh,name,sex,birth
date(20) "mm/dd/yyyy") wxryb "mm/dd/yyyy"
BEGINDATA

. ftp
. oracle
.

---- sqlldr userid=refine/refine control=ry.ctl log=ry.


log bad=ry.bad
---- userid wxryb log bad

sqlldr
---- FOXPRO MEMO COPY MEMO
log bad
FOXPRO 2
ORACLE / / FOXPRO
birth 1/1/1998

update wxryb set birth='' where birth='1-JAN-98'


wxryb birth
---- SQL*Loader FOXPRO Export Copy Memo
ORACLE FOXPRO

SQL*Loader DBF Oracle

QA000723
: 1999 3 30 2000 10 18

C/C++ -

FoxPro/Visual FoxPro -

MISPCNovell NetWare
Foxpro 2.5 for DOSFoxpro 2.5 for Windows,dbf
OracleMIS
FoxproOracleFoxprodbfOracleSQL*Loader
OracleSQL*Loader
---- *Foxpro,dbfSDF
---- *dbfOracleCREATE TABLESQL
---- *Oracle,OracleCREATE TABLESQL
---- *dbfSQL*Loader
---- *SQL*Loader
----CREATE TABLESQLSQL*Loader
POSITION
Borland C++ 5.0 C++load.cppSQL*Loader
CREATE TABLESQLload
---- * load <>
---- *Oracle,OracleCREATE TABLESQL
---- *SQL*Loader
----FoxproOracle for Digital UNIX +Windows
95 client/server
http://www2.ccw.com.cn/tips/9901/01172_3.asp

VFP

You might also like