oracle utl_file.fopen错误

--sys用户创建目录并授权给yljkjx用户 (数据库为linux 红帽子)
create or replace directory FILENAME as '/usr/software/';
grant read,write on directory FILENAME to yljkjx;
grant execute on utl_file to yljkjx;
alter system set utl_file_dir='/usr/software/' scope=spfile;

--在yljkjx下创建存储过程 PRC_Check_TransData
create or replace procedure PRC_Check_TransData is
filehandle utl_file.file_type;
begin
filehandle := utl_file.fopen('FILENAME','a.txt','w');
utl_file.put_line(filehandle,'test');
utl_file.fclose(filehandle);

END;

--在yljkjx下执行报错
SQL> exec PRC_Check_TransData;
begin PRC_Check_TransData; end;
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "YLJKJX.PRC_CHECK_TRANSDATA", line 4
ORA-06512: at line 1

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐