Unanswered: Can't connect to DB2 using Crontab on AIX
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!
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.
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...
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.
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.