3

Can I run Ola Hallengren's CheckDB job on a Secondary Asynchronous Replica (DR) that is readable during business hours? Currently the Asynchronous Replica is not readable...

  • First question is if it is possible.
  • Secondly, is it safe?

I have a primary server that is Live and I am doing a CheckDB on a secondary server during business hours / off hours.

0
6

This method is not safe because it is almost meaningless. It is a quote of P. Randal who is author/architect of DBCC CHECKDB and SQL Server storage subsystem.

Any of the answers where DBCC CHECKDB is being run on a continually updating copy of a database (e.g. through a database mirror, SAN mirror, log-shipping or Availability Group secondary) are incorrect. This method tells you nothing about the state of the main database on the production system as two different I/O subsystems are involved. I’ve discussed this many times before so I won’t labor the point, but you either have to run the consistency checks on the production database, or on a restored backup of it, or you’re not testing the production database. Nothing else is good enough.

When you check mirrored database or secondary replica you don't check real state of original database because the replica reside on different storage subsystem and it is the result of applying log records which are transferred through network. For more explanation you can follow this link Importance of how you run consistency checks. Also he explain it in his video course and in the book by K. Delaney.

0
8

Can I run Ola Hallengren CheckDb job on a Secondary Asynchronous Replica (DR) that is readable during business hours?

Sure, assuming the routine doesn't try to update any command or history tables in that database (since it's read-only).

... and secondly if is safe as I have a primary server that is Live and I am doing a checkdb on a secondary during business hours/ off hours.

Much like sp_BlitzErik has stated, we can't tell you if it's "safe". This is going to depend on a host of factors such as disk space, redo queue size, send queue size on the primary, memory, current load, etc. Your best bet is to try it and see if you have no other metrics to go by - if people complain, you have your answer. If the website goes down, you have your answer. If no one says a word and everything goes well - you have your answer.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.