altiAudit
altiAudit#
About altiAudit#
When auditing is performed on the Altibase server, the $ALTIBASE_HOME/trc directory is the default location for where the audit log file is created and audit logs are written; this location can be changed with the AUDIT_LOG_DIR property. Audit logs in the audit log file are written in binary format and are therefore, illegible by the user. The altiAudit utility converts and prints the audit log file in text format to enable the user to analyze them.
altiAudit [-s] {audit_log_file_name}
Syntax#
Descriptions#
This converts and outputs audit logs written by the server in text format.
With the -s option, audit logs can also be printed in CSV format.
Examples#
The following command prints audit logs in plain text format.
$ altiAudit $ALTIBASE_HOME/trc/alti-1366989680-0.aud
The results are printed as below:
[2015/03/05 14:59:29]
Session Info
User Name = SYS
Session ID = 1
Client IP = 127.0.0.1
Client Type = CLI-64LE
Client App Info = isql
Action = INSERT
Auto Commit = 1 (0:non-autocommit 1:autocommit)
Query Info
Statement ID = 65540
Transaction ID = 150657
Execute result = 4 (0:failure 1:rebuild 2:retry 3:queue empty 4:success)
Fetch result = 2 (0:failure 1:success 2:no result set)
Success count = 1
Failure count = 0
Return code = 0x02000
Processed row = 1
Used memory = 0 bytes
XA flag = 0 (0:non-XA 1:XA)
Query Elapsed Time
Total time = 0
Soft prepare time = 0
Parse time = 0
Validation time = 0
Optimization time = 0
Execution time = 0
Fetch time = 0
SQL
--------------------------------------------------------------------------------
insert into t1 values ('aaaa', 1)
--------------------------------------------------------------------------------
The following command prints audit logs in CSV format:
$ altiAudit -s $ALTIBASE_HOME/trc/alti-1366989680-0.aud
The results are printed as below:
1425535169,SYS,1,127.0.0.1,CLI-64LE,isql,INSERT,1,65540,150657,4,2,1,0,1,0,0,0,0,0,0,0,0,0,"insert
into t1 values ('aaaa', 1)"
Output#
In the output, each field has the following meaning:
Field Nam | Type | Description |
---|---|---|
Session Info | ||
User Name | String | The name of the user connected to the session |
Session ID | INTEGER | The session ID |
Client IP | String | The client IP address |
Client Type | String | The connected client type |
Client App Info | String | The application information |
Action | String | The executed statement type |
Auto Commit | INTEGER | 0: Non-auto commit mode 1: auto commit mode |
Query Info | ||
Statement ID | INTEGER | The statement ID |
Transaction ID | INTEGER | The transaction ID |
Execute result | INTEGER | The execution result: 0: failure 1: rebuild 2: retry 3: query empty 4: success |
Fetch result | INTEGER | The fetch result: 0: failure 1: success 2: no result set |
Success count | INTEGER | The number of times the statements conforming to the auditing condition succeeds. For the BY SESSION condition: the accumulated number of times the statements conforming to the auditing condition succeeds. For the BY ACCESS condition: if the statement conforming to the auditing condition succeeds, 1 is output. |
Failure count | INTEGER | The number of times the statement conforming to the auditing condition fails. For the BY SESSION condition: the accumulated number of times the statements conforming to the auditing condition fails. For the BY ACCESS condition: if the statement conforming to the auditing condition fails, 1 is output. |
Return code | INTEGER | The result code of the executed statement conforming to the auditing condition. The execution result is only output for the BY ACCESS condition. |
Processed row | INTEGER | The number of processed records |
Used memory | INTEGER | The memory usage (to be extended in the future) |
XA flag | INTEGER | 0: Non-XA 1: XA |
Query Elapsed Time | ||
Total time | BIGINT | The total time consumed in query execution |
Soft prepare time | BIGINT | The time consumed in preparing |
Parse time | BIGINT | The time consumed in parsing |
Validation time | BIGINT | The time consumed in validation |
Optimization time | BIGINT | The time consumed in optimization |
Execution time | BIGINT | The time consumed in execution |
Fetch time | BIGINT | The time consumed in fetching |
SQL | ||
INTEGER | The executed SQL statement |