Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: inner workings of UTL_FILE.RENAME??
"underthegun" <rpc35803_at_msn.com> wrote in message
news:f7acfcc9b94c5aed21f01bd2cd404e4d_at_localhost.talkaboutdatabases.com...
> We are using the UTL_FILE.RENAME function to give created files good names
> after they are complete (we use temporary names at creation time and use
> that name while still writing the file). Can anyone tell me the logic
> that Oracle uses to perform these file renames on the UNIX system? We
> occasionally run into trouble when another piece of software, looking for
> completed files (ignores files with "TEMP" in the front of the file name),
> tries to pick up one of the files that is being renamed from it's
> TEMP_<filename> to <filename>.
>
First, I don't know how UTL_FILE.RENAME works. I have experienced similar
problems when renaming files using other mechanisms.
What sort of trouble are you having? At risk of being annihilated for making an assumption in a newsgroup, I'm going to venture a guess that the second program is picking up the new file before UTL_FILE.RENAME has completed. If this is the case, you may be running into the case where the rename is spanning file systems. In most flavors of *nix you can't mv a file between filesystems directly, there has to be a call to cp (cpio). In the case of a mv within a filesystem, only the inode is changed. A mv across filesystems is actually a cp (cpio).
If the following are true:
You could try renaming the file in two steps:
Hope that helps.
Tom Received on Fri Oct 22 2004 - 16:07:34 CDT