Index Fragmentation in MSDB System Table – How to Manage with Ola Hallengren

indexola-hallengren

I have a Index Maintenance job for msdb database to rebuild those fragmented index in msdb database.

But I still found some backup related table in msdb database (e.g. backupmediafamily, backupset, backupfile) has high fragmantation.

After further checked found out it was skipped by the Ola Index maintenance command.

My question is how I can make ola defragment the index rather than I write another set of index maintenance just for msdb ?

Best Answer

The root cause is those tables in msdb (e.g. backupmediafamily, backupset, backupfile) are MS Shipped Object. by default, Ola skip those MS Shipped object for rebuild/reorganize.

MS Shipped Object means the objects that are created by internal SQL Server components.

Solution: Add 1 more parameter @MSShippedObjects = 'Y' to enable the Ola command to get those MS Shipped Object to defragment.