New syntax of the SET ENVIRONMENT statement of SQL can associate an existing resource class with the current user session, or change the mutability attribute of the DS_CLASS session environment variable:
>>-SET ENVIRONMENT DS_CLASS--+-'--ds_class_name--'-+----------->< +-'DEFAULT'-----------+ +-MUTABLE-------------+ '-IMMUTABLE-----------'
Here DS_CLASS is a new session environment variable that determines what portion of shared memory can be parceled out to a query, and how many queries accessing PDQ memory can execute concurrently in sessions associated with the specified resource class. (The onutil utility can create or update resource class definitions.)
The term that follows the DS_CLASS keyword has one of the following effects:
For example, the following statements associate the session with the DEVELOPMENT resource class, and set the mutability to IMMUTABLE:
SET ENVIRONMENT DS_CLASS 'DEVELOPMENT'; SET ENVIRONMENT DS_CLASS IMMUTABLE;
By default, a query uses the built-in DEFAULT resource class if any of the following is true:
The DBA can use the onutil SET command when the server is online to alter the CLASS_DS_MEM_QUOTA and CLASS_DS_MAX_QUERIES settings for any DS_CLASS. Since this must be done one DS_CLASS at a time, the administrator might have to execute a sequence of commands to achieve the desired settings. The sequence of commands would have to also ensure that at no point an attempt at a setting causes the total CLASS_DS_MEM_QUOTA for all defined resource classes to exceed 100%.
Typically a DBA who uses resource classes would include the new SET ENVIRONMENT statement in the public.sysdbopen( ) or user.sysdbopen( ) procedures to associate each database with a resource class. If public.sysdbopen( ) specifies a resource class for the PUBLIC group, and the DBA creates user.sysdbopen( ) procedures for one or more users, the DBA should include an appropriate SET ENVIRONMENT DS_CLASS statement in each user.sysdbopen( ) procedure, because the public.sysdbopen( ) procedure is not executed when these users connect to the database.
If the SET ENVIRONMENT statement within sysdbopen( ) fails, then (by default) the session is associated with the DEFAULT resource class.
SET ENVIRONMENT DS_CLASS can specify a resource class only when DS_CLASS is set to MUTABLE. Only a user who holds the DBA access privilege can use the SET ENVIRONMENT DS_CLASS statement (or the onmode -q command, as described below) to set the mutability of the DS_CLASS session environment variable.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]