Script for Oracle user activity auditing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script for Oracle user activity auditing
# 1  
Old 01-07-2010
Script for Oracle user activity auditing

Hi All,
I need to put in place a UNIX shell script that calls three sql scripts & reports to the DBAs.
I already have the three sql scripts in place & they perform the following database auditing actions:
1. actions.sql
This script queries the DBA_AUDIT _TRAIL table to look for database user actions within a specific time
frame.
If the user action involves create, alter, drop, truncate, replace, grant, revoke, analyze, audit,
comment, it should shoot an email to the DBAs.
2. non-existent.sql
This script queries the DBA_AUDIT_SESSION & DBA_USERS tables to look for users that logged onto the database,
but are not in the DBA_USERS table.
If any records are found, it should shoot an email to the DBAs specifying that a non-database user logged
into the database.
3. usershareacct.sql
This script queries the DBA_AUDIT_SESSION table to check for situations whereby the same user account is logged
on more than one user terminal.
If that's the case, the DBAs should be notified by email.
So, the shell script should call the three sql scripts & report to the DBAs as per the specifications
outlined above.
Your help will be highly appreciated.

Regards,

- divroro12 -
# 2  
Old 01-07-2010
something like this:
Code:
PW_DBN='whatever_auth/passwd@database_nm'

maillist_dba='fred@bedrock.com;barney@bedrock.com'

sqlplus $PW_DBN @$FSQL1 > fsql1.out

egrep -i '(create|alter|drop|truncate|replace|grant|revoke|analyze|audit|comment)' fsql1.out > fsql1.out2

if [[ ! -s fsql1.out2 ]]; then
  cat fsql1.out2 | mailx $maillist_dba
fi

sqlplus $PW_DBN @$FSQL2 > fsql2.out
if [[ ! -s fsql2.out ]]; then
  cat fsql2.out | mailx $maillist_dba
fi

etc...

The 3rd query should print out those users by including a "HAVING COUNT(*) > 1"
clause in your SQL.

HTH.
# 3  
Old 01-07-2010
Thanks,

Will see what i can come out with from here...

- divroro12 -
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

User auditing from AIX server

I am trying to find out the information of my local desktop when i use putty to login to an AIX server. This is what I do: 1. login to my PC 2. take a putty session to an AIX server Can i get information of my local desktop from the AIX server ? Is there a command available ? Thanks (8 Replies)
Discussion started by: Nagesh_1985
8 Replies

2. UNIX for Dummies Questions & Answers

How to track user activity?

Hi All Please can you help me with the following issue: A certain vendor installed an application in which for a user to log in; the user must use a user created/predefined by the application. And because this application has more than one user its difficult to track who did what and when,... (6 Replies)
Discussion started by: fretagi
6 Replies

3. Solaris

Solaris user auditing

Hello, I was wondering when Solaris auditing is enabled, If it is possible to keep track of users that are allowed to sudo to root. In other words, I would like to know which user did what on my Solaris box. (assumig that user can "sudo su -" ) Thanks. (2 Replies)
Discussion started by: niyazi
2 Replies

4. Shell Programming and Scripting

user auditing

Hello, is there some way to track what shell commands some user is executing ? Something like to have some log file where i could see what commands some user used, e.g. rm -r dirname , ls -l .... and so on ... I have 2.6.13-1.1526_FC4smp (9 Replies)
Discussion started by: tonijel
9 Replies

5. Shell Programming and Scripting

SVN activity of certain user

Hi there, I'm looking for some help to get a little script done that shows me (or counts) only the added lines from an SVN repository of one specific user. Anybody has an idea? Thanks, Michael (0 Replies)
Discussion started by: MichaelGiese
0 Replies

6. UNIX and Linux Applications

High CPU activity running Oracle

I'm running Oracle 10g on a V880 using Solaris 8 connected to a NetApps SAN and recently I've been getting cpu activity that normally is 2 -3 % now running from 14% ass a low up to 90% peak against oracle PIDs. No recent changes have been to Oracle or the OS. THere has been some firmware updates to... (4 Replies)
Discussion started by: stocksj
4 Replies

7. HP-UX

Auditing User's actions

Hi all I hope to find what i'm looking for in this forum as said in the topic i want to track user's actions on the system. i mean also the action of moving or removing files. I have an HP 9000 with HP UX 11i. the users log on the HP from a terminal window under WIndows XP Thx (3 Replies)
Discussion started by: Timberland
3 Replies

8. AIX

User Auditing

i want to audit user commands .. keep track of what commands each user has been giving .. can this be done by writing a script in engraving it in .profile of the user. or is there any other way of doing this ... rgds raj (2 Replies)
Discussion started by: rajesh_149
2 Replies

9. AIX

Auditing User administrator

Background: I a trying to audit user administration on a AIX box. I am trying to make sure that any changes made by the System administrator to the user accounts (Add users, changing their attributes or deleting users) are accompanied by authorization i.e. the system admin does not make any... (0 Replies)
Discussion started by: gladiator
0 Replies
Login or Register to Ask a Question