Sql-server – SQL Maintenance Rebuild Fails

maintenancesql server

I am pretty new to SQL and I have this maintenance job that keeps failing and I am not sure how to troubleshoot this. I have troubleshot other job failures with google help to success but this one is eluding me. Any help is appreciated. Here is the log…BTW..is there an easier way to read these logs, or does it just take time and experience?

Date        2/1/2015 4:00:00 AM
Log     Job History (SERVER MAINTENANCE.REBUILD)

Step ID     1
Server      SERVER
Job Name        SERVER MAINTENANCE.REBUILD
Step Name       REBUILD
Duration        04:01:38
Sql Severity        0
Sql Message ID      0
Operator Emailed        
Operator Net sent       
Operator Paged      
Retries Attempted       0

Progress: 2015-02-01 06:00:01.80 Source:
Rebuild Index Task Executing query "ALTER INDEX
[DTA_reports_indexcolumn_index2] ON [d…".: 40% complete End Pro…
The package execution fa… The step failed.

Best Answer

Firstly, make sure the account executing the job has sufficient privileges to run alter index. If that fails, then find the index "DTA_reports_indexcolumn_index2" and see if you can rebuild it yourself by hand. If that works, then you may have another process hitting this table at the same time the index maintenance is running. You'll have to look through what else is running around this time.

If rebuilding it by hand doesn't work, then explore what error you get, if you get one. You might have to drop and recreate the index. You might also run dbcc checkdb against the database to ensure that there's no corruption and run dbcc checktable against said table to ensure it's not corrupted.