You soon realize the AWS platform provides some of the maintenance work that we used to do as DBA's. But you would find there are situation where you require some level of control. In late 2016 AWS provided the functionality for SQL server to perform native backups of its RDS instances extending its snapshot functionality.
Solution will attempt to extend what Jeff bar has blogged by providing few extra screen shots and some additional steps.
Steps to follow
1.) Enable the SQL native backups by adding the SQL_Server_Backup_Restore option group
2.) Associate the option group created in step 1 to the RDS instance
Once you have created the option group, it is mandatory that you associate the newly created option group to the RDS instance that you intend to run the SQL native backup. Failing to which you would find bellow error message at the time of executing the backup command
Msg 50000, Level 16, State 0, Procedure rds_backup_database, Line 74 [Batch Start Line 2]
Database backup/restore option is not enabled or is in the process of being enabled. Please try again later.
USAGE:
EXECUTE msdb.dbo.rds_backup_database @source_db_name, @S3_arn_to_backup_to, [@KMS_master_key_arn], [@overwrite_S3_backup_file]
modify the RDS instance and add change the option group and remember to click on apply immediate.
I would suggest not to do this during business hours, instead perform this action during a maintenance window as it appears to reconfigure the RDS instance. That said this does not take too long to apply and didn't seem to take the instance offline. But i am not entirely sure if that true.
I would suggest not to do this during business hours, instead perform this action during a maintenance window as it appears to reconfigure the RDS instance. That said this does not take too long to apply and didn't seem to take the instance offline. But i am not entirely sure if that true.
3.) Create the backup using the RDS function rds_backup_database function and monitor the progress of the backup with RDS_Task_Status
EXEC msdb.dbo.rds_backup_database@source_db_name = 'DBname',@s3_arn_to_backup_to = 'arn:aws:s3:::S3Bucket-dbsql/sqldata/Full/DBname_full2.bak' ,@overwrite_S3_backup_file = 1;
Test the progress
exec msdb.dbo.rds_task_status @db_name='octopusDeploy'
exec msdb.dbo.rds_task_status @db_name='octopusDeploy'
It is essential to take backup of data. Your blog help me to understand how to take AWS RDS SQL server backup. Thanks for sharing all steps and snapshots.
ReplyDelete