Oracle DBA Tips and Techniques

By Arjun Raja

UTL_FILE_DIR path test

Posted by Arjun Raja on July 10, 2009

To test if the utl_file_dir path in the init.ora file can indeed be written to .

Login as sysdba –

1. Create a test procedure

CREATE OR REPLACE procedure utl_file_test_write (
path in varchar2,
filename in varchar2,
firstline in varchar2,
secondline in varchar2)
output_file utl_file.file_type;
output_file := utl_file.fopen (path,filename, ‘W’);

utl_file.put_line (output_file, firstline);
utl_file.put_line (output_file, secondline);

— when others then null;

Now run a test –

utl_file_test_write (
‘first line’,
‘second line’

If ‘/tmp’ is not a part of the UTL_FILE_DIR path in the init.ora, then this test will fail.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: