473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SQL10007N Message "-1390" could not be retrieved. Reason code: "6".

hi,

I want to backup database (db2, aix 5.1) using script. When I exec script
logging to user db2inst1 then is everything ok, but from cron, I get these
error:

SQL10007N Message "-1390" could not be retrieved. Reason code: "6".

Where is the problem?

My script is basic:
db2 connect to database
db2 prune history 2005
db2 backup db database to /sys/db2inst1/backups/

Line in crontab:
0 2 * * 1 /sys/db2inst1/backup.time

--
Wito
Nov 12 '05 #1
6 26357
Hi,

Wito wrote:

SQL10007N Message "-1390" could not be retrieved. Reason code: "6". Where is the problem?

My script is basic:
db2 connect to database
db2 prune history 2005
db2 backup db database to /sys/db2inst1/backups/

Line in crontab:
0 2 * * 1 /sys/db2inst1/backup.time


Have you set the complete users environment in your crontab? If not, do
so. I donīt know much about the cron-version used on aix. Linux cron
daemons usually donīt do any automatic environment setup.
Eg. PATH, DB2INSTANCE need to be set explicitly.

regards,

Norbert
Nov 12 '05 #2
Hi,

Norbert wrote:
Have you set the complete users environment in your crontab? If not, do
so. I donīt know much about the cron-version used on aix. Linux cron
daemons usually donīt do any automatic environment setup.
Eg. PATH, DB2INSTANCE need to be set explicitly.


When I don't set evironment then I get message: "db2 not found". When I set
environment then I get message from the topic. I set it from script, before
executing db2 command. I paste to script all of variables (printenv). Maybe
setting ev. in cron will help? But how can I set it from cron profile?

regards
Wito
Nov 12 '05 #3
Hi again,

Wito wrote:
When I don't set evironment then I get message: "db2 not found". When I set
environment then I get message from the topic. I set it from script, before
executing db2 command. I paste to script all of variables (printenv). Maybe
setting ev. in cron will help? But how can I set it from cron profile?


You should find the answer in your cron-daemons documentation. I donīt
know AIX. Most Linux Systems use vixie cron.

Try

man 5 crontab

---snip---
An active line in a crontab will be either an environment setting or a
cron command. An environment setting is of the form,

name = value

where the spaces around the equal-sign (=) are optional, and
any subsequent non-leading spaces in value will be part of the value
assigned to
name. The value string may be placed in quotes (single or
double, but matching) to preserve leading or trailing blanks.

Several environment variables are set up automatically by the
cron(8) daemon. SHELL is set to /bin/sh, and LOGNAME and HOME are set
from the
/etc/passwd line of the crontab's owner. HOME and SHELL may be
overridden by settings in the crontab; LOGNAME may not.
---snap----

As I said, this one is from the vixie-cron manual page. You would need
to consult your systems documentation to find out how to set environment
variables on your AIX-System or ask your system administrator.

regards,

Norbert
Nov 12 '05 #4
#!/usr/bin/sh
.. /home/db2inst1/.profile ##(after the . leave a space then
/home/db2inst1/.profile where /home/db2inst1/.profile is the home
directory for db2inst1)
/home/db2inst1/sqllib/bin/db2 connect to toolsdb

/home/db2inst1/sqllib/bin/db2 select count(1) from tools.mdtask00
/home/db2inst1/sqllib/bin/db2 connect reset

The above is a sample script.

Hope this helps.

Kums

Nov 12 '05 #5
Hi,
#!/usr/bin/sh
Hope this helps.


It's working!!! Thank you,

Regards
Wito
Nov 12 '05 #6
hi****@gmail.com wrote:
#!/usr/bin/sh
. /home/db2inst1/.profile ##(after the . leave a space then
/home/db2inst1/.profile where /home/db2inst1/.profile is the home
directory for db2inst1)
/home/db2inst1/sqllib/bin/db2 connect to toolsdb

/home/db2inst1/sqllib/bin/db2 select count(1) from tools.mdtask00
/home/db2inst1/sqllib/bin/db2 connect reset

The above is a sample script.

Hope this helps.

Kums


Genrally it's better to load settings from a profile file using:
source /home/db2inst1/.profile than just executing it (depending on the
content of the profile file, it's not always sure that executing the
file will set the environment.)

Instead of loading the user profile, you could try loading the db2
profile using:
source /home/db2inst1/sqllib/db2profile

And if you're the instance user, you can substitute /home/db2inst1 with
the ~

Another time saving option:

instead of calling db2 seperate for each statement you could also place
the statements in 1 sql file and call it with db2 -td\; -f <file.sql>
(not useful if you're parsing output)

-R-
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff Magouirk | last post by:
Dear All, I have written an update trigger that should write a message to an audit table When I try to update any field in the table I recieve the following error message - Stirng or...
2
by: Hartmut Sbosny | last post by:
Hello, I get the linker message `.gnu.linkonce.t._ZN3TNT12CurveTntPlotIdE6handleEi' referenced in section `.rodata' of FollowCurveWindow.o: defined in discarded section...
2
by: Susan Baker | last post by:
Hi, I got this error msg whilst building some classes. It is realatively asy to fix. But I just wondered, does anyone know the technical reason why one can't initialiaze a const static...
0
by: xixi | last post by:
hi, we are running db2 udb v8.1 on windows, when i try to retrieve a view's data , i get the error SQL10007N Message "99999" could not be retrieved. Reason code: "4". what is message 99999? i...
5
by: apple | last post by:
UDBV8 fp 6a - AIX 5.1 We have scheduled cron jobs to do backups. Periodically and starting to occur more frequently, a backup fails with this error: SQL2072N Unable to bind the shared library...
8
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to...
2
by: Andy Davis | last post by:
Dear Group I am trying to automate process of adding a new record id in my form using the following code when the user clicks the "Add New Record" button. For example if the last record id is...
3
by: nan | last post by:
Hi All, I am trying to connect the Database which is installed in AS400 using DB2 Client Version 8 in Windows box. First i created the Catalog, then when i selected the connection type...
5
by: Jon Paal | last post by:
anybody know what causes this error message reported by visual studio just in tiime debugger ? I get it when trying to populate a simple gridview from a datareader. Running locally, the code...
13
by: Michael Bell | last post by:
Working my way through Koenig & Moo "Accelerated C++" and using Borlang Builder 5 (but that is probably not relevant) I reached exercise 1-1 and typed in #include <vcl.h> #pragma hdrstop...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.