Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2010
    Location
    jakarta
    Posts
    3

    Question Unanswered: [HELP] db2 v9.7 query is not run by crontab in RHEL5.4

    Dear all,

    this is my first thread and my first post too, so i'm the newbie here. my username is my real name. howdy y'all.

    okay ehm...about the problem :

    i create alotta perl script that contains DB2 query. yes i'm using DBD:B2 module. i used db2 8.2 enterprise before in RHEL 5.2 in development machine and it's running well when my perl script run by crontab. time goes by (2 years development). and now they (my client) asked for the lattest tech from me. so i give'em RHEL 5.4 and db2 9.7 workgroup.

    the surprise is when i try to put the script in crontab. IT'S NOT RUNNING (i'm so dead) . it run well when i run it manually (no error nor warning). the /var/log/cron tell me that the script is run, but actually, it was stopped when it was running the DB2 query part. what should i do

    could someone help me. pleeeeeeeeeasse

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    The problem is obviously on line 11 of your script.

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Do load the db2 profile in your cron script?

    Andy

  4. #4
    Join Date
    Oct 2010
    Location
    jakarta
    Posts
    3
    sooooo, let get this straight.

    i run

    $ db2set -g

    and get these value :

    DB2SYSTEM=britantyo
    DB2INSTDEF=db2inst1
    DB2ADMINSERVER=dasusr1

    and then i have to put these value to /etc/crontab under PATH variable

    or

    i get all db2 environment variable in :

    $ env

    and put all these value of db2 in /etc/crontab :

    DB2INSTANCE=db2inst1
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc
    CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.
    LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib32


    i used to have my db2 V8.2 and it doesn't need to put anyting inside /etc/crontab


  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    The first line of my cron scripts all start with:
    . /home/db2inst1/sqllib/db2profile


    This loads the db2 profile for the cron session, which is necessary to do DB2 work in the session.

    Andy

  6. #6
    Join Date
    Oct 2010
    Location
    jakarta
    Posts
    3

    Lightbulb

    hey that works...thanks alot ARWinner. how can i thank you . now the cron work properly.

    but frankly, i don't have to do that in V8.2

    THANKS A LOT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •