az sql db ltr-policy
Manage SQL database long term retention policy.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az sql db ltr-policy set |
Update long term retention settings for a database. |
Core | GA |
| az sql db ltr-policy show |
Show the long term retention policy for a database. |
Core | GA |
az sql db ltr-policy set
Update long term retention settings for a database.
az sql db ltr-policy set [--ids]
[--make-backups-immutable --tb-immutability]
[--monthly-retention]
[--name]
[--resource-group]
[--server]
[--subscription]
[--tb-immutability-mode]
[--week-of-year]
[--weekly-retention]
[--yearly-retention]
[--yes]
Examples
Set long term retention for a database.
az sql db ltr-policy set -g mygroup -s myserver -n mydb --weekly-retention "P1W" --monthly-retention "P6M" --yearly-retention "P1Y" --week-of-year 26 --make-backups-immutable Enabled
Set long term retention for a database with time based immutability enabled and immutability mode locked.
az sql db ltr-policy set -g mygroup -s myserver -n mydb --weekly-retention "P0W" --monthly-retention "P0M" --yearly-retention "P0Y" --tb-immutability Enabled --tb-immutability-mode Locked
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Whether to enable time based immutability on the LTR backups. Possible values are: 'True', 'False', 'Enabled', 'Disabled'.
Retention for the monthly backup. If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.There is a minimum of 7 days and a maximum of 10 years.
Name of the Azure SQL Database.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
The mode of time based immutability to be set on the LTR backups. Possible values are: 'Locked', 'Unlocked'. This is only valid if make-backups-immutable is enabled.
The Week of Year, 1 to 52, in which to take the yearly LTR backup.
Retention for the weekly backup. If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.There is a minimum of 7 days and a maximum of 10 years.
Retention for the yearly backup. If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.There is a minimum of 7 days and a maximum of 10 years.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az sql db ltr-policy show
Show the long term retention policy for a database.
az sql db ltr-policy show [--ids]
[--name]
[--resource-group]
[--server]
[--subscription]
Examples
Show long term retention policy for a database.
az sql db ltr-policy show -g mygroup -s myserver -n mydb
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of the Azure SQL Database.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |