To obtain logs from the last 5 months that show jobs that have failed

qwerty

I am trying to get information regarding the failed jobs for the last 4-5 months as a log file or any type of data. The jobs are run on the (MS)SQL server and are sql jobs.

My friend told me that the log files generated by the server get deleted every time the server is rebooted.

Is there any way to obtain this information.

sepupic

No job history disappears when your server restarts, maybe you was told about SQL Server error log that initialize at every restart, but even previous error log does not disappear. In every case you can check your failed job this way:

select j.name,
       j.description,
       h.*
from msdb.dbo.sysjobs j join msdb.dbo.sysjobhistory h 
        on j.job_id = h.job_id 
where h.run_status = 0 -- failed
order by h.run_date;

You can check out how many history rows are preserved choosing SQL Server Agent Properties History tab.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Show last 3 months from selected month in Power BI

Hangfire failed jobs logs: how to sort them?

PowerShell getting logs from Jobs

Data from last 13 months

Show only the last X months of a plotted line

Spinner show months from database

Apache - Logs from the Last Hour

Get records from last 6 Months MySQL

Returning Records from last 6 Months with SELECT

Records from the last 2 years - complete months

obtain last word from a string in python

Obtain last non empty date from column

Failed to obtain a cell from its DataSource

Show total expense in each category for last SIX months in MYSQL

How to show only last 3 months in morris chart in laravel

How to have R create a data frame using the last two months

Get count and list of cutomers (ID) that have no sales in the last 2 months

Get list of users who have logged into Octopus in the last 6 months

How to get the 1st 6months i.e.(1-26weeks) and last 6months (26-52 weeks) from last year & also get last 5weeks from current date using postgresql

MS SQL - JOIN show months that doesn't have data

Jenkins multijob show failed when all sub jobs succeed

How to aggregate logs from several Jenkins Jobs\Pipelines in one place?

Return records for last 6 months if no date supplied or last 6 months from date supplied

Last 5 months records dynamically in Oracle without sysdate

How to get last 5 months of data of a Pandas DataFrame?

Get the Top 5 users in each month for the last three months Django

Have a way to just show the last item from my db, in a view with @foreach?

AppSync always responds with "Failed to Fetch" and logs don't show anything

How to obtain first 5 values from a LinkedHashSet?