Define UTL_FILE_DIR Parameter

Perform this step in cooperation with a Database Administrator (DBA).

Define UTL_FILE_DIR Parameter in the INIT.ORA File

To use Oracle XML Gateway, you must first create directories where the XML message process log and XSLT style sheets will be stored. Oracle XML Gateway uses the UTL_FILE package to read and write to the server.

UTL_FILE can only write to accessible directories. The directories are defined by the utl_file_dir parameter in the init<SID>.ora file. This file is usually found in the $ORACLE_HOME/dbs directory. Within this file, each accessible directory is indicated by a line such as

utl_file_dir=<directory_name>

The specification of directory_name will vary, depending on the operating system. If the operating system is case-sensitive, then directory_name is case sensitive.

The value for directory_name must be a physical directory. It cannot be a variable, a logical, or an alias. In addition, the value for directory_name must match the value defined in the Oracle XML Gateway profile for ECX_UTL_LOG_DIR File Path (ECX: Log File Path) and ECX_UTL_XSLT_DIR File Path (ECX: XSLT File Path).

Refer to Define Profile System Values for details.

Unix Operating System

The following is an example of an entry for a UNIX operating system:

utl_file_dir=/d1/XML/logs/d1/XML/xslt

In addition to this form of database security, operating system security must also be considered. The file I/O operations performed with UTL_FILE will be done by the Oracle user (the Oracle user is the owner of the files that are used to run the database, and also the owner of the processes that make up a database instance). Consequently, the Oracle user has to have operating system privileges to read from and write to all of the accessible directories. If the Oracle user does not have privileges for an accessible directory, then any operations in that directory will be prohibited by the operating system.

To ensure that operating system security allows the Oracle user to create, delete, rename, read, and write files in the specified directories, the DBA must grant directory and file access privileges by issuing the CHMOD 777 command at the operating system level. This is a UNIX example only, so use appropriate operating system commands for your environment.

The Oracle instance must be brought down and back up for the changes in the init<SID>.ora file to be effective.