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:
    UPDATE 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 :
    SELECT r_object_id, a_last_invocation, run_now, a_next_invocation from dm_job WHERE object_name = '[job_name]';
    ## LOGS
    SELECT   * 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):
    SELECT 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]';
    
    
    r_object_id = 080xxxxxxxxxxxx9
    a_last_invocation = 01/01/2016 10:00:56
    a_last_process_id = 8976
    a_last_completion = nulldate
    a_special_app = agentexec
    r_lock_date = 01/01/2016 10:00:52
    r_lock_machine = MYSERVERDCTMCS
    is_inactive = 1
    run_now = 0
    a_next_invocation = 02/01/2016 09:55:42
    a_current_status = STARTED
    a_last_return_code = 0
    i_is_reference = 0
    i_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):

    Windows PowerShell
    Copyright (C) 2016 Microsoft Corporation. All rights reserved.
    
    PS C:\Users\useradmin> Get-Process -Id 13123
    
    Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
    -------  ------    -----      -----     ------     --  -- -----------
       1923      23   252712     139328       5.77  13123   0 dm_agent_exec
    
    PS C:\Users\useradmin> Get-Process -Id 13123 | Stop-Process
    PS C:\Users\useradmin> Get-Process -Id 13123
    Get-Process : Cannot find a process with the process identifier 13123.
    At line:1 char:1
    + Get-Process -Id 13123
    + ~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (13123:Int32) [Get-Process], ProcessCommandException
        + FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand
    
    PS C:\Users\useradmin>
    
  • Unlock the job via the API commands:
    dump,c,[JOB_OBJECT_ID]
    unlock,c,[JOB_OBJECT_ID]
    
  • Reset some execution-related job’s fields via DQL query (application/launcher of job, current status, ):
    update 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.
    SELECT 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]';
    
    
    r_object_id = 080xxxxxxxxxxxx9
    a_last_invocation = 01/01/2016 10:00:56
    a_last_process_id = 8976
    a_last_completion = 01/01/2016 15:03:48
    a_special_app =
    r_lock_date = nulldate
    r_lock_machine = 
    is_inactive = 1
    run_now = 0
    a_next_invocation = 02/01/2016 09:55:42
    a_current_status = FAILED
    a_last_return_code = 0
    i_is_reference = 0
    i_is_replica = 0
    
  • Target server jobs:
    select distinct target_server from dm_job order by 1;
    ....
    target_server  
    
    
    MY_DOCBASE_TEST.MYAPP986_MY_DOCBASE_TEST@MYAPP986
    MY_DOCBASE_TEST.MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp985
    MY_DOCBASE_TEST.MY_DOCBASE_TEST@MYAPP998
    MY_DOCBASE_TEST.MY_DOCBASE_TEST@MYAPP985
    MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp998
    MY_DOCBASE_TEST.MY_DOCBASE_TEST@myapp985
    MY_DOCBASE_TEST.myapp900_MY_DOCBASE_TEST@myapp900
    MY_DOCBASE_TEST.myapp986_MY_DOCBASE_TEST@MYAPP986
    MY_DOCBASE_TEST.myapp986_MY_DOCBASE_TEST@myapp986
    MY_DOCBASE_TEST.myapp953_MY_DOCBASE_TEST@myapp953
    
  • All jobs:
    select r_object_id, method_name, is_inactive, inactivate_after_failure from dm_job order by 2;
    ....
    r_object_id  method_name  is_inactive  inactivate_after_failure
    080xxxxxxxx38b  dm_ACLReplication  1  0
    080xxxxxxxx48f  dm_AsynchronousWrite  1  0
    080xxxxxxxx31d  dm_AuditMgt  0  0
    080xxxxxxxx334  dm_ConsistencyChecker  0  0
    080xxxxxxxx32d  dm_ContentReplication  1  0
    080xxxxxxxx317  dm_ContentWarning  0  0
    080xxxxxxxx318  dm_DBWarning  1  0
    080xxxxxxxx330  dm_DMArchive  1  0
    080xxxxxxxx319  dm_DMClean  0  0
    080xxxxxxxx31a  dm_DMFilescan  1  0
    080xxxxxxxx33f  dm_DataDictionaryPublisher  0  0
    080xxxxxxxx32f  dm_DistOperations  1  0
    080xxxxxxxx3fc  dm_FTCreateEvents  1  0
    080xxxxxxxx3fe  dm_FTIndexAgentBoot  1  0
    080xxxxxxxx3fd  dm_FTStateOfIndex  1  0
    080xxxxxxxx388  dm_FederationCopy  1  0
    080xxxxxxxx387  dm_FederationExport  1  0
    080xxxxxxxx389  dm_FederationImport  1  0
    080xxxxxxxx38a  dm_FederationStatus  1  0
    080xxxxxxxx386  dm_FederationUpdate  1  0
    080xxxxxxxx32e  dm_FileReport  1  0
    080xxxxxxxx332  dm_GroupRename  1  0
    080xxxxxxxx44e  dm_GwmClean  0  0
    080xxxxxxxx44d  dm_GwmTask_Alert  0  0
    080xxxxxxxx38d  dm_LDAPSynchronization  1  0
    080xxxxxxxx31b  dm_LogPurge  0  0
    080xxxxxxxx341  dm_MoveContent  1  0
    080xxxxxxxx31e  dm_QueueMgt  0  0
    080xxxxxxxx340  dm_RemoveExpiredRetnObjects  1  0
    080xxxxxxxx31f  dm_RenditionMgt  1  0
    080xxxxxxxx31c  dm_StateOfDocbase  0  0
    080xxxxxxxx32b  dm_SwapInfo  1  0
    080xxxxxxxx32c  dm_UpdateStats  0  0
    080xxxxxxxx333  dm_UserChgHomeDb  1  0
    080xxxxxxxx331  dm_UserRename  1  0
    080xxxxxxxx320  dm_VersionMgt  1  0
    080xxxxxxxx3bb  dm_WfmsTimer  1  0
    080xxxxxxxx38c  replicate_folder  1  0
    ....
    080xxxxxxxed67  HUO_MyCustomJob1	1	0
    080xxxxxxx103b  HUO_MyCustomJob2	0	0
    080xxxxxxx1f9d  HUO_MyCustomJob3	0	0
    080xxxxxxxxf6b  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