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.
2
votes
3answers
239 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 ...
2
votes
3answers
175 views
Learning DB2 without a local install
I will be starting a new job in about 5 weeks, and want to spend some private time really getting to grips with as many of DB2s features as possible, as it is the DB used in the new company.
Am I ...
2
votes
3answers
785 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?
...
2
votes
2answers
1k views
DB2 Trigger: only update current row
I've created following trigger :
CREATE TRIGGER probeer2
AFTER INSERT ON libtn01leb.kofax_release
FOR EACH ROW
UPDATE libtn01leb.kofax_release SET RRNR='bleh'
This trigger will update EVERY ...
2
votes
2answers
30 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. ...
2
votes
1answer
206 views
DB2 equivalent to T-SQL's REPLICATE?
In T-SQL there is a method, REPLICATE(char,N), which will make a string with N values of a certain character. This is very helpful when querying into JDE.
Does anyone know if there is a DB2 ...
2
votes
2answers
564 views
altering a db2 table with huge amount of data
I have a table in DB2 which is having 99 columns and 900,000 records of data.
I want to alter the table with one extra column as below:
ALTER TABLE MYSCHEMA.PRODUCT ADD UPDATE_DT DATE
However, the ...
2
votes
1answer
288 views
query to find closest lesser date
I have a table with rates. each rate has an effective starting date. (the ending date of any rate is implied by the existence of a record with a newer effective starting date.)
I also have a table ...
2
votes
1answer
115 views
How to choose working database in DB2?
In SQL server I can use the USE statement to switch between working databases. Is there a similar command for DB2?
2
votes
2answers
489 views
Do I need to RUNSTATS after a REORG in DB2?
The REORG documentation says:
BUILD
Builds indexes. Updates index statistics.
But I have always heard REORG/RUNSTATS as if they should be paired. Can anyone verify that "Updates index ...
2
votes
3answers
620 views
db2 range partitioning attach and detach issue
We have a table which is used in many select Queries, as it is be accessed by customers to fetch their information. Also they can change their information too whenever they want.
We had to retrieve ...
2
votes
1answer
799 views
DROP SCHEMA in db2
How do I drop a schema in db2 if it has got some objects in it?
db2 DROP SCHEMA SCHEMA_NAME
For some reason I am not able to drop the tables in the schema, so how can I force to drop the ...
2
votes
1answer
488 views
DB2: database hangs while trying to execute simple select query on specific table
No errors or warnings, database just hangs while trying to execute simple select query on specific table. Other tables are accessible until I trying to query specific (faulty) table.
This should not ...
2
votes
1answer
172 views
In DB2, what are the alternative ways of evaluating an index's (or several indexes) benefit?
I'm trying to evaluate different approaches to analyzing the benefit of changing the set of indexes that are available. If I pick some representative queries from my workload, I can run EXPLAIN and ...
2
votes
1answer
532 views
What are the best practices for ETL of data from one OLTP system to another?
First off, I want to post that I am a developer and not a DBA, so I am trying to approach this from the standpoint of what is the best thing to do, rather than just assuming I can do everything ...
2
votes
1answer
1k views
Migration from DB2 to MySQL
Does any one have experience on migration from DB2 to MySQL ?
Please share with me.
I tried googling, but I have not received much information on this.
2
votes
2answers
32 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 ...
2
votes
2answers
78 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 ...
2
votes
1answer
132 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?
...
2
votes
3answers
510 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 (
...
2
votes
1answer
923 views
DB2 Express on Windows 7 - Disable security?
I'm trying to install DB2 Express-C on my PC (Windows 7 pro), but no matter how I've installed or configured it, I can't grant the ability to create databases to my windows domain account. No matter ...
2
votes
1answer
731 views
Parallel inserts cause deadlock on DB2
The scenario is the following: The application attempts to insert into the same table from two parallel threads making 4000 insertions in each thread (separate transaction per thread). It causes the ...
2
votes
1answer
272 views
Memory limitations on db2 express-c version 10.1 seems stuck at 2 gig, why?
I just updated from 9.7 to 10.1, to leverage the new 4gig memory limitation. However, my app only appears to be using 2. So i searched for a way to find out how memory is used and found this ...
2
votes
1answer
137 views
DB2 Count problem
We have a query that returns over 20,000 rows on some occasions but times out due to the large amount of data.
We have written a COUNT(*) query to throw an error if the record count is more than ...
2
votes
1answer
100 views
DB2: Is it good to create the LONG table space to use 32 KB data page
Our DB2 database(V9.7) has only defined one table space to store all the big object like xml.
And xml size could be different. Some are about 2kb average. And some are 7kb average.
So does it make ...
2
votes
1answer
695 views
DB2 LOAD data into table - Interpreting the error messages
I encountered some constraint issues when loading data from file into table
**
SQL3109N The utility is beginning to load data from file
"xag".
SQL3500W The utility is beginning the "LOAD" phase at ...
2
votes
2answers
366 views
Syntax changes between DB2 for i (DB2/400) v5r4 and v6r1
Does anyone know where can I find list of syntax changes between DB2 for i v5r4 and v6r1?
We are currently migrating a backing database for an application from DB2 for i v5r4 to v6r1 and found out ...
2
votes
1answer
292 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 ...
2
votes
2answers
388 views
What is the recommended Buffer Pool size on a 2GB RAM PC?
I installed DB2 Express-C on a PC with 2 GB RAM and running Windows Server 2008 R2 OS. While creating a new database, there is an option to set Buffer Pool size with default set to 4K.
How much is ...
2
votes
1answer
379 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
339 views
Can High Water Mark be cleared?
Lately I experience below errors when restoring db2 database
SQL2043N Unable to start a child process or thread
SQL1084C Shared memory segments cannot be allocated
db2stop and then db2start ...
2
votes
1answer
216 views
How do you convert IBM DB2's recursive increment to MySQL version?
DB2 Queries:
WITH
TABLE1 (YEAR_END) as( VALUES
(2011))
,
TABLE2
(YEAR_END) AS ( VALUES(2011))
,
TABLE3 (YEARS) AS ( SELECT 0+2008 FROM TABLE1 T1, TABLE2 T2
union ...
2
votes
1answer
31 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 ...
2
votes
1answer
110 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 ...
2
votes
1answer
502 views
Cannot install DB2 Express C 10.1 on Mac OS X 10.7.5
When I invoke ./db2setup it cannot find the JRE where it expects it. Binary for Java not found as follows:
/private/tmp/db2/expc/db2/macos/install/db2setup: line 606: ...
1
vote
2answers
455 views
Table orders regarding Nested loop join in DB2
First I would like to cite the existing post Table order in Join Query
so the author is saying that the table order really doesn't make things(result, access plan)different. I have doubt on this ...
1
vote
2answers
604 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 ...
1
vote
2answers
183 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
4answers
371 views
Backup and restore of RDBMS(Oracle, DB2, SQL Server) from Perl
What could be the best approach ?
Till now could figure out the following (Oracle)
Calling exp.exe and imp.exe utilities in Oracle client using Java and inturn call it from Perl.
Calling exp.exe ...
1
vote
1answer
331 views
What does HSJOIN mean in an Explain Plan?
I have the following EXPLAIN PLAN results from a query on my DB2 database.
0 SELECT STATEMENT ( Estimated Costs = 5.928E+02 [timerons] )
1 RETURN
2 HSJOIN
3 [O] ...
1
vote
2answers
42 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. ...
1
vote
3answers
50 views
Transfer data from DB2 to Oracle
I want to transfer data from an old DB2 system to a new Oracle database.
How should I go about doing this?
1
vote
1answer
61 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
...
1
vote
1answer
227 views
IBM DB2 - store large files
I want to store large files in a DB2 database and I need more information about which is the best technique to use as I am new in this IBM product (previous experience with T-SQL only).
The ...
1
vote
1answer
170 views
Analyzing TCB Index Status for DB2
The Following is the TCB index that I could get using a command for my DB2 database. I don't know how to analyze it. Which columns are important? What do they mean?
TCB Index Stats:
Address ...
1
vote
1answer
31 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
1answer
18 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
70 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 ...
1
vote
1answer
49 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
63 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 ...
