How to Automate Killing Inactive Sessions with Resource Manager
begin dbms_resource_manager.create_plan_directive( plan => '&RM_PLAN', group_or_subplan => 'LONG_RUN', comment => 'Limit idle time to 5 minutes', max_idle_time => 300); dbms_resource_manager.create_plan_directive( plan => '&RM_PLAN', group_or_subplan => 'SHORT_RUN', comment => 'Limit idle time to 1 minute', max_idle_time => 60); end; /Cool! And what would be the error for the user that gets the session killed?
ORA-3113 End of file on communication channelMuch nicer: Now you are a nice DBA and don't kill sessions anymore. You automated it! Some additional recommendations:
- Use this solution for Databases above 11.2.0.4 or 12.1.0.2, due to some known bugs:
- Bug 9523768 - IDLE SESSIONS AREN’T ACTUALLY KILLED IMMEDIATELY (affecting 11.2.0.1 to 11.2.0.3)
- Bug 13837378 - ALTER SYSTEM KILL SESSION IMMEDIATE DOES NOT KILL QC SESSIONS (11.2.0.1 to 12.1.0.1)
- Bug 8891495 - NON-IDLE SESSIONS ARE KILLED (11.2.0.1 only)
- Some MOS references on it:
- How To Automatic Kill Inactive Sessions using Resource Manager (Doc ID 1935739.1)
- Using Resource Manager to Detect and Kill Idle Sessions (Doc ID 1557657.1)
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Master/Slave Replication In Limited Bandwidth Scenarios
Master/Slave Replication In Limited Bandwidth Scenarios
Jan 23, 2012 12:00:00 AM
3
min read
Case Study: How to Return a Good SQL Execution Plan from 10g Days After an 11g Migration
Case Study: How to Return a Good SQL Execution Plan from 10g Days After an 11g Migration
Nov 12, 2012 12:00:00 AM
3
min read
How to migrate from on-premises to Azure SQL database
How to migrate from on-premises to Azure SQL database
Jan 15, 2016 12:00:00 AM
11
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.