Creating a table for audit data
About this task
To load data files into a database with dbload, a table to receive the data must already exist.
Procedure
Use the order shown in the example in the following example. The sample schema reflects the format of the dbload data file that onshowaudit created.
The sample CREATE TABLE statement in the following example creates an audit table with the name frag_logs. For information about the contents of each column, see Interpreting data extracted from audit records.
CREATE TABLE frag_logs
(
adttag CHAR(4) NOT NULL,
date_time DATETIME YEAR TO FRACTION(3) NOT NULL,
hostname VARCHAR(128) NOT NULL,
pid INTEGER NOT NULL,
server VARCHAR(128) NOT NULL,
username VARCHAR(32) NOT NULL,
errno INTEGER NOT NULL,
code CHAR(4) NOT NULL,
dbname VARCHAR(128),
tabid INTEGER,
objname VARCHAR(128),
extra_1 INTEGER,
partno INTEGER,
row_num INTEGER,
login VARCHAR(32),
flags INTEGER,
extra_2 VARCHAR(160)
);
The table that the statement in the preceding example creates does not have any indexes. To improve audit-analysis performance, you can place indexes on columns within the table, depending on the type of analysis that you perform. For guidance on indexing columns, see your HCL OneDB™ Performance Guide.