I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator.
I don't want to just lock the database and let the users quit gracefully.
How would I script this?
I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator.
I don't want to just lock the database and let the users quit gracefully.
How would I script this?
This answer is heavily influenced by a conversation here: http://www.tek-tips.com/viewthread.cfm?qid=1395151&page=3
I skip killing sessions originating on the database server to avoid killing off Oracle's connections to itself.
Additional info
http://www.dba-oracle.com/tips_killing_oracle_sessions.htm
To answer the question asked, here is the most accurate SQL to accomplish the job, you can combine it with PL/SQL loop to actually run kill statements:
Try trigger on logon
Insted of trying disconnect users you should not allow them to connect.
There is and example of such trigger.
Before killing sessions, if possible do
to stop new sessions from connecting.
As SYS:
Brutal, yet elegant.