Skip to content

Latest commit

 

History

History
81 lines (59 loc) · 2.74 KB

managed-backup-sp-backup-master-switch-transact-sql.md

File metadata and controls

81 lines (59 loc) · 2.74 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
managed_backup.sp_backup_master_switch (Transact-SQL)
Pauses or resumes the SQL Server Managed Backup to Microsoft Azure.
markingmyname
maghan
randolphwest
08/21/2024
sql
system-objects
reference
sp_ backup_master_switch
smart_admin.sp_backup_master_switch
sp_ backup_master_switch_TSQL
smart_admin.sp_backup_master_switch_TSQL
sp_ backup_master_switch
smart_admin.sp_backup_master_switch
TSQL

managed_backup.sp_backup_master_switch (Transact-SQL)

[!INCLUDE sqlserver2016]

Pauses or resumes the [!INCLUDE ss-managed-backup].

Use managed_backup.sp_backup_master_switch to temporarily pause and then resume [!INCLUDE ss-managed-backup]. This procedure makes sure that all the configurations settings remain, and are retained when the operations resume. When [!INCLUDE ss-managed-backup] is paused the retention period isn't enforced.

In other words, there's no check to determine:

  • whether files should be deleted from storage
  • if there are corrupted backup files
  • if there's a break in the log chain.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

EXEC managed_backup.sp_backup_master_switch [ @new_state = ] { 0 | 1 }
[ ; ]

Arguments

[ @new_state = ] { 0 | 1 }

Set the state of [!INCLUDE ss-managed-backup]. @new_state is bit. When set to a value of 0, the operations are paused, and when set to a value of 1, the operation resume.

Return code values

0 (success) or 1 (failure).

Permissions

Requires membership in db_backupoperator database role, with ALTER ANY CREDENTIAL permissions, and EXECUTE permissions on sp_delete_backuphistory stored procedure.

Examples

The following example can be used to pause [!INCLUDE ss-managed-backup] on the instance it's executed on:

USE msdb;
GO
EXEC managed_backup.sp_backup_master_switch @new_state = 0;
Go

The following example can be used to resume [!INCLUDE ss-managed-backup].

USE msdb;
GO
EXEC managed_backup.sp_backup_master_switch @new_state = 1;
Go

Related content