禁止使用plsql developer登陆数据库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
drop trigger BLOCK_TOOLS_LOGON; CREATE OR REPLACE TRIGGER BLOCK_TOOLS_LOGON AFTER LOGON ON DATABASE DECLARE my_forced_exception EXCEPTION; PRAGMA EXCEPTION_INIT(MY_FORCED_EXCEPTION, -20101); BEGIN IF (sys_context('USERENV', 'SESSION_USER') IN ('TRY_LOGON_BY_TOOLS')) -- add your username here THEN IF (UPPER(sys_context('USERENV', 'MODULE')) LIKE '%SQLPLUS%' OR --SQL*PLUS UPPER(sys_context('USERENV', 'MODULE')) LIKE '%TOAD%' OR --TOAD UPPER(sys_context('USERENV', 'MODULE')) LIKE '%PLSQLDEV%') --PL/SQL DEVELOPER THEN RAISE my_forced_exception; END IF; END IF; EXCEPTION WHEN my_forced_exception THEN RAISE_APPLICATION_ERROR(-20101, 'USER ' || sys_context('USERENV', 'SESSION_USER') || ' ' || 'MODULE ' || UPPER(sys_context('USERENV', 'MODULE')) || ' ' || ' Logon Action via tool is not allowed. Please contact Maclean Liu to help you! http://www.oracledatabase12g.com/'); WHEN OTHERS THEN null; END; / |
分类: 技术