Avatar of vsarma50
vsarma50

asked on 

dba_common_audit

I have a requirement in my application whcih is developed in APex 4.0.
when a user is logged in and access(select stataement) the table through the apex
want to track the audit. I tried with DBA_COMMON_AUDIT_TRAIL
but problem is it is always showing as APEX_PUBLIC_USER as a generic one.
but i want to capture who ever is logged into the system with his id.
how can we accomplish this. any trigger will do this. please advice.
thanks very much
Oracle Database

Avatar of undefined
Last Comment
vsarma50
Avatar of MarioAlcaide
MarioAlcaide

You should use a trigger with the after logon clause, like this:

CREATE OR REPLACE TRIGGER LOG_ON AFTER
LOGON ON DATABASE
BEGIN
execute immediate 'insert into bla bla bla';
END;

And insert your desired info
Avatar of vsarma50
vsarma50

ASKER

I want to now the date and time  and what is the user name , who did  last dml operation done on a table.(select,insert,update,delete) but the trigger with logon option triggered from apex is taking the generic userid and how to caputre the table accesssed information.
for eg. if any user is trying to access employee table i want to track it in the audit table.
any suggestion  please.

Avatar of MarioAlcaide
MarioAlcaide

Ok, then you can audit the desired operations on the table like this:

AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY fireid BY ACCESS;

For more info, you can check this link

http://www.oracle-base.com/articles/8i/Auditing.php
ASKER CERTIFIED SOLUTION
Avatar of vsarma50
vsarma50

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of vsarma50
vsarma50

ASKER

this is what my requirement and it worked.
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo