sqlldr提交两次,数据类型报错

[oracle@Slave1Hadoop51 script]$ cat ldr_case1.ctl
LOAD DATA
INFILE *
INTO TABLE BONUS
FIELDS TERMINATED BY ","
(ENAME,JOB,SAL)
BEGINDATA
SMITH,CLEAK,3904
ALLEN,SALESMAN,2891
WARD,SALESMAN,3128
KING,PRESIDENT,2523[oracle@Slave1Hadoop51 script]$ sqlldr scott/scott control=ldr_case1.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Sat Feb 14 00:51:18 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit point reached - logical record count 3
Commit point reached - logical record count 4
[oracle@Slave1Hadoop51 script]$ ls -ltr
drwxr-xr-x 2 oracle dba     4096 Feb 14 00:48 script
-rw-r--r-- 1 oracle dba     1782 Feb 14 00:51 ldr_case1.log
-rw-r--r-- 1 oracle dba       59 Feb 14 00:51 ldr_case1.bad
[oracle@Slave1Hadoop51 script]$ less ldr_case1.log 
[oracle@Slave1Hadoop51 script]$ cat ldr_case1.log 

SQL*Loader: Release 10.2.0.1.0 - Production on Sat Feb 14 00:51:18 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Control File:   ldr_case1.ctl
Data File:      ldr_case1.ctl
  Bad File:     ldr_case1.bad
  Discard File:  none specified
 
 (Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array:     64 rows, maximum of 256000 bytes
Continuation:    none specified
Path used:      Conventional

Table BONUS, loaded from every logical record.
Insert option in effect for this table: INSERT

   Column Name                  Position   Len  Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
ENAME                               FIRST     *   ,       CHARACTER            
JOB                                  NEXT     *   ,       CHARACTER            
SAL                                  NEXT     *   ,       CHARACTER            

Record 1: Rejected - Error on table BONUS, column SAL.
ORA-01722: invalid number

Record 2: Rejected - Error on table BONUS, column SAL.
ORA-01722: invalid number

Record 3: Rejected - Error on table BONUS, column SAL.
ORA-01722: invalid number


Table BONUS:
  1 Row successfully loaded.
  3 Rows not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.


Space allocated for bind array:                  49536 bytes(64 rows)
Read   buffer bytes: 1048576

Total logical records skipped:          0
Total logical records read:             4
Total logical records rejected:         3
Total logical records discarded:        0

Run began on Sat Feb 14 00:51:18 2015
Run ended on Sat Feb 14 00:51:19 2015

Elapsed time was:     00:00:00.45
CPU time was:         00:00:00.03
[oracle@Slave1Hadoop51 script]$

SQL> select * from bonus;

ENAME	   JOB		    SAL       COMM
---------- --------- ---------- ----------
KING	   PRESIDENT	   2523

SQL> 

[oracle@Slave1Hadoop51 script]$ sqlldr scott/scott control=ldr_case1.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Sat Feb 14 01:18:47 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL*Loader-601: For INSERT option, table must be empty.  Error on table BONUS
[oracle@Slave1Hadoop51 script]$ 

-----------------------------------解决方案-------------------------------------

SQL> select * from bonus;

ENAME	   JOB		    SAL       COMM
---------- --------- ---------- ----------
KING	   PRESIDENT	   2523

SQL> delete * from bonus;
delete * from bonus
       *
ERROR at line 1:
ORA-00903: invalid table name


SQL> select * from bonus;

ENAME	   JOB		    SAL       COMM
---------- --------- ---------- ----------
KING	   PRESIDENT	   2523

SQL> delete  from bonus;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select * from bonus;

no rows selected

SQL>

[oracle@Slave1Hadoop51 script]$ dos2unix ldr_case1.ctl
dos2unix: converting file ldr_case1.ctl to UNIX format ...
[oracle@Slave1Hadoop51 script]$ sqlldr scott/scott control=ldr_case1.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Sat Feb 14 01:29:02 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit point reached - logical record count 3
Commit point reached - logical record count 4
[oracle@Slave1Hadoop51 script]$ cat ldr_case1.log

SQL*Loader: Release 10.2.0.1.0 - Production on Sat Feb 14 01:29:02 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Control File:   ldr_case1.ctl
Data File:      ldr_case1.ctl
  Bad File:     ldr_case1.bad
  Discard File:  none specified
 
 (Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array:     64 rows, maximum of 256000 bytes
Continuation:    none specified
Path used:      Conventional

Table BONUS, loaded from every logical record.
Insert option in effect for this table: INSERT

   Column Name                  Position   Len  Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
ENAME                               FIRST     *   ,       CHARACTER            
JOB                                  NEXT     *   ,       CHARACTER            
SAL                                  NEXT     *   ,       CHARACTER            


Table BONUS:
  4 Rows successfully loaded.
  0 Rows not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.


Space allocated for bind array:                  49536 bytes(64 rows)
Read   buffer bytes: 1048576

Total logical records skipped:          0
Total logical records read:             4
Total logical records rejected:         0
Total logical records discarded:        0

Run began on Sat Feb 14 01:29:02 2015
Run ended on Sat Feb 14 01:29:02 2015

Elapsed time was:     00:00:00.09
CPU time was:         00:00:00.02
[oracle@Slave1Hadoop51 script]$ 

SQL> select * from bonus;

ENAME	   JOB		    SAL       COMM
---------- --------- ---------- ----------
SMITH	   CLEAK	   3904
ALLEN	   SALESMAN	   2891
WARD	   SALESMAN	   3128
KING	   PRESIDENT	   2523

SQL>



你可能感兴趣的:(oracle)