how to connect to db2 database in crontab jobs scheduling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • venki12
    New Member
    • Feb 2014
    • 1

    how to connect to db2 database in crontab jobs scheduling

    15 17 * 02 * . ~/.profile ; db2 -tvf '/data10/biscripts/generalscripts/aggregate_scrip ts/DB2_SCRIPTS/aqs/VIKASH/DL1/VIKASH.DB2'>/data10/biscripts/generalscripts/aggregate_scrip ts/DB2_SCRIPTS/aqs/VIKASH/DL1/VIKASH_1.CSV

    i am scheduling this job we are getting below error.


    The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL1024N A database connection does not exist. SQLSTATE=08003
    kindly reply where is the issue and resolution.

    Regards
    Vikash Sinha
  • przytula
    New Member
    • Jun 2009
    • 13

    #2
    I would never do this in crontab like indicated
    create a single script with
    /path/db2profile --> the complete path
    execute script with options
    you avoid working in sub-shell and loosing connection....

    Best Regards, Guy Przytula

    Comment

    Working...