Runaway query notification
You can use the RunAwayQuery event type to monitor queries that exceed configured query timeout limits.
The runaway query timeout is a limit that you can specify system-wide (for all users), or for specific groups or users. The default query timeout is unlimited for users and groups, but you can establish query timeout limits by using a system default setting, or when you create or alter users or groups. The runaway query timeout limit does not apply to the admin database user.
-name 'RunAwayQuery' -on no -eventType runawayQuery -eventArgsExpr ''
-notifyType email -dst 'you@company.com' -ccDst '' -msg 'NPS system
$HOST - long-running query detected at $eventTimestamp.' -bodyText
'$notifyMsg\n\nsessionId: $sessionId\nplanId: $planId\nduration:
$duration seconds' -eventAggrCount 0
The following table lists the arguments to the RunAwayQuery event rule. The arguments are case-sensitive.
Arguments | Description | Examples |
---|---|---|
sessionId | The ID of the runaway session | Use these arguments for the email message. |
planId | The ID of the plan | |
duration | The amount of time (in seconds) that the query was running when it exceeded its timeout. |
-eventArgsExpr '$duration > 100'
NPS system alpha - long-running query detected at 07-Nov-03, 15:43:49
EST.
sessionId: 10056
planId: 27
duration: 105 seconds