locked
Cannot view Job History of a particular job RRS feed

  • Question

  • Trying to look at the job history, but error as

    Timeout expired. The timeout period elapsed prior to completion of the operation or the server not responding. How do I fix this issue 

    Monday, October 21, 2019 9:46 PM

Answers

  • Hi Amelia,

    10067063 history entries purged.---30 days

    309915 history entries purged.----20 days

    156365 history entries purged.----15 days

    after executing the script login to SSMS as sa

    declare

    @dateLimit datetime=dateadd(dd,-15,current_timestamp)

    exec

    msdb.dbo.sp_purge_jobhistory@oldest_date =@dateLimit

    go

    but still could not run one of the job--view history got the timeout error.

    After creating the job purge job history the job ran successfully.

    But could not successfully run the tsql script, do I have to restart the services to clear the Timeout error?

    DECLARE @OldestDate datetime
    SET @OldestDate = GETDATE()-15
    EXEC msdb.dbo.sp_purge_jobhistory @oldest_date=@OldestDate@


    • Edited by Avyayah Tuesday, October 22, 2019 3:58 PM
    • Marked as answer by Avyayah Wednesday, October 23, 2019 3:11 PM
    Tuesday, October 22, 2019 3:56 PM

All replies

  • Hi Avyayah,

    >>Timeout expired. The timeout period elapsed prior to completion of the operation or the server not responding.

    This issue generally occurs when you have no limit set and therefore the history builds up to the extent that SQL Server doesn’t return it before the Agent Job History window times out the connection.

    You could try to gradually reduce your job history, then enforce a limit.

    For more details, please refer to this blog and Managing SQL Server Agent Job History Log.

    Hope this could help you.

    Best Regards,

    Amelia Gu



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 22, 2019 2:53 AM
  • Hi Amelia,

    10067063 history entries purged.---30 days

    309915 history entries purged.----20 days

    156365 history entries purged.----15 days

    after executing the script login to SSMS as sa

    declare

    @dateLimit datetime=dateadd(dd,-15,current_timestamp)

    exec

    msdb.dbo.sp_purge_jobhistory@oldest_date =@dateLimit

    go

    but still could not run one of the job--view history got the timeout error.

    After creating the job purge job history the job ran successfully.

    But could not successfully run the tsql script, do I have to restart the services to clear the Timeout error?

    DECLARE @OldestDate datetime
    SET @OldestDate = GETDATE()-15
    EXEC msdb.dbo.sp_purge_jobhistory @oldest_date=@OldestDate@


    • Edited by Avyayah Tuesday, October 22, 2019 3:58 PM
    • Marked as answer by Avyayah Wednesday, October 23, 2019 3:11 PM
    Tuesday, October 22, 2019 3:56 PM