Re: UTL_FILE write to NT Network

From: MarkyG <markg_at_mymail.tm>
Date: 9 Nov 2001 00:40:59 -0800
Message-ID: <ab87195e.0111090040.4b4aa3de_at_posting.google.com>


I have had this problem in the past.

What I found is that the actual Oracle instance in NT can either run as a pseudo 'system' user or under a named NT user which has been already created.

If you create an NT user, give him rights to the mapped directory, run the Oracle instance as that user and importantly, have the user logged into NT as well, all should be fine. However, it may not be practical to have this NT user logged on all the time so it may not be ideal. You can still run the Oracle instance under this NT user and have the user logged off but you wont get any UTL_FILE output (since the drive mappings are not known).

Running the oracle instance under the default 'system' user, the system user knows nothing about mapped drives so therefore cannot write to them. What I did find out and was succesful with is instead of using the g:\network\temp format, use the UNC file convention of \\server\share\directory.

There are also documents in MetaLink explaining how you can get UTL_FILE to write to mapped network drives (www.oracle.com)

Hope that helps.

Mark

traceable1_at_hotmail.com (traceable1) wrote in message news:<8551d8c9.0111080630.25a9e09_at_posting.google.com>...
> I am trying to write files to the network using UTL_FILE. I am able
> to run my procedure on my local database and write to my hard drive,
> but when I try to write out to the network drive, it seems to run fine
> (no errors), but it doesn't write anything. I have write rights on
> this drive and can create files there with other apps. (Our Network
> Nazi may have other restrictions I'm unaware of).
> I'm wondering if it's a mapping issue, but if that's the case, this
> won't work well on other people's PCs.
> The UTL_FILE_DIR=*.
>
> DECLARE
> fname varchar2(20) := 'tc3file.txt';
> loc varchar2(10) := 'g:\sql';
> sometext varchar2(20) := 'Some text';
> fhandle utl_file.file_type;
> op varchar2(3) := 'w';
> BEGIN
> fhandle := UTL_FILE.FOPEN(loc,fname,op);
> UTL_FILE.PUT_LINE (fhandle, sometext);
> UTL_FILE.Fclose(fhandle);
> EXCEPTION
> WHEN utl_file.invalid_path then dbms_output.put_line ('Invalid
> Path');
> WHEN utl_file.invalid_mode then dbms_output.put_line ('Invalid
> mode');
> WHEN utl_file.invalid_operation then dbms_output.put_line ('Invalid
> Operation');
> END;
> /
>
> Please advise - any help is very much appreciated!
> Trace
Received on Fri Nov 09 2001 - 09:40:59 CET

Original text of this message