Re: Terminate Users!!

From: Chris Little <littlec1_at_jaguar.uofs.edu>
Date: 27 Sep 93 13:22:24 GMT
Message-ID: <286peg$b6l_at_gopher.cs.uofs.edu>


Here is the Unix Script:

#! /bin/sh
# Purpose: To kill all user processes currently connected to the database
# Script: kill_users
# Author: Chris Little (based on code provided by
# David Sidwell - Oracle VMS World Wide Support.
# UNIX input from Andrew McConnell)
# Date: 2 November 1992
#
#
echo "All user processes accessing the Oracle database will be killed" sqlplus system/PASSWORD _at_kill_users.sql $$ chmod 700 kill_procs.lst
kill_procs.lst
rm kill_procs.lst
echo "All user processes stopped - pause 3 minutes for cleanup" sleep 180


Here is the SQL Script:

REM

REM     Purpose: To query the database to determine all connected users PID's
REM              exluding background processes and user running the script.
REM     Params:  &1 which should contain the calling user's system PID.
REM     Script:  KILL_PROCS.SQL
REM     Author:  David Sidwell - Oracle VMS World Wide Support
REM     Date:    7th April 1992.

REM
SET HEADING OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET ECHO OFF
SET PAGESIZE 1000
SET LINESIZE 80
SET TERMOUT OFF SELECT 'kill '||spid
FROM V$PROCESS
WHERE BACKGROUND IS NULL
AND spid != UPPER('&1')

SPOOL kill_procs
/
SPOOL OFF
EXIT

--
Chris Little, Programmer/DBA                    Computing & Data Services
                                                University of Scranton
  LITTLEC1_at_JAGUAR.UOFS.EDU                      Scranton, PA 18510
Received on Mon Sep 27 1993 - 14:22:24 CET

Original text of this message