SQL Server backup mirror to URL
SQL Server backup to URL for S3-compatible object storage Learn about the concepts, requirements, and components necessary for SQL Server to use the S3-compatible object storage as a backup destination. WilliamDAssafMSFT wiassaf 10/15/2022 sql backup-restore conceptual event-tier1-build-2022 >=sql-server-ver16||>=sql-server-linux-ver16 [!INCLUDE SQL Server 2022] This article introduces the concepts, requirements and components necessary to use S3-compatible
object storage as a backup destination. The backup and restore functionality is conceptually similar to working with SQL Server backup to URL for Azure Blob Storage as a backup device type. For information on supported platforms, see
providers of S3-compatible object storage.
Overview[!INCLUDEsssql22-md] introduces object storage integration to the data platform, enabling you to integrate SQL Server with S3-compatible object storage in addition to Azure Storage. To provide this integration SQL Server has been enhanced with a new S3 connector, which uses the S3 REST API to connect to any provider of S3-compatible object storage. [!INCLUDEsssql22-md] extends the existing BACKUP/RESTORE TO/FROM URL syntax by adding support for the new S3 connector using the REST API. URLs pointing to S3-compatible resources are prefixed with Part numbers and file size limitationsTo store data, the S3-compatible object storage provider must split files in multiple blocks called parts. This is similar to block blobs in Azure Blob Storage. Each file can be split up to 10,000 parts, each part size will range from 5 MB to 20 MB, this range is controlled by the T-SQL BACKUP command through the parameter MAXTRANSFERSIZE. The default value of The maximum supported size of a
single file is the result of 10,000 parts *
Prerequisites for the S3 endpointThe S3 endpoint must have been configured as follows:
SecurityBackup PermissionsTo connect SQL Server to S3-compatible object storage, two sets of permissions need to be established, one on SQL Server and also on the storage layer. On SQL Server the user account that is used to issue BACKUP or RESTORE commands should be in the db_backupoperator database role with Alter any credential permissions. On the storage layer, the user ( Restore PermissionsIf the database being restored does not exist, the user must have RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE is executed, members of the On the storage layer, the user ( Supported featuresHigh-level overview of the supported features for
Supported arguments for backup
Supported arguments for restore
RegionYour S3-compatible object storage provider can offer the ability to determine a specific region for the bucket location. The use of this optional parameter can provide more flexibility by specifying which region that particular bucket belongs to. This parameter requires the use of If no value is declared us-east-1 will be assigned as default. Backup example: WITH BACKUP_OPTION = '{"s3": {"region":"us-west-1"}}' Restore example: WITH RESTORE_OPTION = '{"s3": {"region":"us-west-1"}}' Linux supportSQL Server uses
SQL Server will read the certificates from the folder during startup and add them to the trust store. Only
super user should be able to write in the folder, while the Unsupported features
LimitationsThe following are the current limitations of backup and restore with S3-compatible object storage:
Path style and virtual host styleBackup to S3 supports the URL to be written in both path style or virtual host style. Path style example: Virtual host example: ExamplesCreate credential
The following examples create SQL Server credentials for authentication with the object storage endpoint: CREATE CREDENTIAL [s3://<endpoint>:<port>/<bucket>] WITH IDENTITY = 'S3 Access Key', SECRET = ' Backup to URLThe following example performs a full database backup to the object storage endpoint, striped across multiple files: BACKUP DATABASE <db_name> TO URL = 's3:// Restore from URLThe following example performs a database restore from the object storage endpoint location: RESTORE DATABASE <db_name> FROM URL = 's3:// Options for encryption and compressionThe following example shows how to back up and restore the CREATE MASTER KEY ENCRYPTION BY PASSWORD = <password>; GO CREATE CERTIFICATE AdventureWorks2019Cert WITH SUBJECT = 'AdventureWorks2019 Backup Certificate'; GO -- Backup database BACKUP DATABASE AdventureWorks2019 TO URL = 's3:// Use region for backup and restoreThe following example shows how to back up and restore the AdventureWorks2019 database using -- Backup Database BACKUP DATABASE AdventureWorks2019 TO URL = 's3:// Next steps
Can you backup a mirrored database?Yes, it's possible. In fact it's no less important to perform backups the same as if mirroring weren't enabled since the database is in the FULL recovery model.
Which backup media is also known as backup to URL?SQL SERVER – Backup to URL – Script to Generate the Create Credential and Backup Command using Access Keys. Backup to URL is one of the common methods used in SQL Server perform backup to Azure Blob Storage.
What is mirror backup in SQL Server?Using MIRRORED Backup feature a DBA can create up to 3 identical copies of a database backup. This feature is available in SQL Server 2005 Enterprise Edition and later versions.
Can SQL backup to network drive?To back up to a network drive when SQL Server is running in a domain user account, the shared drive must be mapped as a network drive in the session where SQL Server is running. If you start Sqlservr.exe from command line, SQL Server sees any network drives you have mapped in your login session.
|