There is job on our SQL Server. It was started and stopped after some time. However, the job still appears to be running even if it is not.
I can see it "is running" in Job Activity Monitor and also sysjobactivity (= there is no stop_execution_date field filled, but in fact nothing happens. I do not see it running in Activity Monitor.
How to effectively kill the job without need to restart whole server? Stopping the job via SSMS GUI does not work.
Related
I've not seen this scenario in all my web searches.
We have several SQL Server Agent jobs that get kicked off by users through various applications.
Quite randomly, these executions will fail. When log in and manually kick the jobs off i'm immediately presented with 'SQL Agent not started' errors.
When I check the agent it says it's running. If I force a restart the problem is fixed.
The random nature of the issue causes testing issues.
The agent is already set up to 'restart if stopped unexpectedly' and 'restart with delay'.
A recent disaster recovery was performed and SQL Server Agent started successfully and declared itself 'running'. However once again it required a manual restart to actually work.
Is this a known issue or bug?
How can I mitigate against this when the agent says its running and all parameters are set correctly and meet the 'internet's' suggestions?
Can someone explain - didn't find it in MS's docs - what is the difference in behaviour of EXEC dbo.sp_stop_job and EXEC dbo.sp_update_job #enabled = 0? I'm preparing for AWS RDS reboot and need to turn off any job/ssis/dms that points to/from my RDS instance.
Goal is to stop any activity happening around RDS without brutal/forced connection break.
If you stop a job, you stop the currently running agent job. If you disable a job that means that the job will not start at it's next scheduled time.
Take, for example, a job that starts every hour, on the hour, and takes 10 minutes to complete. At 13:05 you stop the job; the process currently running is terminated (likely triggering rollbacks for any open transactions). The job will then run again at 14:00.
For the same job, at 16:01 you disable it. I believe, (though it's not documented that I could see) the job will continue running to completion, however, at 17:00 it will not start, and nor will it at any later dates until it is enabled (again).
I am using SQL Server 2016, and have some Jobs running in the SQL Server Agent. Today I found one of the job is taking too long (10hours!) to run and is still processing, so I try to stop that. I tried right-click and stop the job, it showed a success message. However, when I go to the Job Activity Monitor, it is showing that the job is still running! I also tried the following code:
USE [msdb]
GO
EXEC dbo.sp_stop_job N'Process Reserving MI (except problematic tables)'
GO
It also says the job stopped successfully. But again when I go to the Job Activity Monitor, it is showing that the job is still running!
Can any one please help?
At the end I have to ask the server team to reboot the server in order to solve this problem
I run a Matlab process from the task scheduler, on a WindowsServer 2008R2 VM running on VMWare.
The process gets data from a SQL database and does calculation. The process seems to 'hang' and not do any calculations when the servers are particularly with less activity(on weekends). But when I log in via RDP - the process seems to kick off or come alive and completes its execution.
I have done research about this and have configured the NIC to not to goto sleep when its inactive, from the OS level.
Also I have a different application writing a log file to the Win200R2 server during that period hoping to keep the NIC alive.
But none of the above fixes are working, and still the process hangs on weekends. I would love to hear what the community thinks about this ...
VM Configuration Screenshot
In the Activity Monitor, There is a process(belongs to a single PC) running select statement on tempdb database,it is always running. and i am unable to kill it. What should i do?
That's you, looking in Activity Monitor.
Activity monitor shows database activity. But producing the list of activities is itself an activity. Therefore it appears in the list.
Naturally it will always be shown as running, because at the time it runs, it must be running. Also, if you kill the SPID, next time you refresh activity monitor, it will make a new connection, so you will see it again.