Schedule the Stored Procedure

Posted on 2006-05-08
Last Modified: 2008-02-01
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 ?

Question by:BinaryTree
    LVL 7

    Accepted Solution

    You can use DB2 Task Center to schedule.
    LVL 7

    Assisted Solution

    you use task center, you will at least:

    1) DB2 Administration Server
    2) Tools catalog

    LVL 45

    Assisted Solution

    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!

    Author Comment


    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 !



    Author Comment

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

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now