Skip to main content

Audit database schema

Auditing queries

Find the columns and table relationships behind NIM audit reports.

This reference covers the 26 core audit tables in the supplied SQLite schema export. It excludes f_ virtual tables, which are generated from filters and vary by installation. Start with the auditing query guide for example SQL and help choosing a starting table.

The Audit App examples use four useful starting points: ObjectMutations for attribute changes, Memberships for group changes, AppSessions for app use, and ResourceUpdates for resource changes. Join from there to lookup tables for names and to Users through the path shown below. Activities links directly to Users; app and resource records use Sessions to reach Users.

Relationship mapDirect link to Relationship map

Follow the path that matches your question. Arrows show a useful reading path, while the tables below identify the exact foreign-key columns. The smaller lookup tables and the standalone Version table are listed in the reference below.

01
App activity

Follow an app session through form activity, actions, and calls.

AppSessionsOne app visit
AppActivityForm activity
AppActivityActionsAction run
AppActivityActionCallsIndividual calls

AppSessions.SessionID → Sessions.ID → Users.ID identifies the actor. Use Apps, AppFormUnits, AppActions, and AppActionTypes for names. Result IDs at each level lead through AppResults to AppErrorCodes.

From app activity to target changesAppActivityVsObjectMutations and AppActivityVsMemberships connect an AppActivity row to the changes it caused.
02
Target changes

Follow an activity to object attributes or group memberships.

ActivitiesActor and event type
ObjectMutationsChanged object
AttributeUpdatesOld and new values
MembershipsGroup and member

Activities.UserID → Users.ID identifies the actor. Use ActivityTypes and Operations for event and operation names, Objects → SystemTables for target systems, and ValueTypes for attribute values. Both membership object IDs point to Objects.

03
Resource changes

Identify who changed a NIM resource.

UsersActor
SessionsSigned-in session
ResourceUpdatesResource and time

ResourceUpdates.ResourceTypeID → ResourceTypes.ID names the resource type; ResourceUpdates.OperationID → Operations.ID names the operation.

Start with the relevant event table, then use its declared joins below to build the SQL query.

In the tables below, PK marks a primary key and required means the column is declared NOT NULL. A column listed under Joins has a declared foreign key to the named table's ID. A blank join list means the export declares no foreign keys for that table.

Activity and target changesDirect link to Activity and target changes

TableColumns and SQLite typesDeclared joins
SessionsID INTEGER PK; UserID INTEGER required; LoginDateTime TEXT; LogoutDateTime TEXT; IpAddress TEXT; UserAgent TEXTUserID → Users.ID
ActivitiesID INTEGER PK; ActivityTypeID INTEGER required; UserID INTEGER required; DateTime TEXTActivityTypeID → ActivityTypes.ID; UserID → Users.ID
ObjectMutationsID INTEGER PK; ObjectID INTEGER required; OperationID INTEGER required; ActivityID INTEGER required; DateTime TEXTObjectID → Objects.ID; OperationID → Operations.ID; ActivityID → Activities.ID
AttributeUpdatesID INTEGER PK; ObjectMutationID INTEGER required; AttributeName TEXT; ValueOld TEXT; ValueNew TEXT; ValueTypeID INTEGER required; OperationID INTEGER requiredObjectMutationID → ObjectMutations.ID; ValueTypeID → ValueTypes.ID; OperationID → Operations.ID
MembershipsID INTEGER PK; GroupID INTEGER required; MemberID INTEGER required; OperationID INTEGER required; ActivityID INTEGER required; DateTime TEXTGroupID → Objects.ID; MemberID → Objects.ID; OperationID → Operations.ID; ActivityID → Activities.ID
ResourceUpdatesID INTEGER PK; OperationID INTEGER required; SessionID INTEGER required; ResourceTypeID INTEGER required; ResourceName TEXT; DateTime TEXTOperationID → Operations.ID; SessionID → Sessions.ID; ResourceTypeID → ResourceTypes.ID
ObjectsID INTEGER PK; SystemTableID INTEGER required; KeyValue TEXT; DisplayName TEXTSystemTableID → SystemTables.ID

Memberships.GroupID and Memberships.MemberID both refer to Objects.ID: join Objects twice with different aliases to show the group and member names. AttributeUpdates belongs to an ObjectMutations row; use ObjectMutations.ObjectID to identify the changed object.

App activityDirect link to App activity

TableColumns and SQLite typesDeclared joins
AppSessionsID INTEGER PK; SessionID INTEGER required; AppID INTEGER required; StartDateTime TEXT required; EndDateTime TEXT; AppResultID INTEGERSessionID → Sessions.ID; AppID → Apps.ID; AppResultID → AppResults.ID
AppActivityID INTEGER PK; AppSessionID INTEGER required; AppFormUnitID INTEGER; StartDateTime TEXT required; EndDateTime TEXT; AppResultID INTEGERAppSessionID → AppSessions.ID; AppFormUnitID → AppFormUnits.ID; AppResultID → AppResults.ID
AppActivityActionsID INTEGER PK; AppActivityID INTEGER required; ActionFsRef TEXT; ActionSeqNr INTEGER required; AppActionID INTEGER; StartDateTime TEXT required; EndDateTime TEXT; AppResultID INTEGERAppActivityID → AppActivity.ID; AppActionID → AppActions.ID; AppResultID → AppResults.ID
AppActivityActionCallsID INTEGER PK; AppActivityActionID INTEGER required; CallSeqNr INTEGER required; CallDescription TEXT required; StartDateTime TEXT required; EndDateTime TEXT; AppResultID INTEGERAppActivityActionID → AppActivityActions.ID; AppResultID → AppResults.ID
AppActivityVsObjectMutationsAppActivityID INTEGER required; ObjectMutationID INTEGER requiredAppActivityID → AppActivity.ID; ObjectMutationID → ObjectMutations.ID
AppActivityVsMembershipsAppActivityID INTEGER required; MembershipID INTEGER requiredAppActivityID → AppActivity.ID; MembershipID → Memberships.ID
AppActionsID INTEGER PK; AppActionTypeID INTEGER required; Name TEXT requiredAppActionTypeID → AppActionTypes.ID
AppResultsID INTEGER PK; AppErrorCodeID INTEGER required; Message TEXTAppErrorCodeID → AppErrorCodes.ID
AppFormUnitsID INTEGER PK; FormName TEXT required; UnitID TEXT required; UnitDescription TEXT required—
AppsID INTEGER PK; Name TEXT required—

The two AppActivityVs... tables are link tables. Neither declares its own ID or primary key in the export. Join through them to connect an app event to the target object mutation or membership change it caused.

Lookup and schema tablesDirect link to Lookup and schema tables

TableColumns and SQLite typesDeclared joins
ActivityTypesID INTEGER PK; Name TEXT—
AppActionTypesID INTEGER PK required; Name TEXT required—
AppErrorCodesID INTEGER PK required; Error TEXT required—
OperationsID INTEGER PK; Name TEXT—
ResourceTypesID INTEGER PK; Name TEXT—
SystemTablesID INTEGER PK; SystemName TEXT; TableName TEXT—
UsersID INTEGER PK; Name TEXT—
ValueTypesID INTEGER PK; Name TEXT—
VersionID INTEGER PK—

The export also contains indexes and installation-specific f_ virtual tables. Those filter tables are outside this core audit schema reference.