Before you can collect event data related to activities,
you must configure data collection. The configuration options that
you can use depend on your purpose for collecting data.
About this task
There are two ways to configure data collection for an activity
event monitor:
- You can have activity event data generated whenever a threshold
that you created by using the CREATE THRESHOLD statement is violated.
- You can specify the COLLECT ACTIVITY METRICS clause for the CREATE
or ALTER statement for WLM objects.
Procedure
To collect event data that is related to activities:
- Determine the activities for which you want to collect
data.
The table that follows outlines the options:
For which activities is data to be collected? |
Configuration controlled by: |
Activities related to a threshold violation |
For activities that are related to a threshold violation,
issue the CREATE THRESHOLD or ALTER THRESHOLD statement, specifying
the COLLECT ACTIVITY DATA clause. When you specify the COLLECT ACTIVITY
DATA clause, activity data is sent to any active activities event
monitors whenever the threshold is violated. Optionally, specify one
of the following additional clauses: WITH DETAILS; WITH DETAILS, SECTION; or AND VALUES. Tip: Consider changing the value of the mon_act_metrics configuration parameter to NONE. Doing so restricts
the activities for which event data that is collected to just those
activities that are related to threshold violations.
|
Activities related to specific workload management objects |
For activities related to workload management, issue one of
the following statements, specifying the COLLECT ACTIVITY DATA clause.
Optionally, specify one of the following additional clauses: WITH
DETAILS; WITH DETAILS, SECTION; WITH
SECTION INCLUDE ACTUALS BASE; or AND VALUES:
- CREATE WORKLOAD
- ALTER WORKLOAD
- CREATE WORK ACTION SET
- ALTER WORK ACTION SET
- CREATE SERVICE CLASS
- ALTER SERVICE CLASS
When you specify a COLLECT ACTIVITY DATA clause for any of
these statements, activity data for the workload objects that are
referenced in the statement is sent to any active activity event monitor.
For example, to collect activity event data for the PAYROLL workload,
you can alter the workload by issuing this statement: ALTER WORKLOAD PAYROLL COLLECT ACTIVITY
DATA WITH SECTION INCLUDE ACTUALS BASE
In this example,
activity data is collected along with data for section actuals.
|
- Set the collection level using one of the configuration
options described in the previous step.
For example,
to collect activity event data for the PAYROLL workload, you can alter
the workload with this statement:
ALTER WORKLOAD PAYROLL COLLECT ACTIVITY DATA WITH SECTION INCLUDE ACTUALS BASE
In this last example, activity data is collected, along with data
for section actuals.
Results
Data collection is configured.
Collecting activity data for the default user workload
If you want to collect activity event data for activities that do
not map to a specific workload, you can collect data for the default
user workload by issuing a statement such as the one that follows: ALTER WORKLOAD SYSDEFAULTUSERWORKLOAD COLLECT ACTIVITY DATA ON COORDINATOR
WITH DETAILS
This statement causes detailed activity data
to be collected for any activity that is not associated with a user-defined
workload object. By default, all database connections are associated
with the SYSDEFAULTUSERWORKLOAD workload if there are no user-defined
workload objects.
What to do next
Run your application or workload. As activities that satisfy
the collection criteria are run, event data is sent to any active
activity event monitors.