Skip to Main Content

Oracle Database Discussions

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 blocking user using third party tool !

shipon_97Nov 30 2013 — edited Nov 30 2013

Dear Friends ,

I have to block the users from using sqlplus, TOAD, PLsldev etc (Except SYSTEM user) from client end using the below trigger :

create or replace trigger check_logon

after logon on database

declare

cursor c_check is

select

sys_context('userenv','session_user')

username,

s.module,

s.program

from v$session s

where

sys_context('userenv','sessionid')=s.audsid;

lv_check c_check%rowtype;

begin

open c_check;

fetch c_check into lv_check;

if lv_check.username in ('SYSTEM')

then

null;

elsif upper(lv_check.module) like

('%SQL*PLUS%') or

upper(lv_check.program) like

('%SQLPLUS%')  or

upper(lv_check.module) like

('%T.O.A.D%') or

upper(lv_check.program) like

('%TOAD%')    or

upper(lv_check.program) like

('%PLSQLDEV%')    or

upper(lv_check.program) like

('%BUSOBJ%')    or

upper(lv_check.program) like

('%EXCEL%')

then

close c_check;

raise_application_error(-

20100,'Banned! Contact with Database Admin!');

end if;

close c_check;

end;

It works fine all normal user cannot access the database using above third party tools .

But the problem is , user with DBA privileges can access the database with generating an trace file . Is there any way to restrict DBA Privileged user ? or is there any mechanism to create a log/trace file so that If there any  DBA Privilege user acess to the Database , then we can get the information from that specified log/trace file ? 

Waiting your kind reply ... ...

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2013
Added on Nov 30 2013
2 comments
1,005 views