aws-rds

compressing mssql backups

It’s possible to compress mssql backups in rds by turning compression on/off via rdsadmin commands;

exec rdsadmin..rds_set_configuration 'S3 backup compression', 'true'; 
exec rdsadmin..rds_set_configuration 'S3 backup compression', 'false'; 

Note that it’s possible to do this when the server instance is sqlexpress, however in that case when actually performing the backup it will fail due to sqlexpress not supporting compressed backups.

mssql native backup

Backup

exec msdb.dbo.rds_backup_database 
        @source_db_name='database_name', 
        @s3_arn_to_backup_to='arn:aws:s3:::bucket_name/file_name_and_extension',
        @overwrite_S3_backup_file=1,
        @type='differential';

Restore

exec msdb.dbo.rds_restore_database 
        @restore_db_name='database_name', 
        @s3_arn_to_restore_from='arn:aws:s3:::bucket_name/file_name_and_extension';

Status

exec msdb.dbo.rds_task_status @db_name='database_name';

Cancel

exec msdb.dbo.rds_cancel_task @task_id=1234;

More information

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html