SAP HANA:XS Job

5.SAP HANA XS Job

XS Job:定义重复执行的后台定期任务;

例如定时执行数据更新到Table的操作,需要使用到XS Job;

SAP HANA XS Setting up Scheduled jobs steps:

Step

Task

User Role

Tool

1

Create the function or script or procedure you want to run at regular intervals

Application developer

Text editor

2

Create the job file .xsjob that defines details of the recurring task

Application developer

Text editor

3

Maintain the corresponding runtime configuration for the xsjob

SAP HANA administrator

XS Job Dashboard

4

Enable the job-scheduling feature in SAP HANA XS

SAP HANA administrator

XS Job Dashboard

5

Check the job logs to ensure the job is running according to schedule.

SAP HANA administrator

XS Job Dashboard

 

文件.xsjob中,

“description”:表示XS Job描述;

“action”:表示XS Job执行内容;

“schedules”:表示排程内容;

“schedules”的值为列表,表示可以配置多个排程信息;

“schedules”下:

“description”:表示schedule描述;

“xscron”:表示schedule运行时间;“parameter”:表示schedule执行需要参数;

实例代码:

{

    "description": "Call Procedure xxx",

    "action": "procedure name or SQL",

    "schedules": [

       {

          "description": "procedure xxx",

          "xscron": "* * * * * * 59",

          "parameter": {

          }

       }

    ]

}

“xscron”:从左到右*号表示含义;

xscron Field

(* from left to right)

Meaning and

Permitted Value

Year

4-digit, for example, 2013

Month

1 to 12

Day

-31 to 31

DayofWeek

mon,tue,wed,thu,fri,sat,sun

Hour

0 to 23

Minute

0 to 59

Second

0 to 59

 

 

 

 

 

 

 

 

 

 

 

 

 

 

配置示例:

1.2009 11 1  * 13 30 40

2009年11月1日 13点30分40秒执行;

2.* * -3 * 13 * 40

每个月倒数第三天,13点40秒执行;

3.* * 15:-2 * * 30 40

每个月15号到本月倒数第二天期间,每30分钟40秒执行一次;

4.* * * mon,tue,fri 13 * 40

每周一,二,五,13点40秒执行;

5.* * * * * */5 30

每隔5分钟第30秒执行一次;

 

参考链:

https://help.sap.com/docs/SAP_HANA_PLATFORM/d89d4595fae647eabc14002c0340a999/15e72de0ed4a4ce1aa1ad7483dbe6b37.html?locale=en-US

posted @ 2022-10-17 16:40  渔歌晚唱  阅读(84)  评论(0编辑  收藏  举报