Changes a resource limit by specifying a new limit value, or the action to take when the limit is exceeded, or both.
sp_modify_resource_limit {name, appname} rangename, limittype, limitvalue, enforced, action, scope
row_count – the maximum number of rows a query can return before the limit is enforced
elapsed_time – the maximum number of seconds in wall-clock time that a query batch or transaction can run before the limit is enforced
io_cost – a unitless measure derived from optimizer’s costing formula
tempdb_space – limits the number of pages from a temporary database that a single session can have.
1 – issues a warning
2 – aborts the query batch
3 – aborts the transaction
4 – kills the session
null – retains the existing value
sp_modify_resource_limit robin, NULL, weekends, row_count, 3000, NULL, 1, NULL
sp_modify_resource_limit NULL, acctg, "at all times", elapsed_time, 45, 2, 2, 6
sp_modify_resource_limit NULL, payroll, tu_wed_7_10, elapsed_time, 90, null, null, 2
sp_modify_resource_limit joe_user, NULL, saturday_night, row_count, NULL, NULL, 2, NULL
You cannot change the login or application to which a limit applies or specify a new time range, limit type, enforcement time, or scope.
The modification of a resource limit causes the limits for each session for that login and/or application to be rebound at the beginning of the next query batch for that session.
SAP ASE provides resource limits to help system administrators prevent queries and transactions from monopolizing server resources. Resource limits, however, are not fully specified until they are bound to a time range.
For more information, see the System Administration Guide.
The permission checks for sp_modify_resource_limit differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage resource limit privilege. |
Disabled | With granular permissions disabled, you must be a user with sa_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|