Oracle Kill All Sessions The Quick Way

August 21, 2013 - 8:43pm
Submitted by gary

If you are putting your database to maintenance, and you want to kill off all sessions from connecting your db so you can do whatever you want with it.

Do the follow for a quick clean up:

STARTUP FORCE;
ALTER SYSTEM ENABLE RESTRICTED SESSION;

now you are free to do whatever you want with your database.

when you are done:

ALTER SYSTEM UNQUIESCE;

now all other connections can start hitting your database again.