This discussion is archived
1 2 Previous Next 16 Replies Latest reply: Dec 13, 2012 6:38 PM by indra budiantho RSS

RAISE_APPLICATION_ERROR work on Scheme A, but not on Scheme B

indra budiantho Expert
Currently Being Moderated
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
PL/SQL Release 10.2.0.5.0 - Production
CORE     10.2.0.5.0     Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

Hi there, i work on this link: http://kamranagayev.com/2009/10/04/block-developers-from-using-toad-and-other-tools-on-production-databases/
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;
/
The problem is that RAISE_APPLICATION_ERROR(-20000, 'Development tools are not allowed here.');
work on one scheme A, but not on scheme B. Thank you in advance.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points