Hitachi

Hitachi Advanced Database Setup and Operation Guide


12.3.3 Referencing audit trails (when using SELECT statements to reference audit trails)

To reference audit trails, you execute a SELECT statement with the ADB_AUDITREAD function specified.

Important

Only an HADB user with the audit viewer privilege can reference audit trails by executing a SELECT statement that specifies the ADB_AUDITREAD function.

The following are examples of SELECT statements that reference audit trails:

Example 1

This statement references the audit trails in all audit trail files in the audit trail storage directory (/mnt/audittrail/savearea).

Example of SELECT statement execution

SELECT * FROM TABLE(ADB_AUDITREAD(MULTISET['/mnt/audittrail/savearea/*.aud'])) "DT"
Explanation

In the underlined portion, specify the path of the audit trail files that contain the audit trails you want to reference. In this example, because the name of the audit trail file is specified using the special character * (as *.aud), the statement will reference audit trails stored in all audit trail files (files with the extension aud) in the /mnt/audittrail/savearea directory.

Example 2

In this example, the statement references a list of HADB users who accessed the HADB server between April 1st and April 30th, 2017. The audit trail files to be referenced are stored in the audit trail storage directory (/mnt/audittrail/savearea).

Example of SELECT statement execution

SELECT DISTINCT "USER_NAME"
    FROM TABLE(ADB_AUDITREAD(MULTISET['/mnt/audittrail/savearea/*.aud'])) "DT"
       WHERE "EXEC_TIME" BETWEEN TIMESTAMP'2017/04/01 00:00:00.000000'
                             AND TIMESTAMP'2017/04/30 23:59:59.999999'
Explanation

The USER_NAME column stores the authorization identifier of the HADB user. The EXEC_TIME column contains the date and time at which the HADB user performed the operation on the HADB server (the completion date and time of the event). The USER_NAME and EXEC_TIME columns are the column names in the table function derived table created by the ADB_AUDITREAD function. For details about the column names of table function derived tables, see 12.9.2 Column structure of table function derived table when retrieving audit trails.

For further examples of SELECT statements used when referencing audit trails, see 12.7.5 Performing regular auditing.

For details about the specification rules for the ADB_AUDITREAD function, see ADB_AUDITREAD function in the manual HADB SQL Reference.

▪ Notes