Accessing SMF data

Use SMF virtual tables to get SQL access to data in System Management Files (SMF).

About this task

When accessing data in SMF files, you use predefined virtual columns that are defined in the SMF virtual table map.

When using SMF log streams, you can use the following virtual columns to retrieve timestamp values:
LS_TIMESTAMP
Timestamp for log stream in GMT. When used in a WHERE predicate, the timestamp is searched in GMT.
LS_TIMESTAMP_LOCAL
Timestamp for log stream in local time zone. When used in a WHERE predicate, the timestamp is searched as local time.
To get SQL access to SMF data, complete the procedure that follows.

Procedure

  1. From the Server view, expand SQL > Data > SSID > Virtual Tables.
  2. Right-click the SMF virtual table or view from which you want to access the data.
  3. Right-click Generate Query, and then review the resulting SQL statement. If necessary, you can modify the statement to meet your needs. The following shows a sample SQL statement:
    -- ----------------------------------------------------------------- Name         : SMF_00000
    -- This statement will return all rows and all columns from the 
    -- following table:
    -- Name         : SMF_00000 : null
    -- Catalog      : null
    -- Schema       : DVSQL
    -- Remarks      : DATA - SMFDATA
    -- Tree Location: rs28/1200/SQL/Data/VDBS/Virtual Tables/SMF_00000
    -- The sql statement:
    SELECT SMF_LEN, SMF_ZERO, SMF_FLAG, SMF_RTY, SMF_TIME, SMF_SID, SMF_SSI, 
      SMF_STY, SMF_SEQN, SMF0JWT, SMF0BUF, SMF0VST, SMF0OPT, SMF0RST, SMF0RSV, 
      SMF0OSL, SMF0SYN, SMF0SYP, SMF0TZ, SMF0MSWT, SMF0MTWT
    FROM SMF_00000 LIMIT 1000;
  4. Optional: Execute the SQL statement to view, test, or save the resulting data.

What to do next

Get the code to use in your programs and applications by creating a SQL class from the virtual table.