Grants on directory in Oracle Database
create or replace directory directory_name as 'Directory Path';
GRANT CREATE ANY DICTIONARY TO username;
GRANT READ, WRITE ON DIRECTORY directory_name TO Username;
Grant select any DICTIONARY TO username;
Test directory -
DECLARE
file_handle UTL_FILE.FILE_TYPE;
BEGIN
file_handle := UTL_FILE.FOPEN('directory_name', 'file_name.txt', 'W');
UTL_FILE.PUT_LINE(file_handle, 'This is a test file.');
UTL_FILE.FCLOSE(file_handle);
END;
/
Comments
Post a Comment