• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1082
  • Last Modified:

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 ?

Regards,
0
BinaryTree
Asked:
BinaryTree
  • 2
  • 2
3 Solutions
 
sachinwadhwaCommented:
You can use DB2 Task Center to schedule.
0
 
sachinwadhwaCommented:
you use task center, you will at least:

1) DB2 Administration Server
2) Tools catalog


0
 
Kent OlsenData 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!
Kent
0
 
BinaryTreeAuthor Commented:
Hi

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 !

regards,

0
 
BinaryTreeAuthor Commented:
Can not find any soulution ! i will split the points , thanks :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now