Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Any way to invalidate/flush a single cursor

RE: Any way to invalidate/flush a single cursor

From: Carel-Jan Engel <>
Date: Tue, 22 Aug 2006 14:49:06 +0200 (CEST)
Message-ID: <>

Another option (not tested, no test db at hand here at the CT site), might be using dbms_advanced_rewrite.

I think you can rewrite the statement at hand into one that includes the aforementioned fake object. Altering that object will invalidate the cursor then.

You will find an example of using this at asktom:

(concatenate the link)

Allen, you were involved in the thread yourself as well ;-)

Regards, Carel-Jan

If you think education is expensive, try ignorance. (Derek Bok) ===

> One option is to create view as select * from table and write your test
> query against this view.
> Then verify that you get the same execution plan against this view as
> against the table directly.
> Then just recompile that view when you want to invalidate your cursor.
> Btw, if you want to invalidate all cursors dependent on a table you could
> just add a comment to the table rather than reanalyzing it.
> There's one more way to selectively force hard parsing on already cached
> cursors, but I'd like to document this in a paper along its implications
> before publishing it..
> Tanel.
> _____
> From: []
> On Behalf Of Allen, Brandon
> Sent: Tuesday, August 22, 2006 05:30
> Subject: Any way to invalidate/flush a single cursor
> Does anyone know of a way to invalidate or completely flush a single
> cursor?
> I'm doing some performance testing of queries that are having trouble with
> bind variable peeking and sharing plans between executions with
> drastically
> different bind values, so I need to invalidate the cursor in between
> executions in order to test the explain plans of different bind variables.
> Is there any more focused approach than gathering stats or issuing grants
> on
> one of the query's tables? That works, but of course invalidates all
> other
> queries referencing the table.
> Thanks,
> Brandon
> Privileged/Confidential Information may be contained in this message or
> attachments hereto. Please advise immediately if you or your employer do
> not
> consent to Internet email for messages of this kind. Opinions, conclusions
> and other information in this message that do not relate to the official
> business of this company shall be understood as neither given nor endorsed
> by it.

Received on Tue Aug 22 2006 - 07:49:06 CDT

Original text of this message