Wednesday, June 3, 2020

How to Test UTL_FILE_DIR


SQL> show parameter UTL_FILE_DIR

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
utl_file_dir                         string      /usr/tmp, /dbapps/tmp, /dbapps
                                                 /oracle/HRD2/db/tech_st/11.2.0
                                                 /appsutil/outbound/HRD2_apollo
                                                 , /usr/tmp


DECLARE
  l_file utl_file.file_type;
BEGIN
  l_file := utl_file.fopen( '/dbapps/oracle/HRD2/db/tech_st/11.2.0/appsutil/outbound/HRD2_apollo', 'filepath_new_file_name.txt', 'W' );
  utl_file.put_line( l_file, 'Here is some text' );
  utl_file.fclose( l_file );
END;


## To add a new directory
1. edit initHRD2.ora utl_file_dir -$ORACLE_HOME/dbs
2. Bounce the database

No comments:

Post a Comment