Skip to Main Content

Database Software

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!

Executing "audit" command through PL/SQL? Is this even possible?

BobbyVDec 2 2016 — edited Dec 12 2016

ORA-01031: insufficient privileges

ORA-06512: at "SYSTEM.SHU_BOB_PROC", line 12

ORA-06512: at line 1

01031. 00000 -  "insufficient privileges"

*Cause:    An attempt was made to change the current username or password

           without the appropriate privilege. This error also occurs if

           attempting to install a database without the necessary operating

           system privileges.

           When Trusted Oracle is configure in DBMS MAC, this error may occur

           if the user was granted the necessary privilege at a higher label

           than the current login.

*Action:   Ask the database administrator to perform the operation or grant

           the required privileges.

           For Trusted Oracle users getting this error although granted the

           the appropriate privilege at a higher label, ask the database

           administrator to regrant the privilege at the appropriate label.

What I'm trying to do is this...

I have set "audit create session". This logs every login and logout. I like this but I have one third party application account (lets called it BADUSER) that logs in 50-60 times a minute and causes too much audit data so the only way I know to audit every one but BADUSER, is to first turn off create session auditing for everyone (noaudit create session), then run "audit create session by username" for every user in the system except BADUSER.

This does it until a new user is created. So I'm trying to create an "after create on database" trigger that fires when a new user is created. I get the trigger to fire but it just can't run an "execute immediate" successfully (which would contain the "audit create session by username" command. I even tried sending the "audit create session by username" command into dbms_jobs from the trigger.

Any help would be appreciated.

Thanks

Bob

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2017
Added on Dec 2 2016
3 comments
821 views