oracle 禁止某些ip登陆数据库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
create or replace trigger logon_ip_control AFTER logon on database declare ip STRING(30); prod_owner STRING(30); BEGIN SELECT SYS_CONTEXT('USERENV','SESSION_USER') into prod_owner from dual; SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') into ip from dual; if prod_owner='PROD_C' or prod_owner='PROD_S' or prod_owner='PROD_M' or prod_owner='SCOTT' THEN IF ip not in ('192.168.14.201','192.168.17.30', '192.168.16.27') THEN raise_application_error(-20001,'User '||prod_owner||' is not allowed to connect from '||ip); END IF; END IF; end; |
https://cloud.tencent.com/developer/article/2004737
分类: oracle