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
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?
I want to give our IT a hand regarding the creation of a DefaultJob, that executes himself every server restart or start (Windows SQL Server 2012)
There is a trace that always activates himself after the server restarts or starts (after a hard shutdown or updates).
Basically I want to execute the following query (deactivate the Trace with the ID 1) automatically over a DefaultJob (a Job in the SQL Server Agent):
exec sp_trace_setstatus 1,0
Before executing it, I want to check if the trace with the ID 1 is active, if yes, then execute the query, if not, do nothing.
Any help would be much appreciated.
If you guys have questions, just ask... :-)
Thanks a lot in advance.
Cheers!
Title says about as much as I can say, I have tried stopping these packages from running but the stop operations seem to have no end. How can I kill the running operations?
I have tried restarting the server but they still seem to be running
Update:
Here's the activity monitor processes with all the operations still running as above:
So my solution, which is not really a solution was just to delete the SSISDB and create a new one. If you find a real solution please let me know
Right click SSISDB under Integration Services Catalog - Select Active operations - Select your operation and click stop.
You can also script this to for example
USE SSISDB
GO
EXEC [catalog].[stop_operation] 82428
You can also get all your running status by doing this:
SELECT 'exec [catalog].[stop_operation] ' + CAST(operation_id as varchar(10))
FROM [SSISDB].[internal].[operations]
where status = 2
And then copy them to a query window and execute it.
And if that doesnt work - You could either stop your SQL Job agent Job or kill the processes under Activity Monitor - But that should be the last option.
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.
Since 3 days ago, an SQL Server 2005 Agent job that's used to retrieve data from an odbc data source (Microsoft XAL) fails with the following error:
"Executed as user: NT AUTHORITY\SYSTEM. The step was cancelled (stopped) as the result of a stop job request.".
As far as I can tell, we didn't change anything in the configuration of the job in the last few days. Any ideas what settings I should check to find the cause of the problem? Or had somebody had similar problems?
Thanks in advance!
I've found the solution. We had a stored procedure that was waiting via WAITFOR DELAY if another stored procedure was still running. And somehow, our database got inconsistent, so the stored procedure thought the other procedure was running all the time and waited and waited and waited...
At some point in the night, when the server got restarted because of a backup job, the agent worte this "The step was cancelled (stopped) as the result of a stop job request." into the job log.
Maybe this will help someone in the future who has the same problem.