Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2002
    Posts
    14

    Thumbs down Unanswered: Can't connect to DB2 using Crontab on AIX

    Hi,
    I still have just a little experience in AIX and DB2, and I'm trying to do onine backup running a shell using crontab. Executing this shell at the OS prompt, it works well, but by crontab the database connection is not possible, returning the following message:
    SQL0332N There is no available conversion for the source code page "819" to the target code page "954". Reason code "1" SQLSTATE=57017
    The user's profile is set before the connection to DB. And I didn't have any problem on Linux.
    May somebody help me?
    Thanks very much in advance!
    Monica.

  2. #2
    Join Date
    Aug 2002
    Location
    PUNE
    Posts
    6

    Talking

    Monica

    Here is my crontab entries on Solaris:

    ________________________________________________
    #!/bin/sh
    00 10 * * 0 /usr/local/db2/instance1/dbms/cron/backup1
    ________________________________________________
    And this is working fine for last 2-3 years.

    I think you need to add "#!/bin/sh" in your crontab file.

    Edit the crontab using "crontab -e" and add "#!/bin/sh" before any command.

  3. #3
    Join Date
    Aug 2002
    Posts
    14

    Smile

    Shiva, thanks very much for your attention.
    I added that row in my crontab, but it didn't work.
    Reading a Release Notes about National Language Support, I knew a registry variable called DB2CODEPAGE. I set it to the target code page(954), and now the crontab is working well. Maybe this is not the real solution, because usually this variable is set from the operating system...

    Thanks again!

  4. #4
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Hi Monica,

    WHich crontab contains the connection?
    Is it from root? or Another?
    You obviously have a environment setting problem.
    Your env var may be correct, but it is possible that 954 is NOT your database language... In that case, you are not making the correct backups.
    rws

  5. #5
    Join Date
    Aug 2002
    Posts
    14

    Unhappy

    Hi Roelwe,
    The crontab is executed by the database owner, and the code page 954, is for japanese language... when the database is created, this code page is automatically set to it. At the moment, the tests with backup are ok, but I still don't know what caused the problem. Do you think that the environment setting problem was caused during the installation of DB2? Thanks very much for your attention.
    Monica.

  6. #6
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    In that case your solution is correct. Just set the source code page to the target one...
    rws

  7. #7
    Join Date
    Aug 2002
    Location
    UK
    Posts
    87
    I didn't think you needed #!/bin/sh in a crontab file as cron is reading this file for scripts to start at the time specified and you cannot put script commands (needing #!/bin/sh) in the crontab file

Posting Permissions

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