Block toad from connecting to Oracle




CONNECT  AS SYSDBA;

 
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')

    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;

/

SHOW ERRORS

Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post