Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

trigger for IP based restriction

622296Feb 9 2008 — edited Feb 12 2008
Hi,
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2008
Added on Feb 9 2008
25 comments
6,641 views