sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

Require Parallel index maintenance option to be performed on a single database

Open ghost opened this issue 9 months ago • 1 comments

Dear Team,

I am using Ola Hallengreen Index maintenance scripts and are very useful and helping us to reduce major burden on the maintenance plan and managing them.

We have a below requirement and checking if it is available in the existing index maintenance scripts.

There is a sql server with single large database. We will have limited time and would like to schedule index maintenance in parallel through 2-4 jobs so that all jobs runs in parallel on the database and complete it faster.

I tried with Databases in Parallel and mentioning the database name in all 4 jobs and executed them all at once. Out of 4 only 1 job is executing and other 3 jobs are completing in a second. Below are the parameters used.

@Databases='db1' @FragmentationHigh='INDEX_REBUILD_OFFLINE' @fragmentationlevel2=30 @MAXDOP='0' @FillFactor='90' @UPDATETSTAISTICS='ALL' @StatisticsSample=100 @DatabasesInParallel='Y' @LogtoTable='Y' @Execute='Y'

Kindly let us know if I am missing anything here.

Thanks & Regards Hemanth Kumar Reddy

ghost avatar Mar 17 '25 17:03 ghost

If you specify only one database in the @databases list then it is not possible to run more than one database in parallel even if you specify @DatabasesInParallel='Y' and create several jobs. For Parallelism in OH you need to specify several databases (or Alias like USER_DATABASES) in the @databases If you want to "defragment" the indexes of only one database 'db1' in parallel, as far as I know, it is not currently possible using OH Maintenance solution.

rferraton avatar Mar 26 '25 11:03 rferraton