This content has been marked as final. Show 7 replies
Flush the shared pool...1 person found this helpful
Is there any other option - I mean at the level of writing the query - can a query be writeen in a way that it ensures a hard parse?
why do you want explicitly a hard parse? isnt costly?
The question got resolved in a very simple and unexpected way! The java developer had to write the sql in this way: "select ename from emp where empno=112" instead of this: " select ename from emp where empno=?" He already did that and that fixed it!!
Thanks to everyone who shared his knowledge and views for my question....
If you really need to force hard parsing on every execution of a query, you can wrap it into a view and define a VPD policy with a randomly generated predicate function to achieve that (see http://oracle-randolf.blogspot.ru/2009/02/how-to-force-hard-parse.html?m=1). However, I would not recommend you to go down that road if the query runs frequently, because hard parsing is expensive.