2020-07-09 15:10:35 +00:00
|
|
|
---
|
2022-04-03 23:05:35 +00:00
|
|
|
toc_priority: 43
|
|
|
|
toc_title: SETTINGS PROFILE
|
2020-07-09 15:10:35 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# CREATE SETTINGS PROFILE {#create-settings-profile-statement}
|
|
|
|
|
2021-01-26 22:40:14 +00:00
|
|
|
Creates [settings profiles](../../../operations/access-rights.md#settings-profiles-management) that can be assigned to a user or a role.
|
2020-07-09 15:10:35 +00:00
|
|
|
|
|
|
|
Syntax:
|
|
|
|
|
|
|
|
``` sql
|
2021-07-29 15:20:55 +00:00
|
|
|
CREATE SETTINGS PROFILE [IF NOT EXISTS | OR REPLACE] TO name1 [ON CLUSTER cluster_name1]
|
2021-01-23 13:14:01 +00:00
|
|
|
[, name2 [ON CLUSTER cluster_name2] ...]
|
2020-07-09 15:10:35 +00:00
|
|
|
[SETTINGS variable [= value] [MIN [=] min_value] [MAX [=] max_value] [READONLY|WRITABLE] | INHERIT 'profile_name'] [,...]
|
|
|
|
```
|
|
|
|
|
|
|
|
`ON CLUSTER` clause allows creating settings profiles on a cluster, see [Distributed DDL](../../../sql-reference/distributed-ddl.md).
|
|
|
|
|
|
|
|
## Example {#create-settings-profile-syntax}
|
|
|
|
|
|
|
|
Create the `max_memory_usage_profile` settings profile with value and constraints for the `max_memory_usage` setting and assign it to user `robin`:
|
|
|
|
|
|
|
|
``` sql
|
|
|
|
CREATE SETTINGS PROFILE max_memory_usage_profile SETTINGS max_memory_usage = 100000001 MIN 90000000 MAX 110000000 TO robin
|
|
|
|
```
|