MANAGE_AUDIT_JOURNAL_DATA_MART procedure
The MANAGE_AUDIT_JOURNAL_DATA_MART procedure populates a table with audit journal data for a specific audit journal entry type from a specified time period, or deletes an existing data mart table.
The table is created in the specified library with the name AUDIT_JOURNAL_xx where xx corresponds to the specified audit journal entry type. For example, when creating a data mart for the PW (Password) audit journal entry, a table named AUDIT_JOURNAL_PW is created. The procedure uses Audit journal entry services to populate the table. The result of the call to the procedure, including any failure message, is returned by the QSYS2.AUDIT_JOURNAL_DATA_MART_INFO view.
Authorization:
- *AUDIT special authority
- *USE authority to the library that contains the audit journal data mart
- *OBJOPR, *READ, and *ADD authority to the AUDIT_JOURNAL_xx table
- *USE and *OBJEXIST authority to the audit journal
- *USE authority to all requested journal receivers
- *AUDIT special authority.
- *OBJOPR, *READ, *ADD, and *EXECUTE authority to the library that contains the audit journal data mart
- *USE and *OBJEXIST authority to the audit journal
- *USE authority to all requested journal receivers
- *AUDIT special authority
- *USE authority to the library that contains the audit journal data mart
- *OBJOPR and *OBJEXIST authority to the AUDIT_JOURNAL_xx table
- *AUDIT special authority
- *OBJOPR, *READ, *ADD, and *EXECUTE authority to the library that will contain the audit journal data mart
- *OBJOPR, *OBJMGT, *OBJEXIST, *READ, *ADD, and *DLT authority to the AUDIT_JOURNAL_xx table
- *USE and *OBJEXIST authority to the audit journal
- *USE authority to all requested journal receivers
The schema is QSYS2.
- journal-entry-type
- A character or graphic string expression that identifies the journal entry type to include in the data mart. Only journal entry types that have corresponding Audit journal entry services are supported.
- data-mart-library
- A character or graphic string expression that identifies the library that contains the data mart table or where the data mart table is to be created.
- starting-timestamp
- A character or graphic string expression that identifies the starting timestamp to use.
- ending-timestamp
- A timestamp value that specifies the ending timestamp to use.
- data-mart-action
- A character or graphic string expression that indicates the type of action to perform. If a
value is not provided, CREATE is used.
- ADD
- Inserts data into an existing data mart table and adds an entry for this data-mart-library and journal-entry-type to the AUDIT_JOURNAL_DATA_MART_INFO table. It uses the value of data-mart-filter that was specified when the data-mart-action of CREATE or REPLACE was run.
- CREATE
- Creates and populates a new data mart table and adds an entry for this data-mart-library and journal-entry-type to the AUDIT_JOURNAL_DATA_MART_INFO table.
- DROP
- Deletes the data mart table and removes the corresponding entry from the AUDIT_JOURNAL_DATA_MART_INFO table.
- REPLACE
- Creates and populates a new data mart table and adds an entry for this data-mart-library and journal-entry-type to the AUDIT_JOURNAL_DATA_MART_INFO table.
- data-mart-filter
- A character or graphic string expression up to 1000 characters long that limits the rows added to the data mart table. The string must consist of one or more predicates that will be appended to the SQL request to return data from the AUDIT_JOURNAL_xx table function. The predicate string is not validated in any way. If it is incorrect, an SQL syntax error will be returned. Columns referenced in the predicate must exist as return columns from the AUDIT_JOURNAL_xx table function.
Notes
The resulting AUDIT_JOURNAL_xx table will have the same format as the corresponding Audit journal entry services table function. The table is owned by the caller who first creates the table and *PUBLIC is configured with *EXCLUDE authority. The system name of the table is AJ_xx. The table is not managed by the system. It is up to the user to grant access to other users and to maintain the table.
- *USE authority to the library that contains the AUDIT_JOURNAL_xx table.
- *OBJOPR and *READ authority to the AUDIT_JOURNAL_xx table.
Examples
- Build a data mart for PW audit journal entries from the last month in the DMARTLIB library.
CALL QSYS2.MANAGE_AUDIT_JOURNAL_DATA_MART(JOURNAL_ENTRY_TYPE => 'PW', DATA_MART_LIBRARY => 'DMARTLIB', STARTING_TIMESTAMP => CURRENT DATE - 1 MONTH, ENDING_TIMESTAMP => CURRENT TIMESTAMP);
- Build a data mart for AF audit journal entries from the last month in the DMARTLIB library. Only
include A (not authorized to object) entries that are for objects not in a library that starts with
Q.
CALL QSYS2.MANAGE_AUDIT_JOURNAL_DATA_MART(JOURNAL_ENTRY_TYPE => 'AF', DATA_MART_LIBRARY => 'DMARTLIB', STARTING_TIMESTAMP => CURRENT DATE - 1 MONTH, ENDING_TIMESTAMP => CURRENT TIMESTAMP, DATA_MART_FILTER => 'VIOLATION_TYPE = ''A'' AND OBJECT_LIBRARY NOT LIKE ''Q%''');
- Add journal data for PW entries to the existing data mart in DMARTLIB.
CALL QSYS2.MANAGE_AUDIT_JOURNAL_DATA_MART(JOURNAL_ENTRY_TYPE => 'PW', DATA_MART_LIBRARY => 'DMARTLIB', STARTING_TIMESTAMP => '*CONTINUE', ENDING_TIMESTAMP => CURRENT TIMESTAMP, DATA_MART_ACTION => 'ADD' );
- Drop the DMARTLIB.AUDIT_JOURNAL_PW
table.
CALL QSYS2.MANAGE_AUDIT_JOURNAL_DATA_MART(JOURNAL_ENTRY_TYPE => 'PW', DATA_MART_LIBRARY => 'DMARTLIB', DATA_MART_ACTION => 'DROP' );