Páginas filhas
  • Configure Embedded Audit Trail

How to configure the Embedded Audit Trail resource

Product:

Microsiga Protheus

Versions:

11 and 12

Step by step:

The Embedded Audit Trail is a database audit (Audit Trail) feature developed for the Protheus system. Its premises are:

* High performance
* Easy installation and configuration
* Simple operation
* Safety

You will see the procedure of initial activation and configuration of the tool, with examples of use.

- Go to Configurator > Environment > Embedded Audit Trail > Applicator
- The configuration is done by exception and rule, for the levels of Group of Companies, Tables and Fields. Here are some examples and usage scenarios. For more details on the technical part of the Audit Trail Applicator, we recommend reading this link: http://tdn.totvs.com/display/framework/Embedded+Audit+Trail+-+aplicador

Example 1: Audit only table SA1 of Company 01 for Inclusion, Edition and Deletion.

- Set up Company 01 at the Company Group level with the Exception Scope, so that the company's tables are not audited, and at the Table level, select the SA1 table with the Rule Scope, so that it is audited with Operation 7 (Inclusion, Edition and Deletion).



Example 2: Audit all tables in Company 01, for Edition only.
- Set up Company 01 ate Company Group level with the Rule Scope, so that the tables of this company are audited with Operation 2 (Edition).



Example 3: Audit only tables SA1, SA2 and SB1 of Company 01 for Inclusion, Edition and Deletion, and fields C5_VEND1 and C5_COMIS1 of table SC5 for Inclusion.

- Set up Company 01 at Company Group level with Exception Scope, so that the tables of this company are not audited. At the Table level select the SA1, SA2 and SB1 tables with the Rule Scope so that these tables are audited with Operation 7 (Inclusion, Edition and Deletion), and table SC5 with the Link Scope (to make the connection between the Group of Companies and the Fields, since the table will not be audited, only the fields). At the Fields level, select fields C5_VEND1 and C5_COMIS1 with Rule Scope to have these fields audited.



Example 4: Audit all Company 01 tables for Deletion, except tables SC5 and SC6 that will not be audited.

- Set up Company 01 at the Company Group level with the Rule Scope so that the tables of this company are audited with Operation 3 (Deletion), and at the table level, select tables SC5 and SC6 with the Exception Scope so that these tables are not audited.



When you have completed the settings, click Confirm. A Creating triggers window will appear, informing the creation of triggers in the database for the configured audits, and at the end, a message informs Registration added successfully.



After you have configured the Embedded Audit Trail, and you have moved an audited table, you can check the Log Report in the path Configurator > Environment > Embedded Audit Trail > Log Report. Further information about the report: http://tdn.totvs.com/pages/viewpage.action?pageId=185732813

Information:

There is the possibility of setting up a tablespace in the Database for audit use. This is not a required configuration; if it is not set, the default tablespace will be used.

If you choose to use it, go to the menu Configurator > Environment > Embedded Audit Trail > Tablespace Configurator

Default tablespace: Default tablespace of audit tables for the group of companies logged in.

Table range: Specific tablespace of audit tables by table range. This setting is global for all Company Groups.

Note: The Range setting has priority over the default Tablespace setting.

Audit table cleanup

This feature is an improvement that will only be available as of Release 23 of Protheus 12, scheduled for January 2019.

To avoid an exaggerated growth of the audit table over time, a cleanup feature is provided to set, by audited Company Group, a time interval (3, 6, 9 or 12 months) to clear the table, that is, audit data prior to that period are deleted permanently. A second table is created and it will log these cleanups (table FWPURG_ATT). In this log table, the user who set up the cleanup for that group of companies, its code, the number of days and the date of the cleaning is audited. This table will be created in the main Tablespace of the system, not on the Tablespace set for the Audit Trail (not configurable). You cannot clear this table.

To configure the cleanup, follow the procedure below:
- On the Applicator screen (Configurator > Environment > Embedded Audit Trail > Applicator), a History Time column has been added. In this column you can select from the following options: Three Months / Six Months / Nine Months / Twelve Months / All.

Notes:

The lower the range of entities you want to audit (tables and fields) and the fewer operations you want (include, edit, or delete), the lower the impact on system performance after you apply the Embedded Audit Trail. A careful analysis of what needs to be audited will result in better product performance. 

We do not recommend auditing all fields for inclusion operation in movement tables, especially tables that have a large number of fields. Since the inclusion operation registers all fields subject to audit, the impact on performance can be significant.

To ensure integrity, if a record is entered at the beginning of a transaction (BEGIN TRANSACTION) and the record number (RECNO ()) is requested, DBACCESS will include the record marked as deleted (DELETED) and will recover (RECOVERED) it next. This is an expected behavior of the tool, not an error.

Audit removal

Defining a group of companies as Exception without any other Rule attribute for the tables and the fields implies removing the audit for the company.

Once you have defined a company to audit, to remove the audit from that company you must change the company setting to Exception and delete any table reference for that company.