

You can do this by running this script ( session_undo.sql). Before doing this it's worth checking to see if it is performing a rollback. If the marked session persists for some time you may consider killing the process at the operating system level. This does not affect the work performed by the command, but it returns control back to the current session immediately, rather than waiting for confirmation of the kill. SQL> ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE In addition to the syntax described above, you can add the IMMEDIATE clause.

It will then be killed as soon as possible. In these cases the session will have a status of "marked for kill".

In some situations, like waiting for a reply from a remote database or rolling back transactions, the session will not kill itself immediately and will wait for the current operation to complete. It merely asks the session to kill itself. SQL> ALTER SYSTEM KILL SESSION KILL SESSION command doesn't actually kill the session. This allows you to kill a session on different RAC node. In a RAC environment, you optionally specify the INST_ID, shown when querying the GV$SESSION view. SQL> ALTER SYSTEM KILL SESSION 'sid,serial#' The basic syntax for killing a session is shown below.
