Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help re: VB app copying redo log archives
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
![]() |
![]() |