CREATE OR REPLACE TRIGGER ip_restrict
AFTER LOGON ON DATABASE
DECLARE
v_user VARCHAR2 (30);
BEGIN
SELECT USER
INTO v_user
FROM DUAL;
IF v_user = 'SCOTT' THEN
IF SYS_CONTEXT ('USERENV', 'IP_ADDRESS') NOT IN ('IP1', 'IP2') THEN
raise_application_error (-20001, 'Access restricted for this IP');
END IF;
END IF;
END;
Everything Changes
2 weeks ago
No comments:
Post a Comment