April 18, 2018 at 10:08 pm
Hello Experts,
I have a SQL instance where we have couple of large databases eg. DB1 - 1.2 TB , DB2 - 1.5 TB.
I have created maintenance plan to rebuild the indexes and update the statistics in sequential order. but it took 30+ Hrs to get completed.
As an experiment - I created manual rebuild script of all the indexes (Fragmentation >30) and divide into 3 part (approx equal size of all 3 parts according to index's size) and did same for update statistics (divide into 3 equal size according to table size).
Then I have executed index script into 3 query window and after completion of this start update statistics in same manner (in 3 query window).
This exercise took approx 16 Hrs to get completed and save my 14-15 hours. Now I want to automate this process. Can someone have an idea to automate it optimally by PowerShell etc.
I don't want to create multiple (More than 2) SQL Jobs for this.
April 19, 2018 at 9:19 am
Look at Ola Hallengren's maintenance scripts.:
https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html
April 19, 2018 at 2:31 pm
When you rebuild an index it updates statistics as well.
April 20, 2018 at 10:00 am
Ols Hallengren's script doesn't provide multi-threading solution.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply