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
|
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
Post a Comment