CREATE MAINTENANCE POLICY
statementsupportedGovernance (policies, tags, data quality)Creates a new maintenance policy in the current or specified schema.
Syntax
supportedpartialnot supportednot scored
CREATE [ OR REPLACE ] MAINTENANCE POLICY [ IF NOT EXISTS ] <name>
SCHEDULE = 'USING CRON <cron_spec> <timezone>'
[ COMMENT = '<comment>' ]
Parameters
| Name | Required | Description |
|---|---|---|
name | required | Specifies the identifier of the maintenance policy. The identifier must be unique within the schema. |
SCHEDULE = 'USING CRON cron_spec timezone | required | Specifies the schedule for the maintenance policy. This parameter uses the same syntax as the SCHEDULE parameter of the CREATE TASK command. |
COMMENT = 'comment' | optional | Specifies an optional comment for the maintenance policy. |
Usage notes
- Each app or account can have only one maintenance policy.
- Regarding metadata: Attention Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes CREATE MAINTENANCE POLICY | Schema | Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.