trigger for IP based restriction
622296Feb 9 2008 — edited Feb 12 2008Hi,
I've created a trigger to restrict IP based access on database, but yet I want to restrict DBA access too.
Given below is the code for the same:
create or replace trigger ip_restrict
after logon on database
declare
v_user varchar2(10);
begin
select sys_context('USERENV', 'ISDBA') into v_user from dual;
if v_user='TRUE' then
if sys_context('USERENV','IP_ADDRESS') not in ('192.168.15.18') then
raise_application_error (-20001,'Access restricted for this IP');
end if;
end if;
end;
Is there anything wrong with this?? It's allowing any user, any IP to get access!!!
Regards,
user959