bash SQL*Loader-522: 文件的 lfiopn 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30348567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQL*Loader-522: lfiopn failed for file
提问by sabya
I am getting below error in my script which is running a SQLLDR :
我在运行 SQLLDR 的脚本中遇到以下错误:
SQL*Loader-522: lfiopn failed for file (/home/abc/test_loader/load/badfiles/TBLLOAD20150520.bad)
As far my knowledge this is the error related to permission,but i am wondering in the folder "/load" there is no "badfiles" folder present .i have already define badfiles folder outside the load folder,but why in the error it is taking this location ? is it like my input file having some problem and SQLLDR trying to create a bad file in the mention location ?
据我所知,这是与权限相关的错误,但我想知道在文件夹“/load”中没有“badfiles”文件夹存在。我已经在加载文件夹之外定义了 badfiles 文件夹,但为什么在错误中是采取这个位置?是不是我的输入文件有问题并且 SQLLDR 试图在提到的位置创建一个错误的文件?
below is the SQLLDR command :
下面是 SQLLDR 命令:
$SQLLDR $LOADER_USER/$USER_PWD@$LOADER_HOSTNAME control=$CTLFDIR/CTL_FILE.ctl BAD=$BADFDIR/$BADFILE$TABLE_NAME ERRORS=
0 DIRECT=TRUE PARALLEL=TRUE LOG=$LOGDIR/$TABLE_NAME$LOGFILE &
below is the control file temp :
下面是控制文件 temp :
LOAD DATA
INFILE '/home/abc/test_loader/load/FILENAME_20150417_001.csv' "STR '\n'"
APPEND
INTO TABLE STAGING.TAB_NAME
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(
COBDATE,
--
--
--
FUTUSE30 TERMINATED BY WHITESPACE
)
回答by Daniel Smolka
Yes, your input file is having a problem so the sqlldr wants to create a file containing rejected rows (BAD file). The BAD file creation fails due to insufficient privileges - the user who runs the sqlldr does not have rights to create file in the folder you defined to contain BAD files.
是的,您的输入文件有问题,因此 sqlldr 想要创建一个包含被拒绝行的文件(BAD 文件)。由于权限不足,BAD 文件创建失败 - 运行 sqlldr 的用户无权在您定义的包含 BAD 文件的文件夹中创建文件。
Add write privileges on the BAD folder to the user who runs the sqlldr or place the BAD folder elsewhere.
向运行 sqlldr 的用户添加对 BAD 文件夹的写入权限或将 BAD 文件夹放在其他地方。