Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Need help re: VB app copying redo log archives

Re: Need help re: VB app copying redo log archives

From: Holger Baer <holger.baer_at_science-computing.de>
Date: Wed, 08 Jan 2003 14:34:49 +0100
Message-ID: <3E1C28F9.6010506@science-computing.de>


Joe Tseng wrote:
> I've been asked to write a VB6 app to have any redo archive files
> copied to an alternative location where they'll be saved to tape. I
> was told this app should be smart enough to leave any open archive
> file that is being appended to by the database alone until the next
> time the app is run.
>
> Is there any programmatic way to determine if a file is open by
> another process? I didn't see any method or property in FSO that did
> this. I thought I could perhaps suck in the results of "net file",
> but I'm not entirely sure that would work as I do not know how Oracle
> copies its redo logs to the .ARC files.
>
> Any useful suggestions will be greatly appreciated.
>
> Joe

I've never used VB6, so I can't give you an code example for this.

On Windows there is the createfile routine which accepts an parameter lpShareMode. If that is set to 0, only the calling process may access the file. If the archiver is currently writing to the file, createfile will fail.

If createfile succeeds, meaning no other process has access to the file you want to copy/move, you can savely close the filehandle again and use MoveFile or even FSO if you want.

For more information on createfile and related functions, please refer to http://msdn.microsoft.com.

Hope this helps

Holger Received on Wed Jan 08 2003 - 07:34:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US