CHANGE_USER_PRIORITY
CHANGE_USER_PRIORITY enables superusers to modify the priority of all queries issued by a user that are either running or waiting in workload management (WLM).
Only one user, session, or query can run with the priority CRITICAL
.
Syntax
CHANGE_USER_PRIORITY(user_name, priority)
Arguments
- user_name
-
The database user name whose query priority is changed.
- priority
-
The new priority to be assigned to all queries issued by
user_name
. This argument must be a string with the valueCRITICAL
,HIGHEST
,HIGH
,NORMAL
,LOW
,LOWEST
, orRESET
. Only superusers can change the priority toCRITICAL
. Changing the priority toRESET
removes the priority setting foruser_name
.
Return type
None
Examples
To change the priority for the user
analysis_user
to LOWEST
, use the following example.
SELECT CHANGE_USER_PRIORITY('analysis_user', 'lowest');
+-------------------------------------------------------------------------------------+ | change_user_priority | +-------------------------------------------------------------------------------------+ | Succeeded to change user priority. Changed user (analysis_user) priority to lowest. | +-------------------------------------------------------------------------------------+
To change the priority to LOW
, use the following example.
SELECT CHANGE_USER_PRIORITY('analysis_user', 'low');
+----------------------------------------------------------------------------------------------+ | change_user_priority | +----------------------------------------------------------------------------------------------+ | Succeeded to change user priority. Changed user (analysis_user) priority from Lowest to low. | +----------------------------------------------------------------------------------------------+
To reset the priority, use the following example.
SELECT CHANGE_USER_PRIORITY('analysis_user', 'reset');
+-------------------------------------------------------+ | change_user_priority | +-------------------------------------------------------+ | Succeeded to reset priority for user (analysis_user). | +-------------------------------------------------------+