HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Ola Hallengren Index maintenance on servers with Availability Groups

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
groupsserverswithhallengrenmaintenanceavailabilityindexola

Problem

I'm configuring the Ola Hallengren scripts for Index maintenance on all servers in may Availability Group cluster which has several AG's and databases which are not in AG's.

If I select the "ALL_DATABASES" option, is the script intelligent enough to exclude the read only secondary replicas?

Solution

Yes, the script is intelligent enough.

This is explicitly stated in the FAQ:


How should I configure IndexOptimize for an Availability Group?


Indexes can only be rebuilt or reorganized and statistics only updated
on the primary replica in an availability group. IndexOptimize has a
check for this.


The jobs should be configured identically and be enabled and scheduled
on all the replicas.

Context

StackExchange Database Administrators Q#188085, answer score: 11

Revisions (0)

No revisions yet.