Reindex or ReOrg

  • Thanks, I checked and all indexes with high fragmentation had less than 100 pages and the big ones were all fixed.

  • Just want to confirm that the job I have setup is done the right way for error logging because you had something in your document about this and I am not sure if it is default "The stored procedures have to be executed in a CmdExec job step with sqlcmd and the -b parameter".

    I created a new sql agent job and added a new step with type T-SQL and in the command window pasted this for my user database:

    EXECUTE dbo.IndexOptimize

    @databases = 'USER_DATABASES',

    @FragmentationHigh_LOB = 'INDEX_REBUILD_OFFLINE',

    @FragmentationHigh_NonLOB = 'INDEX_REBUILD_OFFLINE',

    @FragmentationMedium_LOB = 'INDEX_REORGANIZE',

    @FragmentationMedium_NonLOB = 'INDEX_REORGANIZE',

    @FragmentationLow_LOB = 'NOTHING',

    @FragmentationLow_NonLOB = 'NOTHING',

    @FragmentationLevel1 = 5,

    @FragmentationLevel2 = 30,

    @PageCountLevel = 1000

    Do I have to change anything here?

  • The stored procedure has been designed to continue to the next index if the rebuild or reorganize of an index would fail. I have some information about this under Error Scenarios in the documentation.

    http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

    "An index command fails."

    "The procedure logs the error and continues to the next index. In the end the job reports failure."

    The problem is that this does not work in a T-SQL job step. Therefore I recommend that you run it in a CmdExec job step with sqlcmd and the -b parameter.

    I have some demo jobs on my blog. Please have a look at them.

    http://ola.hallengren.com/scripts/MaintenanceSolution.sql

    Ola Hallengren

    http://ola.hallengren.com

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply