0

Not a DBA so please bear with me.

I have an EC2 instance running SQL Server 2022 and I'm trying to automate database backups to S3 using the native S3 connector in this version of SQL Server. The underlying infrastructure is there - I have the buckets, the credentials, and the policies, and I've tested backups manually with basic 'BACKUP DATABASE' queries to the S3 endpoint. All of that works fine.

However, I'm not clear on how to properly automate this from within SQL Server. It looks like the 'Maintenance Plan' feature does not support S3 endpoints - I only see options for Azure when I select 'URL' as the destination. Should I not be using maintenance plans? Do I need to create SQL Server Agent jobs and manually enter T-SQL queries for the backup operations? If I do things this way, are there additional clean-up requirements I'd need to account for which would have otherwise been taken care of by a maintenance plan?

Rohit Gupta
  • 2,116
  • 8
  • 19
  • 25
noctred
  • 3
  • 1

1 Answers1

1

It looks like the 'Maintenance Plan' feature does not support S3 endpoints - I only see options for Azure when I select 'URL' as the destination.

I think Maintenance plan just build BACKUP to URL command so it should perform backup to S3. Anyway, it's worth to create tiny database and test it.

Should I not be using maintenance plans?

maintenance plans is not the best options. It's easy to create but if it breaks it's not easy to figure out what is wrong and how to fix it.

Do I need to create SQL Server Agent jobs and manually enter T-SQL queries for the backup operations?

Ola Hallengren already did it for you. https://ola.hallengren.com/sql-server-backup.html

Install this package and populate URL parameter with your S3 link. Feel free to run this stored procedure with Execute='N' to check SQL it generated.

SergeyA
  • 1,522
  • 1
  • 5
  • 9