What you will be able to do
- Create, alter, and apply a maintenance policy at the account or app level with the required privileges
- Describe the limits of a maintenance policy: start time only, and one policy per app or account
- Predict when an upgrade runs, given the provider's UPGRADE_IN_MAINTENANCE_WINDOW and UPGRADE_DEADLINE settings
1.What a maintenance policy controls
Automatic upgrades usually begin as soon as the provider sets a new release directive. A consumer-controlled maintenance policy changes this. It lets the consumer keep upgrades out of specific time periods: if a policy is set, the upgrade is delayed until the start date and time the policy defines. Without a policy, the upgrade begins when the default upgrade time is reached.
A policy schedule only says when upgrades may begin. You cannot set an end time or a duration. Each app or account can have only one maintenance policy. In practice, the schedule is a recurring start time, such as Saturdays at 02:00 UTC, when upgrades are allowed to begin.
A policy controls the timing of an upgrade, not whether it happens. Snowflake automatically upgrades Native Apps when a provider releases a new version or patch. During an upgrade the app's code is replaced, while data inside the APPLICATION boundary is preserved. The maintenance policy only changes when that automatic upgrade is allowed to start.
Checkpoint 1 of 4· Check yourself
A consumer wants upgrades to happen only between 01:00 and 04:00 on Sundays. What can a maintenance policy express?
A maintenance policy defines only when upgrades may start. Its end and duration cannot be set, and an app can have only one policy.
“Only the start time for a maintenance policy can be specified; not the end time or the duration of the maintenance policy.”Source: docs.snowflake.com
Sources1
2.Creating, applying, and changing a policy
A maintenance policy is a schema-level object. You create it with CREATE MAINTENANCE POLICY. Its SCHEDULE uses the same 'USING CRON <cron_spec> <timezone>' syntax as the SCHEDULE parameter of CREATE TASK. The policy name must be unique within its schema, and COMMENT is an optional description.
CREATE MAINTENANCE POLICY my_maintenance_policy
SCHEDULE = 'USING CRON 0 2 * * SAT UTC'
COMMENT = 'Weekly Saturday maintenance policy';Creating a policy has no effect until you apply it. ALTER ACCOUNT applies it to every app in the account, and ALTER APPLICATION applies it to one app. The same two commands also remove a policy, so the scope of a policy is always set by which of the two commands you run.
ALTER ACCOUNT SET MAINTENANCE POLICY my_maintenance_policy FOR ALL APPLICATIONS;
ALTER APPLICATION my_app SET MAINTENANCE POLICY my_maintenance_policy;| Privilege | Object | Needed to |
|---|---|---|
| CREATE MAINTENANCE POLICY | Schema | Create a new maintenance policy |
| APPLY MAINTENANCE POLICY | Account | Apply a policy to an account or app |
| APPLY or OWNERSHIP | Maintenance policy | Apply or view the policy; also required for ALTER MAINTENANCE POLICY |
To change the schedule later, use ALTER MAINTENANCE POLICY ... SET SCHEDULE. The same command can also SET or UNSET COMMENT, or RENAME TO a new name. SHOW MAINTENANCE POLICIES lists the policies for an account or app. DESCRIBE MAINTENANCE POLICY shows the details of one policy. DROP MAINTENANCE POLICY removes a policy from its schema.
ALTER MAINTENANCE POLICY my_maintenance_policy SET
SCHEDULE = 'USING CRON 0 3 * * SUN UTC';Checkpoint 2 of 4· Fill the gap
Which parameter completes this policy definition?
CREATE MAINTENANCE POLICY my_maintenance_policy
? = 'USING CRON 0 2 * * SAT UTC'
COMMENT = 'Weekly Saturday maintenance policy';SCHEDULE takes a CRON expression and a time zone, with the same syntax as the SCHEDULE parameter of CREATE TASK.
Source: docs.snowflake.com3.Provider opt-in and the upgrade deadline
The provider decides whether a consumer's policy applies to a given release. In the release directive, the provider sets UPGRADE_IN_MAINTENANCE_WINDOW = TRUE. When that parameter is TRUE, UPGRADE_DEADLINE is required. The deadline is the latest time the upgrade can wait, and after it passes the upgrade runs whatever the consumer's policy says. Because of the deadline, a consumer cannot postpone an upgrade indefinitely. The two timing controls cannot be combined: a release directive cannot set both UPGRADE_AFTER and UPGRADE_IN_MAINTENANCE_WINDOW.
ALTER APPLICATION PACKAGE my_app_package
MODIFY RELEASE CHANNEL DEFAULT
SET DEFAULT RELEASE DIRECTIVE
VERSION = v1_0
PATCH = 2
UPGRADE_IN_MAINTENANCE_WINDOW = TRUE
UPGRADE_DEADLINE = '2026-2-10T10:00:00Z';| Consumer situation | Upgrade runs |
|---|---|
| Maintenance policy set | At the next maintenance window or at UPGRADE_DEADLINE, whichever comes first |
| No maintenance policy | During the default system maintenance window |
| App uses Snowpark Container Services and AUTOMATIC_APPLICATION_MAINTENANCE = TRUE | App code upgrades first, then compute pool node maintenance, in the same window |
For consumers, the practical advice is to schedule upgrades soon after a release arrives, at a time when someone is available to test and adjust. If the upgrade is left to run at the deadline, the app may become unavailable at a moment you did not plan for.
For apps that use Snowpark Container Services, the provider can also set AUTOMATIC_APPLICATION_MAINTENANCE = TRUE on the application package. Without it, application upgrades and compute pool node maintenance are separate concerns that can happen at different times. With it, both are coordinated into the consumer's chosen window, and the application upgrades first.
Checkpoint 3 of 4· Check yourself
A consumer's policy allows upgrades only on the first Saturday of each quarter. The provider releases with UPGRADE_IN_MAINTENANCE_WINDOW = TRUE and an UPGRADE_DEADLINE two weeks away. The next window is six weeks away. When does the upgrade run?
The upgrade waits for the next window or the deadline, whichever comes first. Here the deadline comes first.
“the upgrade is delayed until the next maintenance window defined by the consumer’s policy, or until the upgrade deadline is reached, whichever comes first.”Source: docs.snowflake.com
Checkpoint 4 of 4· Exam question
Which SQL command does a consumer use to manually trigger an app upgrade before the provider's automatic upgrade process begins for that instance?
Correct answer: A — ALTER APPLICATION app_name UPGRADE
- A. This is the consumer-side command that immediately upgrades an installed application object to the version and patch currently specified in the release directive, as long as an automatic upgrade has not already started for that instance.
- B. This targets the application package, which is a provider-side object; consumers do not own or alter application packages, so this is not a valid consumer upgrade action.
- C. CREATE APPLICATION installs a new application object from a listing; it does not upgrade an existing installed instance.
- D. Setting a release directive is a provider action performed on the application package to control which version consumers receive; it is not how a consumer manually upgrades their own instance.
Sources3
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Once a consumer applies a maintenance policy, every upgrade from every provider automatically waits for that window.Why is that wrong?
A policy only applies when the provider releases with UPGRADE_IN_MAINTENANCE_WINDOW = TRUE. The provider has to opt in explicitly.
Covered in Provider opt-in and the upgrade deadline
2.A sparse maintenance schedule lets a consumer delay an upgrade for as long as they want.Why is that wrong?
The provider's UPGRADE_DEADLINE caps the delay. After the deadline, the upgrade proceeds no matter what the consumer's policy says.
Covered in Provider opt-in and the upgrade deadline
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.snowflake.com/en/developer-guide/native-apps/consumer-maintenance-policiesOfficial docs
“the upgrade is delayed until the start date and time specified in the maintenance policy.”
↩︎ What a maintenance policy controls“Each app or account can only have one maintenance policy set.”
↩︎ What a maintenance policy controls“Required to apply a maintenance policy to an account or app.”
↩︎ Creating, applying, and changing a policy“Only the start time for a maintenance policy can be specified; not the end time or the duration of the maintenance policy.”
↩︎ Checkpoint - 2.
“This parameter uses the same syntax as the SCHEDULE parameter of the CREATE TASK command.”
↩︎ Creating, applying, and changing a policy - 3.https://docs.snowflake.com/en/developer-guide/native-apps/consumer-maintenance-policies-providerOfficial docs
“You can’t set the UPGRADE_AFTER and UPGRADE_IN_MAINTENANCE_WINDOW parameters at the same time.”
↩︎ Provider opt-in and the upgrade deadline“If the consumer has not set a maintenance policy, the upgrade happens during the default system maintenance window.”
↩︎ Provider opt-in and the upgrade deadline“After this deadline, the upgrade proceeds regardless of the consumer’s maintenance policy.”
↩︎ Exam trap 2“the upgrade is delayed until the next maintenance window defined by the consumer’s policy, or until the upgrade deadline is reached, whichever comes first.”
↩︎ Checkpoint
Also cited
“Note that the application provider must explicitly opt in to this feature to honor consumer maintenance schedules when releasing new upgrades.”
↩︎ Exam trap 1