限制oracle某用户仅能从某IP登录
system用户创建触发器,登录后触发检查
CREATE OR REPLACE TRIGGER system.check_ip_addresses_test
AFTER logon ON DATABASE
BEGIN
IF USER IN ('ZKBMANUAL'
) THEN
IF sys_context('USERENV',
'IP_ADDRESS') NOT IN (
'10.192.15.35',
'10.192.15.101') THEN
raise_application_error(-20000,
'Can not log in from this IP address (' ||
sys_context('USERENV',
'IP_ADDRESS') || ')');
END IF;
END IF;
END;