• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. Developer Guide
  4. SQL Reference
  5. SQL Syntax
  6. CREATE APP WORKLOAD GROUP MAPPING

CREATE APP WORKLOAD GROUP MAPPING

Function

CREATE APP WORKLOAD GROUP MAPPING creates application mapping to an existing workload group.

Precautions

As long as the current user has the CREATE permission, the user can create application mapping.

Syntax

CREATE APP WORKLOAD GROUP MAPPING app_name
    [ WITH ( WORKLOAD_GPNAME  = workload_gpname ) ];

Parameter Description

  • app_name

    Specifies the name of application mapping This name must be unique in the database.

    Value range: A string. It must comply with the naming convention rule.

  • workload_gpname

    Specifies the name of the workload group to be deleted.

    Value range: A string that indicates an existing workload group.

Examples

-- Create a resource pool, and specify "High" Timeshare Workload under "DefaultClass" as its control group:
CREATE RESOURCE POOL pool1 WITH (CONTROL_GROUP="High");

-- Create a workload group and associate it with an existing resource pool:
CREATE WORKLOAD GROUP group1 USING RESOURCE POOL pool1;

-- Create application mapping to the workload group above:
CREATE APP WORKLOAD GROUP MAPPING app_wg_map1 WITH (WORKLOAD_GPNAME=group1);

-- Create default application mapping to the default workload group:
CREATE APP WORKLOAD GROUP MAPPING app_wg_map2;

-- Delete the application mapping:
DROP APP WORKLOAD GROUP MAPPING app_wg_map1;
DROP APP WORKLOAD GROUP MAPPING app_wg_map2;

-- Delete the workload group:
DROP WORKLOAD GROUP group1;

-- Delete the resource pools:
DROP RESOURCE POOL pool1;