Mr Cas
Mr Cas

Reputation: 668

OCI:version 9.2 How to find out who has updated an Oracle table

Is there a way to find out who has updated an oracle table? I could find the date and the number of updates by executing the query

SELECT * FROM all_tab_modifications 

but don't know how to check the user.

Upvotes: 1

Views: 185

Answers (1)

wolφi
wolφi

Reputation: 8361

You can switch on auditing to see who has updated the table. See for instance the answer to this question.

AUDIT INSERT, UPDATE, DELETE ON scott.emp BY ACCESS WHENEVER SUCCESSFUL;

The user is then found in the view DBA_AUDIT_TRAIL:

SELECT os_username, username, obj_name, action_name, timestamp
  FROM DBA_AUDIT_TRAIL 
 WHERE timestamp BETWEEN SYSDATE-7 AND SYSDATE
   AND owner = 'SCOTT' 
   AND obj_name = 'EMP'
 ORDER BY timestamp DESC;

Upvotes: 1

Related Questions