Wednesday, July 13, 2016

SCDPM–Job Failed to Cancel or Hung or Stuck BUT Cannot be remove

Environment
SCDPM 2012 SP1

It’s been hours the job has been cancelled but couldn’t be remove from the DPM job.  Can’t execute the next job due to the job is still in progress to cancel.   However, found the issue is with the SQL Database that is holding the job from being release. 

In the SCDPM console, it displays as below :

SNAGHTML6facbe

The following steps were carried out :

  • Launch the SQL Server Management Studio (<right-click> run as Administrator)

Once it’s launched, ensure DPM DB is connected

Copy the script below :

USE DPMDB

BEGIN TRAN

-- mark replica as invalid if there was some operation happening on that replica

UPDATE tbl_PRM_LogicalREplica

SET Validity = 1 -- Invalid

WHERE OwnerTaskIdLock IS NOT NULL AND

Validity <> 5 AND -- ProtectionStopped

Validity <> 6 -- Inactive

-- Release all the locks held

UPDATE tbl_PRM_LogicalREplica

SET OwnerTaskIdLock = null,

Status=8

if (select COUNT(name) from tbl_AM_Agent where Name like 'DPM RA v2%') > 0

begin

exec sp_executesql N'UPDATE tbl_RM_ShadowCopy

SET ArchivetaskId = NULL,

RecoveryJobId = NULL'

end

UPDATE tbl_ARM_Datasource

SET Status = 0,

OwnerLockId = NULL

DELETE tbl_RM_DatasourceServerlock

DELETE tbl_RM_ShadowCopyLocks

-- Set All running tasks and jobs to failed

UPDATE tbl_TE_TaskTrail

SET ExecutionState = 3,

LastStateName = 'Failure',

StoppedDateTime = GetUtcDate()

WHERE ExecutionState NOT IN (2,3)

UPDATE tbl_JM_JobTrail

SET JobState= 'Failed',

EndDateTime = GetUtcDate()

WHERE jobstate= 'Execute' OR jobstate= 'Retire'

-- unreserve resources held

UPDATE tbl_MM_Global_Media

SET ReservationLevel = 0,

ReservationOwnerMMId = null

UPDATE tbl_MM_Global_Drive

SET ReservationLevel = 0,

ReservationOwnerMMId = null

UPDATE tbl_MM_Global_IEPortResource

SET ReservationLevel = 0,

ReservationOwnerMMId = null

COMMIT TRAN

 

  • Click on New Query
  • Paste the Script into the Query Column
  • Click Execute

SNAGHTML8c5e05

  • Check on the OUTPUT column below
  • Close the SCDPM console and open it back.  It should clear the status and be able to execute whatever job that is outstanding.

Hope this helps.   Works on SCDPM 2012 R2 too. 

Resource of the script is from here.

Thank you.

keywords : SCDPM, Data protection manager 2012 SP1, SCDPM 2012 SP1, SCDPM 2012 R2, Job cancel but hang, cancel job failed

1 comment:

  1. Thanks you for posting this. I just had this happen today.

    ReplyDelete