Home » RDBMS Server » Server Administration » UTL_FILE and Linux problem
UTL_FILE and Linux problem [message #369801] Fri, 13 October 2000 08:35 Go to next message
Orlando
Messages: 3
Registered: October 2000
Junior Member
I get an error ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512 : at SYST.UTL_FILE; Line 98
ORA-06512: at SYST.UTL_FILE; Line 157
ORA-06512: at "Orlando.LoadAzimuth", line 25
ORA-06512 at line 6

Well, the script that I created run successfully in Oracle8i on Windows NT.
The procedure that use in the script "LoadAzimuth" compiled well in both OS (NT and Linux)
I put in the init.ora file
UTL_FILE_DIR = /home/orlando/data
This is where my input file is
Which is my problem?
Hint: a copy my input file from Win NT to the Linux computer. I logged on as a regular user in Linux
in Oracle I use the same user name but different password.
Do I need to provide privileges to my self when I am in Oracle?
Please advice me, I am new in Oracle and Linux.
What kind of care I need to do to access my files and this UTL_FILE package. I know that I do not have a programming problem.

For fast response use my personal e-mail: monzonco@aol.com or post it here.
Thanks,
Orlando
Re: UTL_FILE and Linux problem [message #369802 is a reply to message #369801] Fri, 13 October 2000 10:42 Go to previous messageGo to next message
Rob
Messages: 70
Registered: January 2000
Member
Two quick things to check, which may not be the problem;

1) Your UTL_FILE.FOPEN() statement incorrectly lists the target directory

2) your output line is more than 1024 bytes (utl file's limit.

Test it by just limiting the program to just trying to put any small string out to the target file.
Re: UTL_FILE and Linux problem [message #369807 is a reply to message #369802] Fri, 13 October 2000 15:21 Go to previous messageGo to next message
Orlando
Messages: 3
Registered: October 2000
Junior Member
Thanks for your help but
I have a variable that contains the directory and the file name:

I am reading a text or ascii file. I am not writting to the file.
I used chmod to grant permission for reading to others. I did for the directory and the file.
directory is : /home/orlando/data
file name is : tc25az.in
oracle, the oracle user that belongs to dba and oinstall group now could access this directory.
oracle user was not able to access above directory but now oracle user can do it.
I still have the same problem.
Please see original.
Re: UTL_FILE and Linux problem [message #369808 is a reply to message #369802] Mon, 16 October 2000 08:41 Go to previous messageGo to next message
John R
Messages: 156
Registered: March 2000
Senior Member
To try and find out more about what's going wrong, you can trap the various exceptions that the UTL_FILE package raises

eg
WHEN utl_file.invalid_path...

For a complete list of the exeptions, see the UTL_FILE package header
Re: UTL_FILE and Linux problem [message #369812 is a reply to message #369802] Tue, 17 October 2000 15:20 Go to previous message
Orlando
Messages: 3
Registered: October 2000
Junior Member
Thanks for the help. I finally resolve the problem.
I needed to edit the file init.ora
that is located in $ORACLE_HOME/dbs

MY ORACLE_HOME is /u01/app/Oracle/product/8.1.6
in file init.ora included in the last line

utl_file_dir = *

and in file initdees2000.ora

the same thing or same line.
Oracle does not recommend to use *
so when you are successful changing to your directory that has the file
utl_file_dir = /home/orlando/data
do not use quotes and be careful with the case sensitive features of the files and directories names.

Please notice that initdees2000.ora is for you different. It is really
initORACLE_SID.ora
my ORACLE_SID = dees2000
so yours will be inityours.ora
if your ORACLE_SID = yours
These changes or new lines in these 2 files are done or must be done by the oracle user. Oracle user is the account that installed the Oracle81, version 8.1.6.
UTL_FILE_ package provides the security access to the user that creates a file to be written or read.
However, if you do not care for security change permissions for your input file using chmod
like: chmod 771 yourfile.inp
Previous Topic: Please help me!!!!!!!!!!!!!!!!!!!!!
Next Topic: Describe
Goto Forum:
  


Current Time: Sun Dec 22 15:57:38 CST 2024