The IBM DB2 Enterprise Server Edition is a relational model database server developed by IBM. It primarily runs on Unix (namely AIX), Linux, IBM i (formerly OS/400), z/OS and Windows servers.

learn more… | top users | synonyms

1
vote
2answers
595 views

A table with a foreign-key, referencing the tables own primary key

I was looking at the database sample that is provided by the DB2 server installaion. This database is the one created when running db2samle.exe from the "bin" folder. I noticed that the table "ACT" ...
2
votes
1answer
743 views

DB2 Server Table Space Locked

At work we keep receiving the following DataException seemingly at random when one of our processes tries to write/access a table for one of our clients: com.ibm.db.DataException: A database manager ...
0
votes
1answer
660 views

“connectivity libraries needed are not found” error in IBM Data Studio

UPDATE I am getting the following error when I try to create a new database in IBM Data Studio v3.1.1.0. The connectivity libraries that are needed for local or remote non-JDBC operations were not ...
2
votes
2answers
298 views

How can I automate copying DB2 table data between remote Servers?

I have two IBM DB2 servers at separate remote locations. I need to copy data from several tables on one database on the first server to another database in the second server. Previously I've used ...
3
votes
2answers
336 views

IBM DB2 v9.7 HADR TSA failure on the standby server

I have an environment here where I have 2 servers running DB2. One is the primary and the other one is standby. They replicate with HADR and failover is made automatically by TSA. What's the default ...
2
votes
1answer
255 views

How to restore from a backup of a very old version of DB2 (version 6.1 backup)?

I am helping a client with some legacy application that is still running DB2 6.1 on Windows 2000! I am helping them migrate to newer software/hardware infrastructure. I have a backup of the DB2 6.1 ...
2
votes
1answer
1k views

How to restore IBM DB2 database from AIX to Windows?

I had made backup from remote IBM DB2 server in AIX using this command: ./db2 backup database DBEMP to /home/dbemp/backup Then I grab the backup file using FTP Client from my Windows. I run this ...
4
votes
2answers
7k views

How to backup IBM DB2 Database online?

I tried to backup the IBM DB2 (LUW) Database using this command: ./db2 backup database DBEMP to /home/user1/db2bkup But I got this message: SQL1035N The database is currently in use. ...
3
votes
2answers
2k views

DB2 will not INSERT into Created Temp Table that I created

I normally use SQL Server but for this project I'm having to learn DB2. If I can get the below code to work I'm set for the whole project. Below is a elementary example of what I cannot get to work. ...
1
vote
1answer
3k views

IBM DB2 Database name not found but I can connect using IBM Data Studio. What happened?

In IBM Data Studio, I can create a connection to a remote IBM DB2 LUW database named DBEMP and browse the schema and data. Here is the steps to create the database connection: From IBM Data Studio, ...
1
vote
1answer
179 views

SQL Index order and performance based on cardinality and data

I've been working quite a bit on a query that's not operating very efficiently on a DB2 database. The thing will return up to 30k rows or so and take up to 10 seconds. I've been working on getting ...
1
vote
1answer
2k views

How to run DB Admin Tool (GUI) in IBM DB2 Express-C?

I had installed IBM DB2 Express-C in Windows but I can't find any shortcut to launch the Administration Tools (GUI). When installing, I had selected "Administration Tool" option (I had checked twice ...
1
vote
2answers
946 views

Adding User access to DB2

I have installed DB2 10.1 in a Red hat box. During the installation I was asked to create several users (db2inst1, db2fenc1 etc). I have been using db2inst1 to perform all operations with DB2 and it ...
1
vote
0answers
203 views

Application using DB2 not launching due to Win 8

My application uses DB2. It is working fine in Win 7, but not launching in Win 8. Giving error System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net ...
1
vote
0answers
404 views

DB2 Load Failure due to timestampformat

I'm trying to load a file into DB2 database table using DB2 Load. I'm able to load the file, using the following statement from the unix prompt. db2 +p -x load from BOM_Sales_20130326.txt of DEL ...
1
vote
1answer
774 views

Immediate refresh materialized views (MQT) with OUTER JOIN under DB2

DB2 accepts a materialized view based on an "OUTER JOIN" query, as long it doesn't refresh automatically (REFRESH IMMEDIATE). I cannot find a simple solution to get round this problem. Perhaps with ...
2
votes
2answers
323 views

SQL3550W: … target column has been defined as GENERATED ALWAYS

I am trying to export + import data from a table in a db2 database to another. But while running the export command I am getting the following error. SQL3550W The field value in row "26" and column ...
4
votes
2answers
1k views

List DB2 backups

Is there a way to list the DB2 backups? All I can find is db2 list history backup all for <dbname> but I think you need to check through all of those to see if they've since been deleted. This ...
0
votes
1answer
75 views

DB2 PureScale on Linux

Searching for DB2 PureScale supported hardware, I can see that for Linux distributions only, some System X and IBM BladeCenter BladeCenter HS22 are listed. If I try to install PuseScale on a Fujitsu ...
1
vote
1answer
478 views

db2 tables altered, reorg

When I alter a table in DB, I need to reorg it: Call Sysproc.admin_cmd ('reorg Table myTable'); if I had done many modifications, how can I know which tables need a reorg?
1
vote
1answer
87 views

Determine if existing Trigger acts on field DB2

I am eventually going to be writing a trigger on a field named "user2". Currently most of the values in this field are blank, but there are some seemingly random rows with values of '00' for the ...
3
votes
1answer
370 views

Dutch characters in DB2 problem

Ok, first of all, I have really limited knowledge about databases. Problem that I have is next: I inserted few rows with data that contains Dutch characters, such as names of different countries. ...
1
vote
1answer
360 views

Sending a mail using DB2's Proceude UTL_MAIL

I'm trying to send mail from DB2 using the procedure UTL_MAIL. I'm using the DB2 Express Edition 10.1. First I was getting the error of SMTP Server. After using the below command, update admin cfg ...
2
votes
2answers
432 views

DB2 UPDATE TRIGGER

I am trying to create a trigger in a DB2 database that runs on the update of a column in one table, and then fills in another table with certain values. For example, there is a power unit table with ...
1
vote
2answers
2k views

set integrity not enforced in DB2

I am a bit confused with the SET INTEGRITY concept in DB2, why we can OFF the set integrity check to put the table in PENDING state ? does that mean that we can neglect the constraint definitions on ...
6
votes
6answers
3k views

On DB2, who updated a record and what did the record look like before the update?

(SQL Server 2008 R2 Standard, database under full recovery) I have a table with fields id, firstname, lastname. A statement is executed: insert into dbo.sometable (id, firstname, lastname) values ...
1
vote
1answer
889 views

db INDEX on ORDER BY FIELD in very simple query does not help - still slow response?

I have very simple query which returns 200K records very slow (20 seconds). SELECT * FROM TABLE ORDER BY ID DESC If I do just SELECT * FROM TABLE it returns quick result. I created INDEX on ...
1
vote
2answers
1k views

How do I add a database in IBM DB2

I'm supposed to migrate a MySQL database into IBM DB2, but I thought I'd take baby steps first before I do something like that. So for now, I'd just like to add a database. I'll admit that I have no ...
2
votes
3answers
2k views

How do i subtract a number of days from a prepared statement parameter in db2?

I have a C# application using OLEDB to connect to a DB2 database. Basically, I want to do this: SELECT CALC.WEEK, COUNT(CALC.ID) AS TRANSACTIONS , SUM(CALC.SUBTOTAL) AS REVENUE FROM ( ...
3
votes
2answers
1k views

CREATE INDEX for long columns

I am looking for alternative to create index on long column: create table line ( field_key integer not null, value varchar(4000), ... ); create index key_value_idx on line ...
1
vote
1answer
657 views

Is storing archive logs on local disk and backups on vendor storage possible?

I am using DB2 9.7. My LOGARCHMETH1 is set to VENDOR library. Example: LOGARCHMETH1=VENDOR:/usr/openv/netbackup/bin/nbdb2.sl64 Is it possible to call the following backup command: db2 backup ...
1
vote
1answer
108 views

Online backups with VENDOR library: what should be set for ACTIVE LOG PATH?

My customer is using Veritas NetBackup so we use its library file in the LOGARCHMETH1 parameter for the VENDOR option. That is for archive logging path. What path should be set for ACTIVE LOG PATH ...
1
vote
1answer
276 views

DB2 online restore - “SQL1035N The database is currently in use.”

I am trying to do ONLINE RESTORE ROLLFORWARDING TO END OF LOGS AND COMPLETE. When I run this command I am getting error SQL1035N The database is currently in use. It does not allow any connections to ...
1
vote
1answer
195 views

Database comparison tool for IBM db2 like OPatch?

I am looking for a database comparison tool for IBM DB2. I was wondering if there is a utility for IBM DB2 similar to OPatch in Oracle's db 11g?
1
vote
1answer
170 views

DB2 DBM paramter NUMDB has value 8. Should I change it to 1 because I have only one database?

Hello I am using IBM Maximo application which is using DB2 database and I have created only one database. I heard that when paramtere NUMDB has value 8 it will divide all values in DB CONFIGURATION ...
1
vote
1answer
132 views

DB2 9.7 - Find rows inserted by a specific trigger

We are auditing a table TRANSACTIONS that inserts a row in HISTORY_TRANSACTIONS when specific columns are changed. These inserts happen through a number of triggers defined on TRANSACTIONS table. Is ...
1
vote
1answer
208 views

db2 express c mac osx

I'm experiencing some troubles with the execution of DB2 express c on Mac OSX 10.6 Snow Leopard. I have installed the db system, creating two users, db2 and db2-user. The latter is the instance ...
2
votes
1answer
426 views

How to create Buffer Pool in Database dedicated only for ONE BIG table?

I have table TICKET with 400K records in database (DB2). I wish to create one huge buffer pool which will be dedicated only to this one big table for faster response. What are the steps to do it? ...
3
votes
2answers
547 views

DB2 error - SQL Statement too long or complex

Getting this error in a DB2 production system: ERROR [HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0101 - SQL statement too long or complex. The statement has a large number of OR ...
2
votes
1answer
552 views

copy schema across different physical databases in db2

Is there any way to programatically copy across schema (i.e. tables,functions,views) etc from one database over to another one. Assuming both are running same versions of DB2. I found a few utilities ...
2
votes
1answer
539 views

Does DB2 have equivalents for Oracle's UTL_ENCODE and UTL_RAW modules?

I'm looking for something similar to: utl_smtp.command(conn, utl_encode.base64_encode(utl_raw.cast_to_raw(<username>))); I couldn't find any reference among the DB2's system-defined modules ...
0
votes
1answer
407 views

Preloading a Java library in DB2, similar to ORACLE's loadjava

Edit to add details to clarify, based on Chris' comment: A Java stored procedure depends on external libraries. Locally it compiles successfully, since they are added to the classpath. But when ...
3
votes
1answer
1k views

DB2: Is it good to create the index table space to use 32 KB data page

I found our DB2 server configs all the index into one table space. And it then defines the table space to use 32kb data page. Is this good? How to judge it? Any advice is welcome.
1
vote
1answer
139 views

What is the locking behavior for Updatable/Insertable Views?

Consider I have a View that is merely a simple join between 2 tables, selecting all columns. The View is Updatable and Insertable. What would be the locking behavior when executing an UPDATE or ...
1
vote
1answer
156 views

Cannot execute stored proc linked to C routine in DB2

DB2 version: 9.7.0.6 OS: RHEL 5 Here are the steps I took to create and bind a C routine to DB2: 1> Created myprog.sqC file 2> Executed db2 prep myprog.sql bindfile 3> Executed db2 bind myprog.bnd ...
3
votes
3answers
866 views

Is it a good practice to apply Vertical Partition to a newly created model?

Suppose you are modeling the ER model for a new Object Oriented Web Application. There is a table with 20 columns, and there are going to be a lot of INSERTs populating 10 columns, and a lot of ...
4
votes
2answers
1k views

How do you set the pagesize, codeset and table space when creating a database in DB2?

I want to create a database in DB2. I found some information on this page I want to use only some options which are explained on the page: PAGESIZE CODESET TABLESPACE Then, I want to ...
1
vote
1answer
682 views

How do I use the unload command to export a table to a IXF file

For a table T in schema S, how do I use the unload command to export T data into a IXF file? The IBM DB2 documentation isn't very helpful for this simple case. I am trying to compare performance ...
4
votes
1answer
175 views

Specifying the node to connect in db2

I have 2 nodes in my db2 catalog. How would I include the node on which I want to connect inside the db2 connect paramters? Node 1 entry: Node name = DB2HOST1 Comment ...
2
votes
3answers
1k views

How do I join two tables on two different instances of DB2?

There are two instances of DB2 running on the same machine. One has a table aliased to the a table in the other one. Is there a way to do this in DB2 or does it have to be done via an external tool? ...