cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduling stored procedures via XS jobs

shyam_uthaman
Participant
0 Kudos

Hi,

I have a stored procedure that accepts a parameter. Like ProcedureExample('<SchemaName>').

Now I need it become schedulable via an XS job through the XS dashboard.

Unfortunately, I don't have a clue on how to start on this.

I found some links but no examples of how to do this but none of them explain how I can make the job pass parameters.

It would be a great help if someone could post an example.

Thanks,

SHyam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shyam,


1. You need to have sap.hana.xs.admin.roles::JobAdministrator privilege.


2. Create the stored procedure your talking about to run at regular intervals.


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


In your case it would look something like this run_procedure.xsjob

Eg:


{

    "description": "Runs the procedure",

    "action": "package_path::procedure_name",

    "schedules": [

       {

          "description": "Runs the procedure every 59th second every year every day",

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

          "parameter": {

             "schema_name": "XYZ"

             }

       }

    ]

}

4. Maintian the XS job's runtime configuration :

     a. Login to XS dashboard using           http://<WebServerHost>:80<SAPHANAinstance>/sap/hana/xs/admin/

     b. Create the job by configuring it, you need to know the user_name, password, locale, start           and stop time, Active.

     c. Save the job

5. Enable the job scheduling feature in SAP HANA by doule click on system -> xsengine.ini -> scheduler -> enabled. (Need to have admin rights to do this).

6. Check the job logs, your scheduled job must be running every 59th second.

Regards,

Anil

shyam_uthaman
Participant
0 Kudos

Thanks Anil. I created 4 jobs for the 4 schemas that I had.

Will check if I have access to the XS dashboard to complete the rest.

Answers (0)