DB2 10.5 for Linux, UNIX, and Windows

AUDIT_LIST_LOGS table function - Lists archived audit log files

The AUDIT_LIST_LOGS table function lists the archived audit log files for a database which are present in the specified directory.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-AUDIT_LIST_LOGS--(--directory--)----------------------------><

The schema is SYSPROC.

Procedure parameters

directory
An optional input argument of type VARCHAR(1024) that specifies the directory where the archived audit file(s) will be written. The directory must exist on the server and the instance owner must be able to create files in that directory. If the argument is null or an empty string, then the search default directory is used.

Authorization

EXECUTE privilege on AUDIT_LIST_LOGS table function.

Default PUBLIC privilege

None

Examples

Example 1: Lists all archived audit logs in the default audit archive directory:

  SELECT * FROM TABLE(SYSPROC.AUDIT_LIST_LOGS('')) AS T1
Note: This only lists the logs in the directory for database on which the query is run. Archived files have the format db2audit.db.<dbname>.log.<timestamp>

Information Returned

Table 1. The information returned for AUDIT_LIST_LOGS
Column Name Data Type Description
PATH VARCHAR(1024) Path location of the archived file.
FILE VARCHAR(1024) Filename of the archived file.
SIZE BIGINT File size of the archived file.