JavaBlog.fr / Java.lu API DCTM,Documentum,DQL DCTM,ECM Documentum : Job : Force the starting and stopping of a running job (DQL, API)

Documentum : Job : Force the starting and stopping of a running job (DQL, API)

Hi,

Just a post in order to expose a solution in order to force the starting/stopping of a running job.

Force the job’s starting via DQL:

  • Execute the following query:
    1UPDATE dm_job OBJECTS set run_now=true, set a_next_invocation=DATE(NOW) WHERE object_name = '[job_name]';
  • Check the log and the automatically setting to initial value for the next invocation date by AGENT_EXEC process depending on the scheduling parameters of job :
    1SELECT r_object_id, a_last_invocation, run_now, a_next_invocation from dm_job WHERE object_name = '[job_name]';
    2## LOGS
    3SELECT   * FROM   dm_sysobject WHERE   folder('/Temp/Jobs/[job_name]') ORDER BY   r_creation_date DESC;

Force the job’s stopping:

  • Get the process id, by running the DQL (dm_job.a_last_process_id):
    01SELECT r_object_id, a_last_invocation, a_last_process_id, a_last_completion, a_special_app, r_lock_date, r_lock_machine, is_inactive, run_now, a_next_invocation, a_current_status, a_last_return_code, i_is_reference, i_is_replica dm_job where object_name='[JOB_NAME]';
    02 
    03 
    04r_object_id = 080xxxxxxxxxxxx9
    05a_last_invocation = 01/01/2016 10:00:56
    06a_last_process_id = 8976
    07a_last_completion = nulldate
    08a_special_app = agentexec
    09r_lock_date = 01/01/2016 10:00:52
    10r_lock_machine = MYSERVERDCTMCS
    11is_inactive = 1
    12run_now = 0
    13a_next_invocation = 02/01/2016 09:55:42
    14a_current_status = STARTED
    15a_last_return_code = 0
    16i_is_reference = 0
    17i_is_replica = 0
  • Kill the process corresponding via the process explorer (Example: In Windows Task Manager, the process name must be “dm_agent_exec.exe”) or with a command instructions (Windows: taskkill /pid 1234).
    In some cases, the job goes on to be executed despite of process killing. The job is unlock and without application specified of locker:
    This situation is precised in the “a_current_status” field.
    + “a_current_status” = “The job object indicated the job was in progress, but the job was not actually running. It is likely that the dm_agent_exec utility was stopped while the job was in progress.”.
    + “r_lock_date” = nulldate
    + “r_lock_machine” = nullstring
    + “a_special_app” = ”
    => The unique solution is to restart the Java Server Method via the CMD (D:\Documentum\jboss7.1.1\server\stopMethodServer.cmd) OR Services Manager.

    Example of process’ stopping (https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-7):

    01Windows PowerShell
    02Copyright (C) 2016 Microsoft Corporation. All rights reserved.
    03 
    04PS C:\Users\useradmin> Get-Process -Id 13123
    05 
    06Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
    07-------  ------    -----      -----     ------     --  -- -----------
    08   1923      23   252712     139328       5.77  13123   0 dm_agent_exec
    09 
    10PS C:\Users\useradmin> Get-Process -Id 13123 | Stop-Process
    11PS C:\Users\useradmin> Get-Process -Id 13123
    12Get-Process : Cannot find a process with the process identifier 13123.
    13At line:1 char:1
    14+ Get-Process -Id 13123
    15+ ~~~~~~~~~~~~~~~~~~~~~
    16    + CategoryInfo          : ObjectNotFound: (13123:Int32) [Get-Process], ProcessCommandException
    17    + FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand
    18 
    19PS C:\Users\useradmin>
  • Unlock the job via the API commands:
    1dump,c,[JOB_OBJECT_ID]
    2unlock,c,[JOB_OBJECT_ID]
  • Reset some execution-related job’s fields via DQL query (application/launcher of job, current status, ):
    1update dm_job objects set a_special_app='', set a_current_status='FAILED', set run_now=FALSE where object_name='[JOB_NAME]';
  • The job is unlocked now and ready to be run again.
    01SELECT r_object_id, a_last_invocation, a_last_process_id, a_last_completion, a_special_app, r_lock_date, r_lock_machine, is_inactive, run_now, a_next_invocation, a_current_status, a_last_return_code, i_is_reference, i_is_replica dm_job where object_name='[JOB_NAME]';
    02 
    03 
    04r_object_id = 080xxxxxxxxxxxx9
    05a_last_invocation = 01/01/2016 10:00:56
    06a_last_process_id = 8976
    07a_last_completion = 01/01/2016 15:03:48
    08a_special_app =
    09r_lock_date = nulldate
    10r_lock_machine =
    11is_inactive = 1
    12run_now = 0
    13a_next_invocation = 02/01/2016 09:55:42
    14a_current_status = FAILED
    15a_last_return_code = 0
    16i_is_reference = 0
    17i_is_replica = 0
  • Target server jobs:
    01select distinct target_server from dm_job order by 1;
    02....
    03target_server 
    04 
    05 
    06MY_DOCBASE_TEST.MYAPP986_MY_DOCBASE_TEST@MYAPP986
    07MY_DOCBASE_TEST.MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp985
    08MY_DOCBASE_TEST.MY_DOCBASE_TEST@MYAPP998
    09MY_DOCBASE_TEST.MY_DOCBASE_TEST@MYAPP985
    10MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp998
    11MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp985
    12MY_DOCBASE_TEST.myapp900_MY_DOCBASE_TEST@myapp900
    13MY_DOCBASE_TEST.myapp986_MY_DOCBASE_TEST@MYAPP986
    14MY_DOCBASE_TEST.myapp986_MY_DOCBASE_TEST@myapp986
    15MY_DOCBASE_TEST.myapp953_MY_DOCBASE_TEST@myapp953
  • All jobs:
    01select r_object_id, method_name, is_inactive, inactivate_after_failure from dm_job order by 2;
    02....
    03r_object_id  method_name  is_inactive  inactivate_after_failure
    04080xxxxxxxx38b  dm_ACLReplication  1  0
    05080xxxxxxxx48f  dm_AsynchronousWrite  1  0
    06080xxxxxxxx31d  dm_AuditMgt  0  0
    07080xxxxxxxx334  dm_ConsistencyChecker  0  0
    08080xxxxxxxx32d  dm_ContentReplication  1  0
    09080xxxxxxxx317  dm_ContentWarning  0  0
    10080xxxxxxxx318  dm_DBWarning  1  0
    11080xxxxxxxx330  dm_DMArchive  1  0
    12080xxxxxxxx319  dm_DMClean  0  0
    13080xxxxxxxx31a  dm_DMFilescan  1  0
    14080xxxxxxxx33f  dm_DataDictionaryPublisher  0  0
    15080xxxxxxxx32f  dm_DistOperations  1  0
    16080xxxxxxxx3fc  dm_FTCreateEvents  1  0
    17080xxxxxxxx3fe  dm_FTIndexAgentBoot  1  0
    18080xxxxxxxx3fd  dm_FTStateOfIndex  1  0
    19080xxxxxxxx388  dm_FederationCopy  1  0
    20080xxxxxxxx387  dm_FederationExport  1  0
    21080xxxxxxxx389  dm_FederationImport  1  0
    22080xxxxxxxx38a  dm_FederationStatus  1  0
    23080xxxxxxxx386  dm_FederationUpdate  1  0
    24080xxxxxxxx32e  dm_FileReport  1  0
    25080xxxxxxxx332  dm_GroupRename  1  0
    26080xxxxxxxx44e  dm_GwmClean  0  0
    27080xxxxxxxx44d  dm_GwmTask_Alert  0  0
    28080xxxxxxxx38d  dm_LDAPSynchronization  1  0
    29080xxxxxxxx31b  dm_LogPurge  0  0
    30080xxxxxxxx341  dm_MoveContent  1  0
    31080xxxxxxxx31e  dm_QueueMgt  0  0
    32080xxxxxxxx340  dm_RemoveExpiredRetnObjects  1  0
    33080xxxxxxxx31f  dm_RenditionMgt  1  0
    34080xxxxxxxx31c  dm_StateOfDocbase  0  0
    35080xxxxxxxx32b  dm_SwapInfo  1  0
    36080xxxxxxxx32c  dm_UpdateStats  0  0
    37080xxxxxxxx333  dm_UserChgHomeDb  1  0
    38080xxxxxxxx331  dm_UserRename  1  0
    39080xxxxxxxx320  dm_VersionMgt  1  0
    40080xxxxxxxx3bb  dm_WfmsTimer  1  0
    41080xxxxxxxx38c  replicate_folder  1  0
    42....
    43080xxxxxxxed67  HUO_MyCustomJob1    1   0
    44080xxxxxxx103b  HUO_MyCustomJob2    0   0
    45080xxxxxxx1f9d  HUO_MyCustomJob3    0   0
    46080xxxxxxxxf6b  HUO_MyCustomJob4    0   0

That’s all!!

Huseyin

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post