Problem resolution with DB2 database products

db2 tutorial, db2 performance tuning, db2 tools, db2 commands, db2 administration




Archive for June, 2010

How to resolve foreign key change during import?

Hello,
I have to implement the following requirement: from an application, a
user can export some info retrieved from DB2, and later import the
info into another DB2 on another machine. The user is not supposed to
be knowledgeable about DB2, so he is not expected to manipulate the
data between the export and import. I have thought of the following
method: use the DB2 export and import utilities, and use DEL as file
format. The export will result in a file with data from a parent
table, and several other files with data from bunch of dependent
tables that have references to the parent table via foreign keys. I’ll
import the parent table with ‘modified by identityignore’ option, in
which case the primary key value will be different from the original
one, which means all the foreign key values in other files have to be
modified to the new value during import. Is there a way to do so with
DB2?
Thanks.

posted by admin in Uncategorized and have No Comments

newbie: offline backup/restore

UDB 8.1
circular logging

I have a backup that was taken offline. Does the database need to be
deactivated first before restoring that backup?

Chuck
Remove "_nospam" to reply by email

posted by admin in Uncategorized and have Comment (1)

buffer_pool_services sqlbStartPools Probe:2

Hello,
Trying to create new DMS TS, when run command to create receive error:

2004-04-20-16.23.16.444283   Instance:clldb201   Node:000
PID:8052(db2agent (CLLDB00))   Appid:*LOCAL.clldb201.040420201838
buffer_pool_services  sqlbStartPools   Probe:2   Database:CLLDB00

Tablespace 3 was mapped to BufferPool 2 which does not exist or
currently is the wrong pagesize.
It will be mapped to BufferPool 1.

if do db2stop/db2start using Instance owner and try again same command
works with no problem.

System info:
DB2 UDB 7.2.8 Linux/s390.
level:
DB21085I  Instance "clldb201" uses DB2 code release "SQL07028" with
level
identifier "03090105" and informational tokens "DB2 v7.1.0.88",
"s030813" and
"MI00067".

Any idea / suggestion?

Thanks

posted by admin in Uncategorized and have Comments (2)

Is there an easy to copy a table: structure and data?

For testing purposes I propose to add a schema (testing, how original)
and would like to copy some of my live tables to it, both structure and
data. I know I could use something like dump/restore for the data and
Quest’s (BTW this a very nice product) ‘create like’ function. That
would work, but it seems a lot of work for something DB2 should know how
to do.

posted by admin in Uncategorized and have Comments (2)

Long time before connection

Hi all,

I’m using DB2 Express 8.1 on windows 2000 professional.
I set up local authentication(db2set db2_grp_lookup=local),
and I created a local group MYGRP on my machine,
which is now the administrator’s group of my DB2 DB
(db2 update dbm cfg using sysadm_group MYGRP).
I created the local user profile MYUser, which belongs
to the local group MYGRP. My machine is a member of a
Windows 2000 domain.
I use DB2 through a Java application using JDBC.
When I’m at office and the network card is connected
to the network in which there is the domain controller
of my domain, I connect to db2 using MyUser. In this case
the authentication process is very fast. But when I’m not
at office, and so my machine can’t reach the domain
controller, the authentication process takes a very long
time, (about 30/40 seconds). I think that’s because DB2
tries to find the domain controller to authenticate MyUser,
before asking to the local machine. Note that the
authentication works fine after this "time-out".
How can I avoid this problem?

Thanks a lot.

Bye

Franco

posted by admin in Uncategorized and have Comment (1)

disconnect command

Hi,
we are using db2 8.1 on Linux. I’d like to close all open connection at
a defined time point. Therfore I wrote a sql script including the command

disconnect all

or

release all

Unfortunately, a warning returns telling me that a database connection
doesn’t exists. If I use the command

list applications

then I see a list of open connection.

Question: How can I close all these open connections?

Thanks, Toralf

posted by admin in Uncategorized and have Comments (5)

Question about optiload

Is there anyone who has experience with a third party software called
"Optiload"? This tool allows fast insert and updates to UDB tables. We
have Unix Server and UDB V7.
The problem we have is while optiload is performing insert and updates
to table, the particular table is completely locked. Users are unable
to do select on the table.

Does anyone face the same problem and how to overcome this.

Thanks

posted by admin in Uncategorized and have Comments (2)

ODBC doesn't support stored procedures? This can't be true

In Chip Irek’s "A PRIMER ON USING DB2 WITH .NET" (www.15seconds.com),
he states that "…ODBC doesn’t support DB2 stored procedures. So if
you are building an application heavily dependant on stored
procedures, you need to eliminate ODBC as your access method and
consider OleDb or the managed provider."

Mr Irek is an IBM Architect with Global Services and according to the
article, someone with .NET experience.

Now, I’d ask Mr Irek this question myself, but my email comes back
undeliverable.

Does he mean this for just for .NET applications? This can’t mean for
all applications.

Any IBM colleague of Mr Irek able to clarify this?

posted by admin in Uncategorized and have Comments (12)

Problems creating stored procedure

I am running DB2 Express V 8.1 on Windows XP
I have installed the Visual C/C++ compiler the command to invoke the
compiler is cl

I am attempting to install the stored procedure defined below

CREATE PROCEDURE TESTQC.ECMP2000

(INOUT str VARCHAR(32) for bit data)

RESULT SETS 0

LANGUAGE SQL

BEGIN

SET str = ‘STRING’;

END

@

with the following command in  the command line prompt

db2 -v -td@ -f testproc.sql

I obtain the following error message

DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL7032N  SQL procedure "ECMP2000" not created.  Diagnostic file is
"P4080374.log".  SQLSTATE=42904

Where is  the file P4080374.log located? Could it be a problem the the the c
compiler. I have ensured that it is within the path of the command processor
window I am using.

On another note when I to use the development center obtain an error
concerning nmake not being found

Is  there a document that comprehensively  describes how t o use these
products

Thanks

Solomon

posted by admin in Uncategorized and have Comment (1)

tablespace scan, but not table scan

just got out of a "class" on EXPLAIN, from a 390/v6 maven.  was told
that ACCESSTYPE = ‘R’ in the plan_table meant a TableSpace scan.
hmmmm.  next step up (or down, depending on your outlook) wasn’t a
Table Scan.  

thought this might be a MainFrame thing; but a look at DB2Info on my
UDB 7.2 server showed the same thing.

this is truly puzzling.  is there an explanation of EXPLAIN which
describes how to get a Table Scan????  or are we stuck with a scan
of the TableSpace if there is no index support on the Table???  nothing
in between??

thanks,
robert

posted by admin in Uncategorized and have Comments (3)