2. Using Ingres Commands : auditdb Command—Audit a Database : auditdb Examples
Share this page                  
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.
auditdb empdata -table=employee -file sql empdata
create table empaudit 
  (date        date 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);
copy table empaudit () from 'C:\WINNT\Profiles\user1\employee.trl'
copy table empaudit () from "/usr/directory/employee.trl";
copy table empaudit () from "dev:[directory]employee.trl";