我想将 SQL Server RDS 备份/恢复到 S3 存储桶。RDS 和 S3 都在不同的帐户中。如何实施。我用来备份/恢复的查询是:
备份:
USE [msdb]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[rds_backup_database]
@source_db_name = 'your_database_name',
@S3_arn_to_backup_to = 'arn:aws:s3:::your-bucket-name/folder/db.bak',
@KMS_master_key_arn = NULL,
@overwrite_S3_backup_file = NULL
SELECT 'Return Value' = @return_value
GO
恢复
exec msdb.dbo.rds_restore_database
@restore_db_name='database_name',
@s3_arn_to_restore_from='arn:aws:s3:::bucket_name/folder/file_name_and_extension';