There may be some times when changes were made to the database and the DBA needs to find out what user is listed as making the change. If the current database has no built in auditing / logging, or the OpenEdge Auditing package is not configured and enabled then there may still be a way of seeing what users modified specific blocks of an area based on the AIMAGE SCAN VERBOSE output of an AI file.
If specific record(s) are known to have changed, find out the recid of the record and the area number the record lives in. To find out the recid number of a record use the following code example:
find first tablenamehere where fieldnamehere condition value. display recid(tablenamehere).
The above code presumes that the DBA will be able to construct a valid where clause to get to the record(s) to be investigated.
Find out the area number that the table (which contains the record(s)) lives in.
Find out the records per block value defined in the .st file of the database for the area the record(s) lives in.
The recid, area number, and RPB (records per block) can then be entered into a plain text file. Each line contains the information for one record of one area. Example for the first customer of a sports2000 database: 97 9 32
The above line represents 97 which is the recid of the first customer, 9 which is the area the data for the customer table is contained, and 32 which is the records per block value for area 9.
The attached code will prompt the user for: 1) The file which contains the list of recids, areas, and RPBs to search for 2) The file which contains the output from an AIMAGE SCAN VERBOSE operation 3) The file to report the findings derived from running the code
The reason the RPB is needed is that part of the information in the AIMAGE SCAN VERBOSE output is abstracted. When records are changed the information is written to the AI file but for security purposes the AIMAGE SCAN VERBOSE does not reveal the exact record being modified, it only reveals the base dbkey of the block being modified.
The simple formula to determine what the base dbkey of the block is: base-dbkey-# = recid - (recid mod RPB) Example based on the first customer record of the sports2000 database. The recid of the first customer record is 97 ( find first customer. display recid(customer). ) The customer data lives in area 9. Area 9 has an RPB of 32. 97 - (97 mod 32) = 96 The base dbkey of the block that holds the first customer record is 96.
The attached code collects all the recids and areas they live in from
Example of output: Transaction ID UserID Trans Start Dt/Tm Operation dbkey 27954 noahbody Oct 28 16:43:49 2020. RL_RMCHG 96
This indicates that this base dbkey (96) was modified in transaction ID 27954 by user noahbody |