on 12-09-2014 12:28 PM
Hello Experts,
I have been assigned a task where I have to schedule background jobs in SAP HANA .
Is it necessary to create procedures or can it be done using simple sql statements?
Please help me out in solving this issue.
Thanks & Regards,
Shreya.
Hello Shreya,
You can try the following document:
Scheduling a XSengine Background job to call a procedure
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I have 2 development servers and I am able to create the background job in one server and running every 1 min ,the other one I tried to follow same steps but not able to activate my .xsjob file.
The error says :Required object does not exist or exist multiple times.
I have all the required roles assigned to my userid,
.xsjob file loos like
{
"description": "Background job test",
"action": "xxxxx::procedure",
"schedules":
[ { "description": "This job will run every minute",
"xscron": "* * * * * * 59"
}
]
}
You can only schedule SQLScript Procedures or XSJS functions. If you have a series of simple SQL statements they need to be wrapped in either on of these.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the online help link for the topic:
Scheduling XS Jobs - SAP HANA Developer Guide for SAP HANA Studio - SAP Library
{
"description": "My first SQL Script job"
"action": "Testdemo.jobs::schtest.hdbprocedure"
"schedules": [ {
"description": "Will run every 10 seconds"
"xscron": " * * * * * * 59" }
]
}
Don't put the .hdbprocedure on the end of the procedure name in the XSJOB definition. Here is an example of calling a stored procedure from XSJOB:
{
"description": "My first SQLScript job",
"action": "playground.sp7.procedures::jobsCreateEntry",
"schedules": [ {
"description": "Will run every 10 seconds",
"xscron": "* * * * * * 0:59/10" } ]}
Hi Thomas,
Yes, that was just a spell checker. May I know what what is JobsDemo.Details in your example?
The other thing is that whenever I login into XS Admin tool, I am unable to edit anything. I can just see a message stating "You are logged in as System". What might be the issue? How can I proceed and activate my .xsjob file and my procedure over there?
JobsDemo.Details? I don't see that anywhere in the job definition I posted. That is in the body of my procedure, but I didn't post that here. How did you see that? Its just a test table for the demo. Whenever the job runs it writes a record into that table. That way its easy to show that the job is really running.
>The other thing is that whenever I login into XS Admin tool, I am unable to edit anything
First guess would be that you are missing the proper authorizations. Just because you are SYSTEM user doesn't mean you automatically have access. Even system must be granted the necessary roles.
>Would you please let me know what that is?
I did already in the previous posting.
>What access rights must be granted to SYSTEM in order to access XS Admin tool?
The required role was listed toward the beginning of the help link I posted earlier.
NoteThe tasks required to set up a scheduled job in SAP HANA XS are performed by two distinct user roles: the application developer and the SAP HANA administrator. In addition, to maintain details of an XS job in the SAP HANA XS Administration Tool, the administrator user requires the privileges assigned by the user rolesap.hana.xs.admin.roles::JobAdministrator .
Hi Thomas,
I checked for the roles of the System. I can find sap.hana.xs.admin.roles::JobAdministrator role assigned over there. Even then I'm unable to log in completely in XS admin tool. It is still displaying "You are logged in as System" after log in. Should I check any other roles?How can I resolve this issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.