Under certain circumstances, the nightly RiskFabric Processing job may run longer than its historical average. When this happens in an environment in which the RiskFabric Intraday Processing job is enabled, there is a risk that the intraday job will start before the nightly job has completed. Because both jobs execute many of the same tasks, access the same database objects, and utilize the same system resources, you should take care to prevent this condition by adding a check to the intraday job that will prevent it from running concurrently with the nightly job.
Release : 6.x
Component : RiskFabric Processing, RiskFabric Intraday Processing
RiskFabric relational database1:RiskFabric Processing job checkTransact-SQL script (T-SQL) msdbDECLARE @sessionID int,@jobName VARCHAR(255) = 'RiskFabric Processing'
SET @sessionID = (SELECT MAX(session_id) FROM msdb.dbo.sysjobactivity where job_id = (SELECT job_id FROM msdb.dbo.sysjobs WHERE name = @jobName))
IF EXISTS (SELECT sj.name, sja.*
FROM msdb.dbo.sysjobactivity AS sja INNER JOIN msdb.dbo.sysjobs AS sj ON sja.job_id = sj.job_id
WHERE sja.start_execution_date IS NOT NULL
AND sja.stop_execution_date IS NULL
AND sja.session_id = @sessionID
AND sj.name = @jobName)
RAISERROR ('Nightly job is still running', 16, 1)