且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试将Clob加载到Oracle表时,加载了太多记录

更新时间:2023-12-02 18:11:58

带有LOB的Oracle Loader的典型设置为:

The typical setup for Oracle Loader with LOBs would be:

  • 带有加载说明的控制文件
  • 有一个带有元数据(作者,日期,文件名)的主数据文件.文件中的每一行都成为目标表中的一行.
  • 主文件中每个条目都有一个单独的文件,该文件被加载到目标表的CLOB或BLOB列中.

在您的情况下,XML文件似乎既用作主数据文件又用作单独的LOB文件(尽管我不太清楚为什么;您还在命令行上指定XML吗?).

In your case, the XML files seems to be used as both the main data file and the separate LOB file (though I don't fully understand why; are you also specifying the XML on the command line?).

因此,您需要正确指定这三件事.为了避免出现三个文件,您可以使用BEGINDATA指令将主数据文件放入控制文件中(这是INFILE之后的内容):

So you need to specify these three things properly. In order to avoid three files, you put the main data file into the control file using the BEGINDATA directive (this is what the astrisk after INFILE is for):

LOAD DATA
INFILE * 
REPLACE

INTO TABLE LEAD_REPORTING_CLOB
FIELDS TERMINATED BY ',' TRAILING NULLCOLS
(
    FILENAME,
    SHARED_XML  LOBFILE(FILENAME) TERMINATED BY EOF
)

BEGINDATA
/export/RFD/Lead_Reports/LEADRPT.xml