Hi Ben
There is nothing in Toad to do this yet (there will be in 11.1) but here is what
you can do.
Run this in the editor
BEGIN
SYS . DBMS_FGA.ADD_POLICY (
object_schema => ‘KARL’
, object_name => ‘TABLE123’
, policy_name => ‘AUD_POL_TABLE123’
, audit_condition => NULL
, audit_column => NULL
, handler_schema => NULL
, handler_module => NULL
,enable => FALSE
, statement_types => ‘SELECT,INSERT,UPDATE,DELETE’
, audit_trail => SYS . DBMS_FGA.DB + SYS . DBMS_FGA.EXTENDED
, audit_column_opts => SYS . DBMS_FGA.ANY_COLUMNS );
END;
/
Now, any insert, select, update, delete (you can shorten the list of statement
types if you wish) statement will be captured by Oracle. To see the statements,
do this:
Select *
from sys.dba_fga_audit_trail
where policy_name = ‘AUD_POL_TABLE123’
The statements are in the SQL_TEXT column, and the binds are in the SQL_BIND
column. This view only shows the first 2000 characters. If your statements are
less than 2000 characters, great. If not, you’ll need to select from
sys.fga_log$ instead.
When you are ready to stop auditing, run this:
BEGIN
SYS . DBMS_FGA.DROP_POLICY (
object_schema => ‘KARL’
, object_name => ‘TABLE123’
, policy_name => ‘AUD_POL_TABLE123’ );
END;
/
-John