Oracle10g Sqlldr

sqlldr_oracle10g_redhat5.4

sqlldr

sqlldr is used for inputing data into oracle database.we call it datapumb.
how to commplete the procedure in the oracle10g ?
the following statement show you .
1)
#su - oracle
$cd               
$vim test_1.ctl
input the information below

############begin##############
LOAD DATA
/*characterset ZHS16GBK*/ it is comment
INFILE 'test_1.dat'
DISCARDFILE 'test_1.dis'
append
INTO table hr.testtable
TRAILING NULLCOLS
(
 date1   position(1:8)  date(8) "YYYYMMDD" terminated by ',',
 phonenumber position(10)  decimal external terminated by ',',
 describe char terminated by whitespace
)
#############end################

this procedure describe the three basic data types.we can expand it to satisfy the complex report forms.

2)
we must make sure that infile and that table exist.
$sqlplus /nolog
$hr/**
$sql> create table testtable ( date1 date,
                          phonenumber number(15),
                          describe varchar2(30) );
$sql> exit
$vim infile test_1.dat 
input your data must obey the rule.
##############begin################
20110908,13254654582,success
##############end##################

it is just a test .
make sure the char position.we must care the format.

3)
$sqlldr hr/** control=test_1.ctl
check the home directory.

 

你可能感兴趣的:(oracle,sqlldr)