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: OCI: Can I know/estimate the duration of my statements ?

Re: OCI: Can I know/estimate the duration of my statements ?

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Fri, 15 Aug 2003 12:54:34 GMT
Message-ID: <3F3CD80A.3D3FE4AF@remove_spam.peasland.com>


The V$SESSION_LONGOPS view can give you an estimation of the time to completion and the work done so far. However, if your application is already performing an operation, you'll have to make your application perform another operation at the same time to query V$SESSION_LONGOPS.

HTH,
Brian

"André Hartmann" wrote:
>
> Hi there,
>
> I observed in Oracle Enterprise Manager that it displays the progress of
> long processes. For example when I do a command like "INSERT INTO A SELECT *
> FROM B" and there is a lot in B... OEM will show me the progress in a
> progress bar (0..100%) and even tell me how long it is going to take
> (roughly) and count down the seconds.
>
> My question is: Can I also do this inside my C/C++ application using OCI ?
> Can ayone point me to some function or so that does this ?
>
> Also, another observation is that OEM is obviously able to know how many
> rows my SELECT statement is going to return after it has been fired and
> before the fetch loop has started (i am sure everyone of you has seen the
> 2000-records warning before in OEM).
>
> Question: Is there a way to know how many rows I am going to receive after
> my SELECT has been fired (SQLExecute) and before I start my SQLFetch ? That
> would be helpful because I could display a progress bar there or a counter
> that goes down to 0 in time. If possible, I would want to avoid an extra
> "SELECT COUNT(*)..." before my actual statement.. thats an overhead and if I
> am in a transaction that is not READ ONLY I cannot even rely that the actual
> SELECT will give me the same number of rows that the COUNT(*) told me just a
> tenth of a second before because in a non-READ ONLY transaction only
> statement-wide consistency is guaranteed, not transacion wide.
>
> Thanks in advance,
>
> Andre
> :)

-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Fri Aug 15 2003 - 07:54:34 CDT

Original text of this message

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