Oracle SQLLDR - 使用参数文件指定多个日志、dsc、坏文件
Oracle SQLLDR - Using parameter file to specify multiple log, dsc, bad files
我不确定如何处理这种使用 Oracle SQLLDR 将文件加载到单个 table 中的情况。
我有多个 infiles,我可以毫无问题地加载它们。但是,我想在我的参数文件中为每个日志文件、错误文件和丢弃 directories/files 指定。这可能吗?我试过将它们列在参数文件中,文件名之间有空格,但这似乎不起作用。我在任何地方都找不到有关如何执行此操作的说明或示例。
我使用命令包含参数文件:
sqlldr user/password@pdbxxxxx PARFILE=/directory/parameter_file.par
我的参数文件示例:
CONTROL=/directory/control_file.ctl
LOG=/directory/log_file.log
BAD=/directory/bad_file.bad
DISCARD=/directory/discard_file.dsc
DISCARDMAX=100000000
DATA=/directory/data_file-01.csv
DIRECT=FALSE
我的控制文件示例:
load data
infile '/directory/data_file-01.csv'
infile '/directory/data_file-02.csv'
infile '/directory/data_file-03.csv'
APPEND INTO TABLE my_table
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
(
col1 CHAR
, col2 CHAR
, col3 CHAR
)
看起来像 Specifying multiple data files,如文档中所述。
摘录:
To load data from multiple data files in one SQL*Loader run, use an INFILE clause for each data file.
You can also specify a separate discard file and bad file for each data file. In such a case, the separate bad files and discard files must be declared immediately after each data file name.
举几个例子:
INFILE mydat1.dat BADFILE mydat1.bad DISCARDFILE mydat1.dis
INFILE mydat2.dat
INFILE mydat3.dat DISCARDFILE mydat3.dis
我不确定如何处理这种使用 Oracle SQLLDR 将文件加载到单个 table 中的情况。 我有多个 infiles,我可以毫无问题地加载它们。但是,我想在我的参数文件中为每个日志文件、错误文件和丢弃 directories/files 指定。这可能吗?我试过将它们列在参数文件中,文件名之间有空格,但这似乎不起作用。我在任何地方都找不到有关如何执行此操作的说明或示例。
我使用命令包含参数文件:
sqlldr user/password@pdbxxxxx PARFILE=/directory/parameter_file.par
我的参数文件示例:
CONTROL=/directory/control_file.ctl
LOG=/directory/log_file.log
BAD=/directory/bad_file.bad
DISCARD=/directory/discard_file.dsc
DISCARDMAX=100000000
DATA=/directory/data_file-01.csv
DIRECT=FALSE
我的控制文件示例:
load data
infile '/directory/data_file-01.csv'
infile '/directory/data_file-02.csv'
infile '/directory/data_file-03.csv'
APPEND INTO TABLE my_table
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
(
col1 CHAR
, col2 CHAR
, col3 CHAR
)
看起来像 Specifying multiple data files,如文档中所述。
摘录:
To load data from multiple data files in one SQL*Loader run, use an INFILE clause for each data file.
You can also specify a separate discard file and bad file for each data file. In such a case, the separate bad files and discard files must be declared immediately after each data file name.
举几个例子:
INFILE mydat1.dat BADFILE mydat1.bad DISCARDFILE mydat1.dis
INFILE mydat2.dat
INFILE mydat3.dat DISCARDFILE mydat3.dis