Kbase P117647: How to find field information from the audit data tables of OpenEdge 10.1x
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/03/2011 |
|
Status: Unverified
GOAL:
How to find field information from the audit data tables of OpenEdge 10.1x
GOAL:
How to find field information from the audit data tables of OpenEdge 10.2x
GOAL:
What information is contained in the _aud-audit-data table?
GOAL:
How to monitor which tables are modified from the audit data?
GOAL:
How to know which fields were modified from the audit data?
FACT(s) (Environment):
OpenEdge 10.1x
OpenEdge 10.2x
All Supported Operating Systems
FIX:
The _aud-audit-data table contains most of the information required to extract information about the databases changes that are being monitored by auditing in OpenEdge:
- The _event-id field refers to the audit policy that produced the audit record. Each policy has a distinct Event ID. For example using the default policies provided with OpenEdge, the policy that monitors record changes in database tables has ID 5101.
- the _event-details field contains information about the changes themselves. It contains a stream of data, and can be extracted (for example) using the following 4GL code:
DO iNum = 1 TO NUM-ENTRIES(_aud-audit-data._Event-detail,CHR(7)):
cField = ENTRY(iNum,_aud-audit-data._Event-detail,CHR(7)).
PUT UNFORMATTED 'FieldName >':U + ENTRY(1,cField,CHR(6)) + '<':U SKIP.
PUT UNFORMATTED 'Datatype >':U + ENTRY(2,cField,CHR(6)) + '<':U SKIP.
PUT UNFORMATTED 'BeforeValue >':U + ENTRY(3,cField,CHR(6)) + '<':U SKIP.
PUT UNFORMATTED 'AfterValue >':U + ENTRY(4,cField,CHR(6)) + '<':U SKIP(1).
END.
- the _event-context field contains information about what records were modified. This field contains information of the form:
Table name CHR(6) Identifier (and then optionally CHR(7) Identifier2 CHR(6) Identifier 3 ....).
The identifier(s) is the value from the record that is sufficient to identify the record from the database. It corresponds to the field(s) that are part of the primary index for the table. For example, if the Sports2000 database is being used, then the audit data for the Customer table will contain the string "PUB.Customer" CHR(7) Cust-num for each _aud-audit-data record with _Event-id 5101. (That is because Cust-num is the record identifier for Customer).