Tuesday, August 10, 2010

Unable to start execution of step (reason: The PowerShell subsystem failed to load [see the SQLAGENT.OUT file for details];The job has been suspended). The step failed.

Problem:
Unable to start execution of step 3 (reason: The PowerShell subsystem failed to load [see the SQLAGENT.OUT file for details];The job has been suspended). The step failed.

Cause of the failure: This is due to invalid location of SQLPS.exe file

Solution:

1. We can use the below script check the location of SQLPS.exe file.
[sourcecode language="sql"]
SELECT * FROM msdb.dbo.syssubsystems WHERE start_entry_point ='PowerShellStart'
[/sourcecode]
2. Go to the server and check whether the file ‘SQLPS.exe’ is located in the path as per step1.

3. There may be chance that the path is different on Node1 and Node2.

4. Find out the correct path of the SQLPS.exe and re-configure it using below command
[sourcecode language="sql"]
Use msdb
go
sp_configure 'allow updates', 1
RECONFIGURE WITH OVERRIDE
[/sourcecode]
/* Update to correct path
For example correct path is “D:\Server_apps\x86\MSSQL\100\Tools\Binn\SQLPS.exe” Than change it accordingly*/

[sourcecode language="sql"]
UPDATE msdb.dbo.syssubsystems SET agent_exe='E:\Server_apps\x86\MSSQL\100\Tools\Binn\SQLPS.exe' WHERE start_entry_point ='PowerShellStart'

sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE
[/sourcecode]
5. Confirm that SQLPS.exe file path has changed by running the below script once again
[sourcecode language="sql"]
SELECT * FROM msdb.dbo.syssubsystems WHERE start_entry_point ='PowerShellStart'
[/sourcecode]
6. Restart the respective SQL agent service. For the cluster server you have to use cluster administrator to restart the service.

7. Re - run the job.

1 comment: