Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question.

Asked: August 04, 2021 - 4:00 pm UTC

Last updated: August 06, 2021 - 1:43 am UTC

Version: 11.2.0.4

Viewed 1000+ times

You Asked

Hi Tom,


One user executed a SQL delete query "delete from table_name" consuming all the server resources and making the DB slow.

My requirement is to pause that long running sql query at the moment where it is instead of killing the user's session. So, how I can achieve this ?

Your help will be highly appreciated.

Thanks in advance.

RDBMS: 11.2.0.3

Regards.

and Chris said...

No.

Once a statement has started there's no pause command. So you have to either wait until it's finished or kill the session (from 18c you can also cancel the statement, which stops it running and keeps the session alive).

You can use the Oracle Database Resource Manager to prioritise sessions, limit how many resources they consume, etc.:

https://docs.oracle.com/cd/E11882_01/server.112/e25494/dbrm.htm#ADMIN11841

Also, have a look at this slide deck for other options

https://www.slideshare.net/hamcdc/ukoug-25-years-of-hints-and-tips

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.