473,545 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 26411
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.co m 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
5244
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 Binary data would be trunicated The statement has been termined.
2
2761
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 `.gnu.linkonce.t._ZN3TNT12CurveTntPlotIdE6handleEi' of FollowCurveWindow.o i.e. of the structur
2
4731
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 non-integral data member in a class?
0
588
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 know the view is based on the table, so i do inspect on the table db2 => inspect check table name oeptoly schema njipd for error state all results...
5
5629
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 "". Reason code: "". We are backing up to a file system on the server. Can't find anything in the logs. We can manually resubmit the job 15 or 30...
8
11210
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 update 3 row(s)." Is there a way to prevent the message from popping up?
2
17506
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 "2005001" then I want to increment this by one so that new value is "2005002" and place it in the record id field for the new record on the form....
3
11995
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 as ODBC, then i am getting
5
2113
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 compiles, but after the page renders, I get the debugger popping up and it gives me the following error message "an unhandled...
13
1690
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 #include <iostream> #include <string> int main(int argc, char*argv}
0
7465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.