The solidDB® audit trail feature enables tracking of user and schema changes persistently within the solidDB® database. The audit trail is controlled with the Sql.AuditTrailEnabled parameter. When audit trail is enabled, information about the database activities are written into a SYS_AUDIT_TRAIL system table. Users with administrator rights can query the SYS_AUDIT_TRAIL system table with normal SQL syntax.
When audit trail is enabled, the system records the following database activities:
▪Changes in user and login information
▪Changes in schemas and catalogs
▪Status of audit trail (enabled/disabled/deletes)
The status of audit trail is written at each server startup. The status message can be used to check when the audit trail data has been collected, and when the server has been started with the audit trail disabled. If auditing is disabled later on, at the next startup, the system writes a status message to indicate that audit trail is disabled.
User access
Only administrators (SYS_ADMIN_ROLE) can query the SYS_AUDIT_TRAIL system table. Administrators are also allowed to DELETE data from the table; the DELETE statements are audited unless the DELETE affected zero rows.
Audit trail and High Availability
In a High Availability setup, only the primary server can write the audit trail. However, audit trail must be enabled in both servers. This is because each server records database activities according to the configuration settings in its own solid.ini file. In a switchover (old primary had SQL.AuditTrailEnabled=yes), the new primary continues to record the changes only if the Sql.AuditTrailEnabled parameter for it was set to yes at the last startup. The state of the new primary is stored as a status message in the system table (AUDIT TRAIL ENABLED (HSB) or AUDIT TRAIL DISABLED (HSB).