Dear All,

We want to restrict connecting thru TOAD or SQLPLUS from some of terminals.

for that I write a trigger but it doesn't work. I got this trigger from google search (OTN) :

CREATE OR REPLACE TRIGGER block_tools_from_prod AFTER LOGON ON DATABASE
DECLARE
v_prog sys.v_$session.program%TYPE;
V_TERM sys.v_$session.terminal%TYPE;
v_sid sys.v_$session.sid%TYPE;
v_sl sys.v_$session.serial#%TYPE;
BEGIN

SELECT program,terminal,sid,serial# INTO v_prog, v_term, v_sid, v_sl
FROM sys.v_$session WHERE audsid = USERENV('SESSIONID')
AND audsid != 0 -- 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 '%EXCEL%' -- MS-Excel plug-in
THEN

RAISE_APPLICATION_ERROR(-20000, 'Development tools are not allowed here.');
END IF;
END;


Thanks in advance,

Nirav