Question

What is the best way to schedule DBCC check on all the nodes in Always On availability group. Can we just schedule the same job on all the nodes at the same time including all the secondaries. In my environment all the back ups are happening on the Primary Node only. Any expert advice will be highly appreciated. I intend to use the Ola hallengren scripts.

Was it helpful?

Solution

Checkdb should be run on both primary and secondary replicas. Normally for big databases and where you have busy system and you cannot afford to run checkdb on both replicas in one go specially on primary replica, people run checkdb on all the secondary replica and failover the primary to secondary making secondary new primary. Now you have new secondary on which you can run checkdb. This allows you to run checkdb on all the nodes without affecting primary workload.

When you run checkdb on secondary primary do gets affected because secondary has to create snapshot and run recovery on it so always run checkdb(even on secondary replica) when load on your complete AG is relatively very less or during downtime.

If you can run checkdb on all the replicas once in a week that would be best thing to do. There are options like physical_only which minimises the impact of checkdb but remember if you use this option the checkdb does not do complete consistency check

Must read:

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top