r/DatabaseAdministators • u/No-Prune2771 • 5d ago
SQL Server Always On backup best practices
Hi everyone,
I have a SQL Server 2022 Always On Availability Group with two replicas (primary and secondary), accessed through a SQL Listener.
I want to configure weekly full, daily differential, and hourly transaction log backups using the Maintenance Plan Wizard.
My questions:
* Should I create the maintenance plans on both replicas or only the primary?
* How can I ensure backups continue automatically after a failover?
* Is using maintenance plans a good approach, or should I use custom SQL Agent jobs instead?
I'd appreciate any advice or production best practices. Thanks!
4
u/Key-Addition2906 5d ago edited 5d ago
I don’t know who’s using maintenance plans for backups these days, why not give a shot for ola hallen scripts for backups and index maintenance, easy to configure and it will detect the replicas and silently exits on replicas. We were creating maintenance plans manually in year 2015, hardest part is you have to create manually across all servers, upon moving on to Ola Hallen scripts, it’s just deploy the scripts.
1
u/nian2326076 3d ago
You should create maintenance plans only on the primary replica. SQL Server will automatically redirect backups to the new primary after a failover if you've set the backup preferences correctly in the Availability Group settings. While maintenance plans are convenient, custom SQL Agent jobs offer more flexibility and control, especially for complex requirements. Using scripts from Ola Hallengren can simplify your maintenance tasks. For job opportunities in database administration, you can use LandOffer to find relevant roles.