Below is the sample script which can be run from TOAD/SQL*PLUS to test the read write permissions on UTL directory from database or backend
DECLARE
l_file utl_file.file_type;
BEGIN
l_file := utl_file.fopen( 'DBA_UTL_DIR_NAME', 'test_file_name.txt', 'W' );
utl_file.put_line( l_file, 'Here is sample text' );
utl_file.fclose( l_file );
END;
Direcory name (
DBA_UTL_DIR_NAME) should exists in DBA_DIRECTORIES table
- Make sure that the UTL_FILE directory path exists in UNIX
select * from DBA_DIRECTORIES where directory_name = 'DBA_UTL_DIR_NAME'