Was this helpful?
auditdb Examples
1. This command audits the empdata database:
auditdb empdata
2. This command audits the empdata database, which contains the employee and address tables, and writes the output to the default files employee.trl and address.trl:
auditdb empdata -table=employee,address -file
This command does the same as the previous one, but specifies names for the output files:
auditdb empdata -table=employee,address -file=aud2.trl,aud3.trl
3. This command creates an audit trail for the employee table in the empdata database, and then uses SQL commands to create a table and copy the default auditdb output files into it.
Note:  A date column in a table created to contain audit trail data must be defined as ingresdate data type.
auditdb empdata -table=employee -file sql empdata
create table empaudit 
  (date        ingresdate not null with default,
  usrname      char(32) not null with default,
  operation    char(8) not null with default,
  tranid1      integer not null with default,
  tranid2      integer not null with default,
  table_id1    integer not null with default,
  table_id2    integer not null with default,
  eno          I2,
  ename        char(10),
  age          I1,
  job          I2,
  salary       money,
  dept         I2);
Windows:
copy table empaudit () from 'C:\WINNT\Profiles\user1\employee.trl'
Linux:
copy table empaudit () from "/usr/directory/employee.trl";
Last modified date: 04/03/2024