Autosys对大型机作业的依赖 [英] Autosys dependency on mainframe job

查看:175
本文介绍了Autosys对大型机作业的依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Autosys作业(简称为job_a),它的时间是凌晨3点,并且还应该等待大型机作业的成功完成(job_m,在我们的情况下总是成功)。 Job_m通过大型机上的OPC调度程序运行,该调度程序将作业完成情况传达给Autosys。它可以在凌晨2点到凌晨6点之间的任何时间运行。

We have an Autosys job (let's call it job_a) that has a 3am time dependency and is also supposed to await successful completion of a mainframe job (job_m, which in our case is always successful). Job_m is run via the OPC scheduler on the mainframe, which communicates job completion to Autosys. It can run any time between 2am and 6am.

我对Autosys的工作方式的理解是,它会在job_m完成时以及job_a完成时将条目写入数据库的表中检查其依赖性,它在此表中查找以查看job_m的状态。此状态不会自动清除。结果,即使我们只对同一天运行job_m感兴趣,也总是在第一次成功运行job_m之后就可以满足对工作的依赖。

My understanding of how Autosys works is that it writes an entry into a table in its database when job_m completes, and when job_a checks its dependencies, it looks in this table to see the status of job_m. This status is not automatically cleared. As a result, the job dependency will always be met after the first ever successful run of job_m, even though we are only interested in job_m runs on the same day.


Day 1 4am: job_m completes
Day 1 4:01am: job_a runs, since Day 1 4am run of job_m was successful
Day 2 3am: job_a runs, since Day 1 4am run of job_m was successful
Day 2 5am: job_m completes


我们当前建议的解决方法是有一个作业(job_c)定期检查表,并且仅在过去6小时内job_m的状态发生更改时才完成。

Our current proposed workaround is to have a job (job_c) that periodically checks the table and only complete if the status of job_m was changed in the last 6 hours.


Day 1 3am: job_c starts, sees no status change for job_m within the last 6 hours
Day 1 4am: job_m completes
Day 1 4:01am: job_c completes
Day 1 4:02am: job_a runs following completion of job_c
Day 2 3am: job_c starts, sees no status change for job_m within the last 6 hours
Day 2 5am: job_m completes
Day 2 5:01am: job_c completes
Day 2 5:02am: job_a runs following completion of job_c

$ b $完成后运行b

是否有一个Autosys命令可用于重置表中job_m的状态?如果不是,是否有比上述方法更好的方法来执行这种依赖关系?

Is there an Autosys command that can be used to reset the status of job_m in the table? If not, is there a better method of enforcing this dependency than the one outlined above?

推荐答案

解决方案取决于版本您正在使用的Autosys。如果它是最新版本R11,则可以将对job_a的回顾依赖性设置为仅在job_c在X小时内运行到S时运行。

The solution depends on the version of Autosys you are using. If it is R11, the newest version, you can set look back dependencies on job_a to only run if job_c has ran to S within X hours.

在早期版本中,您可以在job_a的S上运行一个作业,它将job_c的状态更改为INACTIVE。如果job_c处于非活动状态,job_a会将启动条件视为FALSE,但是job_c将在下次满足其启动条件时运行。

In earlier versions you can run a job on the S of job_a that will change the status of job_c to INACTIVE. If job_c is inactive, job_a sees that starting condition as FALSE, but job_c will run the next time its starting conditions are met.

命令为sendevent -E CHANGE_STATUS -s不活跃-J job_c。该命令必须以Autosys超级用户帐户身份运行。您的Autosys管理员可能不允许这样做。最佳实践也是在Autosys Event处理器服务器上运行sendevent命令,这样,如果您正在运行双服务器高可用性并且系统翻转到单服务器模式,则sendevent命令在翻转之后将起作用。

The command is sendevent -E CHANGE_STATUS -s INACTIVE -J job_c. This command has to be ran as the Autosys superuser account. Your Autosys Admins may not allow this. Also best practice is to run sendevent commands on the Autosys Event processor server so that if you are running dual server high availability and the system rolls over to single server mode, the sendevent command works after the roll over.

示例

insert_job: job_a job_type: c
command: do_something
machine: machine1
owner: my_id@machine1
conditions: s(job_c)
date_condition: 1
start_time: 03:00

insert_job: job_c job_type: c
command: do_something_else
machine: machine1
owner: mainframe@machine1
comment: "This is the mainframe job"


insert_job: job_d job_type: c
command: sendevent -E CHANGE_STATUS -s INACTIVE -J job_c
owner: superuser@autosys_server
machine: autosys_server
conditions: s(job_a) and s(job_c)

这篇关于Autosys对大型机作业的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆