触发器样例 create trigger logon_ip_control after logon on database declare ip STRING(30); user STRING(30); begin SELECT SYS_CONTEXT('USERENV','SESSION_USER') into user from dual; SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') into ip from dual; if user='batter' THEN IF ip not in ('192.168.1.84','192.168.2.235','192.168.1.166','192.168.1.237','192.168.1.228','192.168.1.113') THEN raise_application_error(-20001,'用户 '||user||' 由于权限过大,现已回收); END IF; END IF; end;