Re: Package to kill orphan server process
Date: 1995/10/23
Message-ID: <1995Oct23.221011.17277_at_rossinc.com>#1/1
In article <45p28e$q43_at_pcnet2.pcnet.net> Paul Baumgartel <paulb_at_pcnet.com> writes:
>This is a multi-part message in MIME format.
>
>---------------------------------4691732311099
>Content-Transfer-Encoding: 7bit
>Content-Type: text/plain; charset=us-ascii
>
>Here is the source to a package that periodically checks for, detects, and kills
>Oracle server processes that meet the following criteria:
>
>1. Hold one or more DML locks
>2. Are not waiting for locks
>3. Have not used any resources within the specified time period
>
>This code is not heavily commented as I had to write it in a hurry. It must be run
>by a user that has access to the v$ tables and has ALTER SYSTEM privilege.
>
>Note that the main procedure executes in an endless loop. I start it as a detached
>process or daemon at database startup, and kill it at database shutdown.
>
>I hope it's useful. If you have questions send me email.
>
>
>
>---------------------------------4691732311099
>Content-Transfer-Encoding: quoted-printable
>Content-Type: zz-application/zz-winassoc-SQL
>
> =
>
>/*
>* USYMNSVR.SQL
>*
>* Package containing server monitor utilities.
>*
>* Paul Baumgartel, Adept Computer Associates, Inc., 10/4/95
>*
>*/
> =
>
>create or replace package usy_monitor_server as
> =
>
> procedure kill_idle_sessions;
> =
>
>end;
>/
> =
>
>create or replace package body usy_monitor_server as
> =
>
> type sid_t is table of number index by binary_integer;
> type serial_t is table of number index by binary_integer;
> type connect_time_t is table of number index by binary_integer;
> type resource_sum_t is table of number index by binary_integer;
> type status_t is table of boolean index by binary_integer;
> =
>
> monitor_interval constant natural :=3D 30*60;
> matched constant boolean :=3D true;
> unmatched constant boolean :=3D false;
> =
>
> killed constant boolean :=3D true;
> spared constant boolean :=3D false;
> =
Wow! When did Oracle go 3D? :)
>
[rest snipped]
-- Joel Garry joelga_at_rossinc.com Compuserve 70661,1534 These are my opinions, not necessarily those of Ross Systems, Inc. <> <> %DCL-W-SOFTONEDGEDONTPUSH, Software On Edge - Don't Push. \ V / panic: ifree: freeing free inodes... OReceived on Mon Oct 23 1995 - 00:00:00 CET