Hitachi

Hitachi Advanced Database Setup and Operation Guide


12.3.4 Referencing audit trails (when referencing audit trail data converted to CSV format)

You can use spreadsheet software such as Microsoft(R) Excel to view audit trails. To do so, first execute the adbexport command to convert the audit trails to data in CSV format, and then use the resulting CSV data as input information for the spreadsheet software. The procedure for converting audit trails to data in CSV format is as follows:

Example:

This example converts the audit trails in all audit trail files in the audit trail storage directory (/mnt/audittrail/savearea) to data in CSV format.

Procedure:

  1. Create the output data path file for the adbexport command.

    In the output data path file, specify the path name of the output data file (the path name of the file to which audit trails are to be output in CSV format). A specification example of an output data path file is as follows:

    /home/auditviewer/audit/audit1.csv     ← Audit trail data is output to this file in CSV format.

    Save the output data path file as /home/auditviewer/export/expf01.txt.

  2. Create an SQL statement file for the adbexport command.

    In the SQL statement file, specify a SELECT statement that specifies the ADB_AUDITREAD function. A specification example of the SQL statement file is as follows:

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

    Save the SQL statement file as /home/auditviewer/export/sel01.txt.

    Tip

    In this example, because no search conditions are specified in the SELECT statement, the audit trails to be converted to CSV format are all audit trails in the audit trail file targeted by the ADB_AUDITREAD function. If you want to output only the required audit trail information in CSV format, use one of the following methods:

    • Specify search conditions in the SELECT statement in the SQL statement file.

    • In the SQL statement file, specify a SELECT statement that retrieves data from a viewed table.

      In this case, you need to define a viewed table that specifies search conditions in a query specification that specifies, in a table reference, a table function derived table that specifies the ADB_AUDITREAD function.

  3. Execute the adbexport command.

    adbexport -u ADBAUDITOR -p '#HelloHADB_Aud01'
              -q /home/auditviewer/export/sel01.txt
              /home/auditviewer/export/expf01.txt

    In the -u option and the -p option, specify the authorization identifier and password of an HADB user who has the audit viewer privilege.

    In the -q option, specify the SQL statement file you created in step 2.

    /home/auditviewer/export/expf01.txt is the path name of the output data path file you created in step 1.

Important

The task of converting audit trails to data in CSV format can only be performed by an HADB user who has the audit viewer privilege.

For details about output data path files and the specification rules for SQL statement files, see Explanation of the specification format and options in Specification format for the adbexport command in the manual HADB Command Reference.

Important
  • Take care to ensure that the file containing the audit trails converted to CSV data is handled appropriately. You must ensure that only persons who perform auditing can reference the file. You must also make sure that the file cannot be modified.

  • We recommend that only persons who perform auditing (HADB users who have the audit viewer privilege) reference audit trails. Therefore, the method in 12.3.3 Referencing audit trails (when using SELECT statements to reference audit trails) is to be used to reference audit trails in most circumstances.