限制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;

posted @ 2018-06-16 16:59  点滴成事  阅读(2155)  评论(0编辑  收藏  举报