Audit Log
Casabase Cube records application activity in its audit log. The procedures in this section let administrators export detailed audit records, summarize activity by event type, and manage audit retention.
EXPORT_AUDIT_LOG
Section titled “EXPORT_AUDIT_LOG”Minimum role: CUBE_ADMIN
EXPORT_AUDIT_LOG( P_START_DATE, P_END_DATE, P_EVENT_TYPE, P_CUBE_NAME, P_LIMIT) -> TABLEExports audit records with optional filters. All parameters are optional. Pass NULL to widen a filter.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
P_START_DATE |
TIMESTAMP_LTZ |
opt | Start of the date range. |
P_END_DATE |
TIMESTAMP_LTZ |
opt | End of the date range. |
P_EVENT_TYPE |
VARCHAR |
opt | Filter to one event type. |
P_CUBE_NAME |
VARCHAR |
opt | Filter to one cube. |
P_LIMIT |
NUMBER |
opt | Maximum number of rows to return. |
Returns
Section titled “Returns”Returns:
IDEVENT_TYPEUSER_NAMEROLE_NAMEACTIONOBJECT_TYPEOBJECT_NAMECUBE_NAMEDETAILSEXECUTION_TIME_MSROW_COUNTSTATUSERROR_MESSAGESESSION_IDCREATED_AT
Event types
Section titled “Event types”Audit event types are not necessarily procedure names. For example, a cube clone is recorded as CUBE_CLONE, a table drop as TABLE_DROP, and a data load can be recorded as DATA_IMPORT.
Common event types include:
APP_INSTALL, APP_UPGRADE, UPGRADE_MIGRATION, DIMENSION_CREATE, DIMENSION_REBUILD, DIMENSION_VIEW, DIMENSION_SNAPSHOT, ATTR_BUILD_ASYNC, DATA_IMPORT, LOAD_DATA, FACT_RESORT, FACT_SECURE_VIEW, FORMULA_IMPORT, SET_FORMULA, OUTLINE_IMPORT, DATA_QUERY, SCHEDULED_QUERY, CUBE_CLONE, TABLE_DROP, CONFIG_CHANGE, and PROFILE_DERIVE.
Examples
Section titled “Examples”Return the 50 most recent matching application-upgrade records:
CALL CUBE.EXPORT_AUDIT_LOG( NULL, NULL, 'APP_UPGRADE', NULL, 50);Export audit activity for a cube and date range:
CALL CUBE.EXPORT_AUDIT_LOG( '2026-08-01'::TIMESTAMP_LTZ, '2026-08-31'::TIMESTAMP_LTZ, NULL, 'FINANCE', 1000);GET_AUDIT_SUMMARY
Section titled “GET_AUDIT_SUMMARY”Minimum role: CUBE_ADMIN
GET_AUDIT_SUMMARY(P_DAYS) -> TABLEReturns aggregated audit activity by event type over a period.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
P_DAYS |
NUMBER |
opt | Number of days to summarize. |
Returns
Section titled “Returns”Returns:
EVENT_TYPEEVENT_COUNTSUCCESS_COUNTERROR_COUNTAVG_EXECUTION_MSTOTAL_ROWS_PROCESSEDUNIQUE_USERSFIRST_EVENTLAST_EVENT
A rising ERROR_COUNT or an AVG_EXECUTION_MS that has increased since the last load can help identify a developing operational issue.
Example
Section titled “Example”CALL CUBE.GET_AUDIT_SUMMARY(30);PURGE_AUDIT_LOG
Section titled “PURGE_AUDIT_LOG”Minimum role: CUBE_ADMIN
PURGE_AUDIT_LOG( P_RETENTION_DAYS, P_CONFIRM) -> VARCHARDeletes audit records older than the specified retention period.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
P_RETENTION_DAYS |
NUMBER |
opt | Keep records newer than this number of days. |
P_CONFIRM |
BOOLEAN |
opt | FALSE reports what would be deleted without changing data. TRUE performs the deletion. |
Examples
Section titled “Examples”Preview the purge:
CALL CUBE.PURGE_AUDIT_LOG(365, FALSE);Perform the purge:
CALL CUBE.PURGE_AUDIT_LOG(365, TRUE);