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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how create query that automatically runs every 30 minutes and write time and result to the file

Re: how create query that automatically runs every 30 minutes and write time and result to the file

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 07 Dec 2003 13:39:19 -0800
Message-ID: <1070833191.648908@yasure>


Mike wrote:

> Hi,
> I run a Script File from the sql plus on the win 2000 client machine
> against the Oracle server v.8i that resides on the different machine:
>
> Script File is located on the client machine in the file
> c:\query_1.sql
> The content of the file is the following:
> select count(*), host_updated from jtrans_header
> where trans_date='7-dec-2003'group by host_updated'
>
> In SQL*PLUS, I type the following:
>
> SPOOL c:\query_result
> @c:\query_1.sql
> SPOOL OFF
>
> I want to run this script automatically every 30 minutes during 3
> hours period
> and write the response time to the file as well as the system time
> that the query was executed.
>
> Thanks. Mike.

Put the script into a procedure and run it with DBMS_JOB.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Dec 07 2003 - 15:39:19 CST

Original text of this message

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