How can I capture error thrown by SET_LOCKTIMEOUT in ola Hallengren
1
vote
1
answer
594
views
A stats only job for Ola Hallengren was blocked for the 180 seconds as specified below. The job threw an error and emailed me and the other DBA. However, upon review of the CommandLog table and the output file, there was no record of what the error was. I eventually figured out what had happened by looking at our monitoring tool, noticing the blocking for exactly the amount of time as the locketimout value and then looking at Ola's site to find that it throws a severity 16 error when the lock timeout is reached.
Is there a way to have the Ola scripts log the error so it's easier to figure out what went wrong?
EXECUTE [dbo].[IndexOptimize]
@Databases = 'USER_DATABASES' ,
@FragmentationLow = NULL ,
@FragmentationMedium = NULL ,
@FragmentationHigh = NULL ,
@UpdateStatistics = 'ALL' ,
@OnlyModifiedStatistics = N'Y' ,
@LockTimeout = 180,
@LogToTable = N'Y';
Asked by Lee M
(396 rep)
Jul 17, 2020, 07:09 PM
Last activity: Jun 17, 2025, 02:00 AM
Last activity: Jun 17, 2025, 02:00 AM