Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: checking file status
>Subject: checking file status
>From: "Sean Rodgers" srodgers2000_at_po80dh.fsnet.co.uk
>Date: 2/13/01 2:21 PM GMT Standard Time
>Message-id: <96bftt$7e0$1_at_news6.svr.pol.co.uk>
>
>Hi...
>
> I am a newbie DBA and I have to implement a routine to check that a file
>has been emptied every 1/2 hour on the operating system (uses EDI I think
>for processing of internet orders) and e-mail me if has not been emptied
>after that time.
>
> I have other database checks to carry out as well and am using pl/sql
>(utl_smtp) to e-mail me of any problems that there is with those.
>
> Can anyone suggest a way of incorporating a way to check on the status
>of a file
>(Sun Solaris O/S) and get the result back into the pl/sql routine for
>processing or is there a much easier way to carry out this check?
>
>Server :Oracle 8.1.5
>
>I'm still in the dark a little as I have not yet got to see the server that
>hosts the database!!!
>
> Thanks..
>
> Sean Rodgers
>
>
Hi Sean,
You could do it in a Unix script, using if [ ! -s file ] to check whether
the file is empty (-s checks for a non-empty file). Alternatively, if
everything is being done within Oracle you could use the UTL_FILE package to
open the file for reading, read one line from the file and if the NO_DATA_FOUND
exception is raised then the file is empty.
Regards,
Rob
Received on Tue Feb 13 2001 - 09:19:04 CST