[Info-ingres] Weird problem in Ingres 10

pwhite peercore pwhite at peercore.com.au
Thu May 17 23:11:26 UTC 2018


This example thanks to Thien.

 

auditdb mydb  -b13-may-2018:07:00 -e14-may-2018:07:00 -table=gl_batch_detail -file 

 

This will create a file ( ‘gl_batch_detail.trl’ ) that contains all the transactions related to ‘gl_batch_detail’ table

Then run this SQL

 

/*create audit structure table for output file from auditdb. Keep this table handy for future use*/

create table aud_structure

       (datetemp ingresdate not null with default,

       username 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) \g

 

create table gl_batch_detail_audit 

as select a.*, b.* from aud_structure a, gl_batch_detail b 

where 1 = 2 \g

 

copy table gl_batch_detail_audit () from 'gl_batch_detail.trl' \g

 

select top 20 * from gl_batch_detail_audit \g

+-----------------+---------+--------+-------+----------+---------+---------+--------+--------+-------+------+----------------

|datetemp         |username |operatio|tranid1|tranid2   |table_id1|table_id2|batch_no|entry_no|sort_no|source|source_doc      

+-----------------+---------+--------+-------+----------+---------+---------+--------+--------+-------+------+----------------

|13/04/18 08:43:02|ingres   |append  |  21365|1548644761|      775|        0|   10880|       1|       1|JNL  |2148            

|13/04/18 08:43:02|ingres   |append  |  21365|1548644761|      775|        0|   10880|       1|       2|JNL  |2148            

|13/04/18 08:45:08|ingres   |append  |  21365|1548644976|      775|        0|   10881|       1|       1|JNL  |2149            

|13/04/18 08:45:08|ingres   |append  |  21365|1548644976|      775|        0|   10881|       1|       2|JNL  |2149            

|13/04/18 10:16:35|ingres   |append  |  21365|1548662386|      775|        0|   10882|       1|       1|REC  |2225            

|13/04/18 10:16:35|ingres   |append  |  21365|1548662386|      775|        0|   10882|       1|       2|REC  |2225            

|13/04/18 10:18:37|ingres   |append  |  21365|1548663014|      775|        0|   10883|       1|       1|TRB  |7426            

|13/04/18 10:18:37|ingres   |append  |  21365|1548663014|      775|        0|   10883|       1|       2|TRB  |7426            

|13/04/18 10:19:23|ingres   |append  |  21365|1548663202|      775|        0|   10884|       1|       1|TRB  |7427            

|13/04/18 10:19:23|ingres   |append  |  21365|1548663202|      775|        0|   10884|       1|       2|TRB  |7427            

|13/04/18 10:53:54|ingres   |append  |  21365|1548670694|      775|        0|   10885|       1|       1|REC  |2226            

|13/04/18 10:53:54|ingres   |append  |  21365|1548670694|      775|        0|   10885|       1|       2|REC  |2226            

|13/04/18 11:04:05|ingres   |append  |  21365|1548672816|      775|        0|   10886|       1|       1|TRB  |7429            

|13/04/18 11:04:05|ingres   |append  |  21365|1548672816|      775|        0|   10886|       1|       2|TRB  |7429            

|13/04/18 11:07:24|ingres   |append  |  21365|1548673302|      775|        0|   10887|       1|       1|TRB  |7430            

|13/04/18 11:07:24|ingres   |append  |  21365|1548673302|      775|        0|   10887|       1|       2|TRB  |7430            

|13/04/18 11:07:42|ingres   |append  |  21365|1548673531|      775|        0|   10888|       1|       1|TRB  |7431            

|13/04/18 11:07:42|ingres   |append  |  21365|1548673531|      775|        0|   10888|       1|       2|TRB  |7431            

|13/04/18 22:15:58|ingres   |append  |  21365|1548747649|      775|        0|   10889|       1|       1|SNV  |353J-328-FGYE8A 

|13/04/18 22:15:58|ingres   |append  |  21365|1548747649|      775|        0|   10889|       1|       2|SNV  |353J-328-FGYE8A 

+-----------------+---------+--------+-------+----------+---------+---------+--------+--------+--------+-----+----------------

(20 rows)

 

 

Paul

 

 

From: info-ingres-bounces at lists.planetingres.org [mailto:info-ingres-bounces at lists.planetingres.org] On Behalf Of Alex Hanshaw
Sent: Friday, 18 May 2018 2:14 AM
To: Mark; info-ingres at lists.planetingres.org
Subject: Re: [Info-ingres] Weird problem in Ingres 10

 

See:

 

http://docs.actian.com/ingres/11.0/index.html#page/DatabaseAdmin%2FHow_to_Load_an_Audit_Trail_as_a_Table.htm

 

The example is based on the columns in the example table. You’ll need to define the target table based on the audited table.

 

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20180518/88d415d7/attachment.html>


More information about the Info-ingres mailing list