File write privileges in Oracle utl_file

If you run the following, you will see directory_name,directory_path values. You need to use the directory_name in your utl_file.fopen call instead of directory_path. Is just a layer of indirection so that the code that uses the directory_name doesn’t have to change when ever the path changes.
select * from dba_directories;

The other option is configuring the directory in init.ora file, which is the old style.  In this case you have to use the full directory path in your fopen call, e.g. utl_file.fopen(‘/home/usr/tmp’,’hello.txt’)

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: