Schedule the Stored Procedure

Dear All,

I have a stored procedure in my DB2 Database , i want to schedule this stored procedure to be executed in specific time daily. I know that i can create .sh file to run the stored procedure and schedule this .sh file in the crontab , but for some reason i want to do this job completely on the Database side  !

Does DB2 have a command or tool to schedule the stored procedure ?

Who is Participating?
sachinwadhwaConnect With a Mentor Commented:
You can use DB2 Task Center to schedule.
sachinwadhwaConnect With a Mentor Commented:
you use task center, you will at least:

1) DB2 Administration Server
2) Tools catalog

Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:
Hi BinaryTree,

The base DB2/UDB package does not contain a scheduler.  As sachinwadhwa indicates, you'll have to use an external scheduler and the one in Task Center will do fine.  You can also use any other 3rd party scheduler that you may have.

Personally, I'd stick with cron.  That way ALL periodic jobs are recorded in one place.

Good Luck!
BinaryTreeAuthor Commented:

Task Center is disabled on our servers , we can not use it.

i tried to use crontab like the following:

create .sql file contains the calling to stored procedure by using

call mystoredprocedure()

and call this file using .sh file by :

db2 - tvf <<then my .sql file name>>

but i am not sure about the syntax that i have to follow on .sql and .sh file !! can you describe this solution for me in details !


BinaryTreeAuthor Commented:
Can not find any soulution ! i will split the points , thanks :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.