Managing Priorities and Statement Limits for Spaces or Groups via the Command Line

You can use the SAP Datasphere datasphere command line interface to set priorities and statement limits for spaces or groups.

Prerequisites

To set priorities and statement limits for spaces or groups, you must have a global role that grants you the following privileges:
  • Data Warehouse General (-R------) - To access SAP Datasphere.

  • System Information (-RU-----) - To access the System tool.

The DW Administrator global role, for example, grants these privileges. For more information, see Privileges and Permissions and Standard Roles Delivered with SAP Datasphere.
You must, in addition: To browse the available commands, enter the following and press Return:
datasphere workload 
For general information about priorities and statement limits, see Set Priorities and Statement Limits for Spaces or Groups.

List Priorities and Statement Limits for Spaces or Groups

To list priorities and statement limits for spaces or groups available on the tenant, enter the following command and press Return:

datasphere workload list 
       [--output file.json] 
Complete the parameters as follows:

Parameter

Description

--output <file>.json

[optional] Enter a path to a .json file to write the output to.

If you do not include this option, the output will be printed to the command line.

Update Priorities and Statement Limits for Spaces or Groups

To update priorities and statement limits for spaces or groups available on the tenant, enter the following command and press Return:

datasphere workload update 
    --file-path <file>.json|--input '<stringified-json>'
Complete the parameters as follows:

Parameter

Description

--file-path <file>.json

Enter a path to a file with a .json extension containing the list of space or group properties to update.

{
    "assignment": "SPACE" | "GROUP",
    "workloadClasses": [
        {
            "group": "<GroupName>", // relevant only if assignment is GROUP 
            "spaceId": "<SpaceID>", // relevant only if assignment is SPACE
            "priority": <PriorityNumber>,
            "workloadType": "<WorkloadType>",
            "totalStatementThreadLimit": <Value>,
            "totalStatementThreadLimitUnit": "Counter|Percent",
            "totalStatementMemoryLimit": <Value>,
            "totalStatementMemoryLimitUnit": "Gigabyte|Percent"
        }
    ]
}
In this example, you set the following priorities and statements limits to 2 spaces:
  • Set the space SALES_EU the space priority from 1 to 2 and change the workload type from custom to default.

  • Set the space SALES_US the space priority from 5 to 8 and change the workload type from default to custom, with the totalStatementThreadLimit parameter to 50%, and the totalStatementMemoryLimit parameter to 80%.

Enter the following command and press Return:
datasphere workload update --file-path update.json
Where the file update.json contains the following:
{
    "assignment": "SPACE",
    "workloadClasses": [
        {
            "group": null,
            "spaceId": "SALES_EU",
            "priority": 2,
            "workloadType": "default",
        },
        {
            "group": null,
            "spaceId": "SALES_US",
            "priority": 8,
            "workloadType": "custom",
            "totalStatementThreadLimit": 50,
            "totalStatementThreadLimitUnit": "Percent",
            "totalStatementMemoryLimit": 80,
            "totalStatementMemoryLimitUnit": "Percent"
        },
    ]
}
In this example, the default priority and statements limits of the group SQL Access are applied: To change the priority and apply custom statement limits, enter the following command and press Return:
datasphere workload update --file-path update.json
Where the file update.json contains the following:
{
    "assignment": "GROUP",
    "workloadClasses": [
        {
            "group": "SQL Access",
            "spaceId": null,
            "priority": 4,
            "workloadType": "custom",
            "totalStatementThreadLimit": 50,
            "totalStatementThreadLimitUnit": "Percent",
            "totalStatementMemoryLimit": 70,
            "totalStatementMemoryLimitUnit": "Percent"
    }
    ]
}

Switch Workload Distribution from Space to Group or Group to Space

You can switch the workload distribution between space and group.

In this example, the workload distribution is organized by space:
{
    "assignment": "SPACE",
    "workloadClasses": [
        {
            "group": null,
            "spaceId": "<SpaceID>",
            "priority": <PriorityNumber>,
            "workloadType": "<WorkloadType>",
            "totalStatementThreadLimit": <Value>,
            "totalStatementThreadLimitUnit": "Counter|Percent",
            "totalStatementMemoryLimit": <Value>,
            "totalStatementMemoryLimitUnit": "Gigabyte|Percent"
        }
    ]
}
To switch the workload distribution from space to group, enter the following command and press Return:
datasphere workload update --file-path update.json
Where the file update.json contains the following:
{
    "assignment": "GROUP",
    "workloadClasses": [
    ]
}
The default settings are applied to the groups.

The Workload Management File Format

The priorities and statement limits for spaces or groups are set and retrieved in the workload management definition file format and stored as a .json file.

You can set any priority and statement limits properties using the following syntax:
{
    "assignment": "SPACE" | "GROUP",
    "workloadClasses": [
        {
            "group": "<GroupName>", // relevant only if assignment is GROUP 
            "spaceId": "<SpaceID>", // relevant only if assignment is SPACE
            "priority": <PriorityNumber>,
            "workloadType": "<WorkloadType>",
            "totalStatementThreadLimit": <Value>,
            "totalStatementThreadLimitUnit": "Counter|Percent",
            "totalStatementMemoryLimit": <Value>,
            "totalStatementMemoryLimitUnit": "Gigabyte|Percent"
        }
	{
            "group": "<GroupName>", // relevant only if assignment is GROUP 
            "spaceId": "<SpaceID>", // relevant only if assignment is SPACE
            "priority": <PriorityNumber>,
            "workloadType": "<WorkloadType>",
            "totalStatementThreadLimit": <Value>,
            "totalStatementThreadLimitUnit": "Counter|Percent",
            "totalStatementMemoryLimit": <Value>,
            "totalStatementMemoryLimitUnit": "Gigabyte|Percent"
        }
    ]
}
Parameters are set as follows:

Parameter

Space Property

Description

<spaceId>

Space ID

[required] Choose between Space ID or Group

Enter the technical name of the space. Can contain a maximum of 20 uppercase letters or numbers and must not contain spaces or special characters other than _ (underscore). Unless advised to do so, must not contain prefix _SYS and should not contain prefixes: DWC_, SAP_ (See Rules for Technical Names).

<group>

Group

[required] Choose between Space ID or Group

Enter the name of the group. To view the list of groups, see Set Priorities and Statement Limits for Spaces or Groups.

priority

Priority

Enter the prioritization of the space or group when querying the database. You can enter a value from 1 (lowest priority) to 8 (highest priority).

workloadType

Total Statement Memory Limit

Choose between:

  • default - The default configuration provides generous resource limits, while preventing any single space or group from overloading the system.

  • custom - The custom configuration enables you to specify the value for statement limits to set maximum total thread and memory limits that statements running concurrently in the space or group can consume.

totalStatementMemoryLimit

totalStatementMemoryLimitUnit

Total Statement Memory Limit

GB/%

If you've chosen custom for the workloadType, you can set these parameters. Enter the maximum number (or percentage) of GBs of memory that statements running concurrently in the space or group can consume. You can enter any value or percentage between 0 (no limit) and the total amount of memory available in your tenant.

totalStatementThreadLimit

totalStatementThreadLimitUnit

Total Statement Thread Limit

Threads/%

If you've chosen custom for the workloadType, you can set these parameters. Enter the maximum number (or percentage) of threads that statements running concurrently in the space or group can consume. You can enter any value or percentage between 0 (no limit) and the total number of threads available in your tenant.

To view the default values for the above parameters, see Set Priorities and Statement Limits for Spaces or Groups.