For a job which runs every 15 minutes, I see only the last 30 entries.
I look into SSMS, and I also tried:
select * from msdb.dbo.sysjobhistory;
I don't see a rule here. Some jobs are tracked for one month, others are tracked for 12 hours only.
Anyway, can the job history be extended so that I can see all jobs for e.g. one full month back?
In the SSMS right click the SQL Server Agent and select the Properties,
in the History tab you manage the manage retention of the job history logs
Also you can see the this tip for more details
Related
I am trying to figure out the issue.
we have a couple of sql job agents that runs less than 15 seconds everyday to execute store procedures.
Whenever I tried to see the job history, there is no information about it and it shows "never executed"
I did a simple test and tried to let it run say more than 60 seconds. I see it appears on the job history.
Is there any settings that I need to set so that I could see the jobs in job history that runs less than 15 seconds.
Thanks.
I am facing a strange issue with SQL Server 2012(Standard) Full backup job for the last 2 days.
Our database size is 1.3 TB and we are taking backups on a daily bases for all databases. From last 2 days without any error backups not happening. But I got job email alert with success in 13 sec.
I have checked on SQL server Full backup is running for last 10 hours.
Please suggest me for further.
I have searched in the error log and event viewer but I haven't found any error related to this backup job. And also I haven't found anything from job history as well it was showing last success history.
I have two SQL Agent Jobs.
One fires weekly, one is supposed to fire monthly.
The both contain a series of select statements for the same database and tables. I then email the results out. Both jobs also contact a series of insert/update statements to update the same 2 tables.
The queries for both jobs work when run directly from management studio. The email is sent, and the tables are updated.
The problem is when I run the monthly query as a job, the weekly job works as expected. I noticed yesterday, my monthly job didn't send the email it was supposed to. Upon further investigation, it did run the update statements, but the email itself failed.
The error in the log states
"Executed as user :dbo. The EXECUTE permission was denied on the
object 'sp_se
Upon investigation, I do see this as being a relatively common error, and I see the fixes people are doing. That being said, I am curious why these two jobs would have different results given its the same database, same tables, having similar queries, and looking in the job they both are being run as the same user.
Any suggestions on what to look for would be welcome.
On the advanced tab of the step, it had DBO in it, I removed it and the job ran
I have inherited a poorly documnted CRM 2011 instance, lets call it 'haystack', that has literally 100s of batch processes and workflows running on it under the same user account (IT_Job). One of them, lets call it 'needle', has a problem.
I know 'needle' ran at noon. But the Advanced find only allows me to query the scheduled jobs down to the day they ran NOT the time they ran.
How do I find out which Batch Process or Workflow last updated an entity (incident). All I seem to be able to query the scheduled jobs by is IT_Job.
It seems to me that the only way to find the 'needle' job would be to systematically add a corresponding User for each job that acts on 'incident' to then search for job running as the user that last modified the record.
So how do I find 'needle' quickly?
EDIT
Ok it turns out the site I am working for won't allow me access to the database or allow me to deploy a console app. (One could argue that they're not interested in a solution to this problem) So is there any other way to query this data?
If you have access to the SQL server then you can query the table dbo.WorkflowLogBase. This will help you narrow down which workflows had run at that exact time.
You might also be able to add some extra information by looking at the audit history for the record that has been changed assuming that auditing is turned on.
I need your suggestion on tracing the issue.
We are running data load jobs at early morning and loading the data from Excel file into SQL Server 2005 db. When job runs on production server, many times it takes 2 to 3 hours to complete the tasks. We could drill down to one job step which is taking 99% of the total time to finish.
While running the job step (stored procs) on staging environment (with the same production database restored) takes 9 to 10 minutes, the same takes hours on production server when it run at early morning as part of job. The production server always stuck up at the very job step.
I would like to run trace on the very job step (around 10 stored procs run for each user in while loop within the job step) and collect the info to figure out the issue.
What are the ways available in SQL Server 2005 to achieve the same? I want to run the trace only for these SPs and not for certain period time period on production server, as trace give lots of information and it becomes very difficult for me (as not being DBA) to analyze that much of trace information and figure out the issue. So I want to collect info about specific SPs only.
Let me know what you suggest.
Appreciate your time and help.
Thanks.
Use SQL Profiler. It allows you to trace plenty of events, including stored procedures, and even apply filters to the trace.
Create a new trace
Select just stored procedures (RPC:Completed)
Check "TextData" for columns to read
Click the "Column Filters" button
Select "TextData" from the left hand nav
Expand the "Like" tree view, and type in your procedure name
Check "Exclude Rows that Do Not Contain Values"
Click "OK", then "Run"
What else is happening on the server at that time is important when it is faster on other servers but not prod. Maybe you are running into the daily backup or maintenance of statistics or indexes jobs?