Muflo
Muflo

Reputation: 21

Set a time limit to an oracle query

I need to interrupt the execution of an oracle query if it is taking more than 10 seconds, and give user a message informing him about execution timeout. I googled a lot but i didn't find anything useful. Is there any way to set a time limit to oci_execute

Upvotes: 2

Views: 4224

Answers (2)

user123664
user123664

Reputation:

A profile can be used but is a little harsh. A better solution is to use Oracle Resource Manager. Setup a resource manager plan, assign resource consumer groups, decide how a session gets assigned to a resource consumer group and off you go. You can even make it refuse to start a query when the estimated runtime exceeds the allowed runtime. Also check http://ronr.blogspot.com/2009/06/howto-configure-resource-manager-using.html

Upvotes: 2

Rene
Rene

Reputation: 10541

Maybe Oracle profiles are useful in your case: http://www.adp-gmbh.ch/ora/concepts/profile.html

Upvotes: 1

Related Questions