managed_backup.sp_backup_master_switch (Transact-SQL)

Applies to: SQL Server 2016 (13.x) and later versions

Pauses or resumes the SQL Server Managed Backup to Microsoft Azure.

Use this stored procedure to temporarily pause and them resume SQL Server Managed Backup to Microsoft Azure. This makes sure that all the configurations settings remain and is retained when the operations resume. When SQL Server Managed Backup to Microsoft Azure is paused the retention period is not enforced. This means that there is no check to determine whether files should be deleted from storage or if there are backup file corrupted, or break in log chain.

Transact-SQL syntax conventions

Syntax

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

Arguments

@state
Set the state of SQL Server Managed Backup to Microsoft Azure. The @state parameter 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 Value

0 (success) or 1 (failure)

Security

Describes security issues related to the statement.Include Permissions as a subsection (H3 heading). Consider including other subsections for Ownership Chaining and Auditing if appropriate.

Permissions

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

Examples

The following example can be used to pause SQL Server Managed Backup to Microsoft Azure on the instance it is executed on:

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

The following example can be used to resume SQL Server Managed Backup to Microsoft Azure.

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

See Also

SQL Server Managed Backup to Microsoft Azure