Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> help on database trigger
Dear all,
I have queried for help on database trigger earlier on this forum and I got a very good response from all of you.
I have designed the trigger as per the instructions and following code was written
CREATE OR REPLACE TRIGGER block_tools_from_prod
AFTER LOGON ON DATABASE
DECLARE
v_prog sys.v_$session.program%TYPE;
BEGIN
SELECT program INTO v_prog
FROM sys.v_$session
WHERE
audsid = USERENV('SESSIONID')
audsid NOT IN (SELECT AUDSID FROM V$SESSION WHERE USERNAME IN
('SYS','FINANCE')); -- Don't Check SYS Connections
AND rownum = 1; -- Parallel processes will have the same AUDSID's
IF UPPER(v_prog) LIKE '%TOAD%' OR UPPER(v_prog) LIKE '%T.O.A.D%' OR -- Toad
UPPER(v_prog) LIKE '%SQLNAV%' OR -- SQL Navigator UPPER(v_prog) LIKE '%PLSQLDEV%' OR -- PLSQL Developer UPPER(v_prog) LIKE '%BUSOBJ%' OR -- Business Objects UPPER(v_prog) LIKE '%SQLPLUSW%' OR -- Business Objects UPPER(v_prog) LIKE '%EXCEL%' -- MS-Excel plug-in THEN RAISE_APPLICATION_ERROR(-20000, 'Development tools are notallowed on PROD DB!');
please help me in finding the fault and give the right lead.
thanx in advance....
Kishan Thakker Received on Thu Jun 07 2007 - 07:02:22 CDT