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
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
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. |