I am new to SQL Server Administration.
I have created the Daily Maintenance plan as below and the Rebuild Index task fails once in a week.
Backup Database Task - All Databases --> Maintenance Cleanup Task - Older than 1 weeks --> Check Database Integrity Task - Include Indexes --> Shrink Database Task - All Databases --> Rebuild Index Task - Object Tables and Views --> Update Statistics Full Scan
Now once or twice in a week the Rebuild Index Task is fails as below
Failed:(-1073548784) Executing the query "ALTER INDEX [PK_TestSet_Now] ON [dbo].[TestSet_Now] REBUILD WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
" failed with the following error: "Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Kindly do let help me on this to get it resolved.