RE: killing oracle processes

From: John Hallas <John.Hallas_at_morrisonsplc.co.uk>
Date: Tue, 18 Aug 2009 10:22:29 +0100
Message-ID: <A92AF970568F9A4BAB18E10F9C64ED605DAC45C84C_at_EXCH2.morrisonsplc.co.uk>



That is a valid point. However we do give permission out to selected developers on dev boxes

Details are

To create the stored procedure logon as a sysdba through sqlplus and:- Explicitly Grant the required rights to system grant alter system to system;
grant select on sys.v_$session to system; Create the procedure
create or replace procedure system.killsession (killsid IN VARCHAR2) as
killserial varchar2(20);
begin
killserial:='none';
select serial#
into killserial
from sys.v_$session
where sid = killsid
and username = 'XXXX';

execute immediate 'alter system kill session ''' || to_char (killsid) || ', ' || to_char (killserial) || '''' ;

EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('The SID ' || killsid || ' does not exist or cannot be killed');

end ;

/
Grant execute on procedure to user
Top of Form
Bottom of Form
For example, sysopr15 needs access to kill sessions so you would type the following:- grant execute on system.killsession to userxxx;

www.jhdba.wordpress.com



From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Johnson, William L (TEIS) Sent: 17 August 2009 20:36
To: mschmitt_at_uchicago.edu; 'oracle-l_at_freelists.org' Subject: RE: killing oracle processes

Do you have a good way to make sure a developer running as Oracle account XYZ has permission to kill that session (logical ownership) rather than accidentally killing one of his or her co-workers critical processes? Folks need to be patient and realize there is a reason you don't just give everyone DBA access...



Wm Morrison Supermarkets Plc is registered in England with number 358949. The registered office of the company is situated at Gain Lane, Bradford, West Yorkshire BD3 7DL. This email and any attachments are intended for the addressee(s) only and may be confidential.

If you are not the intended recipient, please inform the sender by replying to the email that you have received in error and then destroy the email. If you are not the intended recipient, you must not use, disclose, copy or rely on the email or its attachments in any way.

Wm Morrison Supermarkets PLC accepts no liability or responsibility for anything said in the email or its attachments and gives no warranty as to accuracy. It is the policy of Wm Morrison Supermarkets PLC not to enter into any contractual or other obligations by email.

Although we have taken steps to ensure the email and its attachments are virus-free, we cannot guarantee this or accept any responsibility, and it is the responsibility of recipients to carry out their own virus checks.


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 18 2009 - 04:22:29 CDT

Original text of this message