Limit the query running time with Resource limit facility (RLF)

If you need to limit the query(package,plan) running time, but the JCL/JOB TIME parameters doesn't work in most case. Here is some step by step of how to make it work using the resouce limit facility.

  • Check the RLFAUTH in your zparm file, the default was sysibm.
    RLFAUTH=SYSIBM
  • Create table DSNARL and related index with schema above.
  • Populate the data to limit the query execution time.
    INSERT INTO sysibm.DSNRLST01                           
      (RLFFUNC, RLFCOLLN, RLFPKG, LUNAME, ASUTIME)         
     VALUES('2', 'DSNTEP2', '', 'PUBLIC', 5);

Keep the LUNAME as PUBLIC so all local and remote SQLs will been terminated.
Change the DSNTEP2 name to your collection name if you bind it with different name or want to limit other package/collection.
Adjust the ASUTIME to meet your requirement, you can just explain the whole workload and select max(procsu) from dsn_statemnt_table to get the minimal value for it.
On zEC12, the query will run 30 seconds, the -905 report 90 CPU SECONDS = 000006000000 SERVICE UNITS

http://www-01.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.perf/src/tpc/db2z_calculateserviceunits.dita?lang=en

  • Start the rlimit with command
    -SA9HSTA rlimit id=01
    Run some long running query to verify it. The job will exit with return code 8. But if you set the SYSPRINT to dummy, it didn't show the error code, you need to set it //SYSPRINT DD SYSOUT=* to check the error code.
  • Stop the rlimit after your workload run.
    -SA9HSTO rlimit
  • The rlimit will inactive after refresh DB2, so add the start rlimit after your had start DB2.

转载于:https://www.cnblogs.com/db2zos/p/3607786.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值