October 26, 2014 at 9:04 am
Hello,
I tried to find online the script I need but unable to do so. I even looked Ola Hallengren's scripts but so complicated to make my own.
Please some one post the script here, I would be grateful.
Requirements: (this is on A database with all tables)
1. Organize <30% fragmented
2. Rebuild > 30% fragmented
3. pages > 3000
4. Sort on TempDB 'Yes'
5. Rebuild index Online = 'yes'
Thank you.
October 26, 2014 at 6:04 pm
dinsab11 (10/26/2014)
Hello,I tried to find online the script I need but unable to do so. I even looked Ola Hallengren's scripts but so complicated to make my own.
Please some one post the script here, I would be grateful.
Requirements: (this is on A database with all tables)
1. Organize <30% fragmented
2. Rebuild > 30% fragmented
3. pages > 3000
4. Sort on TempDB 'Yes'
5. Rebuild index Online = 'yes'
Thank you.
Have you looked up any information on sys.dm_db_index_physical_stats so that you actually know what it is that you're using? Have you looked at Ola's code to see what you could pull out of it? If you want to make your own, why are you asking for someone to post a script?
Google sys.dm_db_index_physical_stats and look at example "D".
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2014 at 3:04 am
dinsab11 (10/26/2014)
I even looked Ola Hallengren's scripts but so complicated to make my own.Please some one post the script here, I would be grateful.
Requirements: (this is on A database with all tables)
1. Organize <30% fragmented
2. Rebuild > 30% fragmented
3. pages > 3000
4. Sort on TempDB 'Yes'
5. Rebuild index Online = 'yes'
If Ola's script looks too complicated to you, I suggest that you don't even venture creating your own.
To fulfill your requirements you just need to call Ola's script with these parameters:
EXEC IndexOptimize
@databases = 'ALL_DATABASES',
@PageCountLevel = 3000,
@SortInTempdb = 'Y'
The rest is provided by the default values for the parameters.
Hope this helps
-- Gianluca Sartori
October 27, 2014 at 8:07 am
Thank you guys.
October 27, 2014 at 8:38 am
spaghettidba (10/27/2014)
dinsab11 (10/26/2014)
I even looked Ola Hallengren's scripts but so complicated to make my own.Please some one post the script here, I would be grateful.
Requirements: (this is on A database with all tables)
1. Organize <30% fragmented
2. Rebuild > 30% fragmented
3. pages > 3000
4. Sort on TempDB 'Yes'
5. Rebuild index Online = 'yes'
If Ola's script looks too complicated to you, I suggest that you don't even venture creating your own.
To fulfill your requirements you just need to call Ola's script with these parameters:
EXEC IndexOptimize
@databases = 'ALL_DATABASES',
@PageCountLevel = 3000,
@SortInTempdb = 'Y'
The rest is provided by the default values for the parameters.
Hope this helps
The reason why I suggest that everyone learn how to write their own is so that they have a better understanding of the system as a DBA. It's kind of like a Jedi Knight making his own light saber. 😉 If all one knows how to do as a DBA is use canned scripts, then you stand a strong chance of getting canned. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2014 at 9:17 am
Good point, Jeff.
However, building a sophisticated script like Ola's is not something I would recommend to a novice. I would start from something easier.
-- Gianluca Sartori
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply