CREATE MAINTENANCE POLICY

statementsupportedGovernance (policies, tags, data quality)

docs.snowflake.com ↗

Object: MAINTENANCE POLICY

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

NameRequiredDescription
namerequiredSpecifies the identifier of the maintenance policy. The identifier must be unique within the schema.
SCHEDULE = 'USING CRON cron_spec timezonerequiredSpecifies the schedule for the maintenance policy. This parameter uses the same syntax as the SCHEDULE parameter of the CREATE TASK command.
COMMENT = 'comment'optionalSpecifies an optional comment for the maintenance policy.

Usage notes

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.

See also

Referenced by