2 zhoumingqing zhoumingqing 于 2017.01.03 12:01 提问

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
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!