REM This script creates another script which
REM kills all sessions which are not supposed
REM to be logged on.  Used prior to batch 
REM processing.  

SET FEEDBACK ON;
SET HEADING OFF;
SPOOL /usr/oracle/dbs/killusers.sql
SELECT 'ALTER SYSTEM KILL SESSION '''||SID||','|| SERIAL#||''';'
 FROM V$SESSION
WHERE SUBSTR(USERNAME,1,3) NOT IN ('DBS','PLE','BSU','RPU','CNL',
                                   'LBU','VMA','TCA','DBO','CAC',
                                   'RUT','SYS')
union
select 'exit'
from dual;


SPOOL OFF;
exit
