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
-
Data Warehouse General (-R------) - To access SAP Datasphere.
-
System Information (-RU-----) - To access the System tool.
-
Install the datasphere command line interface (see Install or Update the SAP Datasphere Command Line Interface).
-
Log in to your SAP Datasphere tenant (see Log into the Command Line Interface via an OAuth Client).
datasphere workloadFor 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]
|
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>'
|
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"
}
]
}
|
-
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%.
datasphere workload update --file-path update.jsonWhere 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"
},
]
}
datasphere workload update --file-path update.jsonWhere 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.
{
"assignment": "SPACE",
"workloadClasses": [
{
"group": null,
"spaceId": "<SpaceID>",
"priority": <PriorityNumber>,
"workloadType": "<WorkloadType>",
"totalStatementThreadLimit": <Value>,
"totalStatementThreadLimitUnit": "Counter|Percent",
"totalStatementMemoryLimit": <Value>,
"totalStatementMemoryLimitUnit": "Gigabyte|Percent"
}
]
}
datasphere workload update --file-path update.jsonWhere 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.
{
"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"
}
]
}
|
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:
|
|
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.