$ cat create_session_kill_script.sql spool session_kill.sql SET pages 300 SELECT 'alter system kill SESSION '''|| SID ||','|| SERIAL# ||''';' FROM v$session WHERE machine IN ('twas2','twas3') / spool off exit
$ sqlplus system/***** @session_kill.sql