How to create UTL_FILE Directory in 19C Database


UTL_FILE

UTL_FILE is a PL/SQL package that allows programs to read and write operating system text files.

It is commonly used to write custom log files.

Examples

  • General debug and temporary files

  • Log and output files generated by Concurrent Processing

In Oracle Database 11g R2 and 12c Release 1, the UTL_FILE_DIR database initialization parameter must be configured to define the directory or directories where these files are located.

In Oracle Database 18c and later, the UTL_FILE_DIR database initialization parameter is desupported. Instead, Database Directory Objects are used to specify the locations used for PL/SQL file I/O.

Advantage

There is no need for a database bounce, and directory changes are reflected immediately.

Steps to Create the UTL_FILE Directory

Step 1: Query to Find the Existing UTL Directory

SELECT name, value
FROM apps.v$parameter
WHERE name LIKE 'utl%';

Step 2: Create a New Directory at OS Level

Example:

mkdir /utlfile/common/sanjeev

Step 3: Export PERL and PERL5LIB

[oracle@vtebs db]$ export PERL5LIB=/oracle/product/19.0.0/db/perl/lib/site_perl/5.28.1:/oracle/product/19.0.0/db/perl/lib/site_perl/5.28.1:/oracle/product/19.0.0/db/appsutil/perl

Step 4: Add the New Directory Using txkCfgUtlfileDir.pl

[oracle@vtebs appsutil]$ perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl \
-contextfile=$CONTEXT_FILE \
-oraclehome=$ORACLE_HOME \
-outdir=$ORACLE_HOME/appsutil/log \
-mode=addUtlFileDir

Sample Execution:

Enter the full path of Context File:
/oracle/product/19.0.0/db/appsutil/TEST_vtebs01.xml

Enter the APPS Password:

Enter the SYSTEM Password:

Enter the new OS path to be added to UTL_FILE_DIR:
/utlfile/common/ercebs9d/Sanjeev

Script Name    : txkCfgUtlfileDir.pl
Script Version : 120.0.12020000.11

Started        : Fri Jan 14 12:26:08 EST 2022

Log File       : /oracle/product/19.0.0/db/appsutil/log/TXK_UTIL_DIR_Fri_Jan_14_12_25_45_2022/txkCfgUtlfileDir.log

Context file: /oracle/product/19.0.0/db/appsutil/TEST_vtebs01.xml exists.

Completed      : Fri Jan 14 12:26:20 EST 2022

Successfully Completed the script

ERRORCODE = 0 ERRORCODE_END

[oracle@vtebs appsutil]$

Step 5: Synchronize the Modified UTL_FILE_DIR Value with the Database Context File

After adding the new directory path, synchronize the modified UTL_FILE_DIR value with the database context file.

$ perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl \
-contextfile=$CONTEXT_FILE \
-oraclehome=$ORACLE_HOME \
-outdir=$ORACLE_HOME/appsutil/log \
-mode=syncUtlFileDir

This step ensures that the database configuration and context file remain synchronized and helps avoid inconsistencies during future AutoConfig executions and maintenance activities.

Important Parameters






ParameterDescription
txkCfgUtlfileDir.pl                                                                             Used to migrate existing UTL_FILE_DIR settings to the new parameter during database upgrades and to update the supplemental UTL_FILE_DIR parameter after the upgrade. It can also be used to create database directory objects.

getUtlFileDirRetrieves directory path values from the source UTL_FILE_DIR database initialization parameter.

setUtlFileDirStores the directory paths for the supplemental UTL_FILE_DIR parameter in Oracle E-Business Suite tables underlying the APPS.V$PARAMETER and APPS.V$PARAMETER2 views.

skipdirvalidation=YesIf the script cannot validate the Oracle 19c Home directory, use the -skipdirvalidation=Yes parameter while executing txkCfgUtlfileDir.pl.

addUtlFileDirAdds a new directory path to the supplemental UTL_FILE_DIR parameter.

syncUtlFileDirSynchronizes the modified UTL_FILE_DIR values from the database to the Oracle E-Business Suite context file.




Reference

Using UTL_FILE_DIR or Database Directories for PL/SQL File I/O in Oracle E-Business Suite Releases 12.1 and 12.2 (Doc ID 2525754.1)

Comments

Popular posts from this blog

How to troubleshoot long running concurrent request in R12.2

How to find EBS URL in R12.2

JSP Compilation in R12.2