3.38 TopCpuUsers

Use this Knowledge Script to monitor the CPU time for current user sessions. If the CPU utilization exceeds the threshold, the job raises an event.

You can specify the number of user sessions with the highest CPU utilization to display in the Event Properties dialog box. The Event Properties dialog box includes the CPU usage for each of the top N sessions, username, session ID, and program name. Enter 0 to display all user sessions.

This script requires that the Oracle timed_statistics parameter be turned on (set to TRUE) for the database you are monitoring.

The account you use to run this script must have SELECT permissions for the following tables:

DBA_USERS
V_$SESSION
V_$SESSTAT
V_$STATNAME
V_$VERSION

3.38.1 Resource Objects

Oracle Database folders. When you drop a script on an Oracle Database folder, a job executes on that database and monitors only that database.

3.38.2 Default Schedule

The default interval for this script is Every 30 minutes.

3.38.3 Setting Parameter Values

Set the following parameters as needed:

Description

How to Set It

Oracle Username

Enter the username that this script needs to access the target databases. If you run this script on more than one database, configure each database with the same username. To use SYSDBA authentication, leave this parameter blank. The default is blank.

Collect data for CPU usage of top N user sessions?

Select Yes to collect data for charts and reports. When you enable data collection, the Knowledge Script returns the total CPU time for the top N users. The default is unselected.

Number of user sessions to display

Specify the number of user sessions you want displayed in the Event Properties dialog box. Enter 0 if you want information for all user sessions. The default is 15.

Raise event if threshold is exceeded?

Select Yes raise an event if the CPU usage of any user session exceeds the threshold you set. The default is unselected.

Threshold - Maximum amount of CPU time for a user session

Enter a threshold for the maximum number of CPU cycles per 1/100th of a second that a single user session can use before the job raises an event. The default is 50.

Severity

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 10.

Event severity for internal failure

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 5 (red event indicator).