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

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 ( ...
2
votes
1answer
3k 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
255 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
1answer
2k 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
2answers
2k 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 ...
4
votes
2answers
816 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
184 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 ...
1
vote
1answer
257 views

What program to use for the best compression ratio for DB2 log files?

What linux program to use to compress DB2 log files with the best compression ratio? UPDATE I thought that these log files would be text type files. But viewing them didn't prove this. I tried to ...
1
vote
1answer
950 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
221 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?
5
votes
2answers
6k views

SQL Server Express vs. Oracle Express Edition vs DB2 Express-C

I have been trying to compare the features of the SQL Server Express, Oracle XE and DB2 Express-C, but find it difficult to compile all the differences into one place. Especially the current ...
3
votes
1answer
312 views

DB2 Express-C 10.1 database move to DB2 Work group Server/Enterprise Edition

I have not done such migration before and I want to know if I am going to face such issues when moving my database (tables,views,table-spaces,functions,procedures,etc.) to other DB2 distribution. If ...
3
votes
3answers
672 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 ...
3
votes
1answer
2k 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.
2
votes
1answer
338 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 ...
1
vote
4answers
574 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
530 views

Within a RHEL 6.3 + High Reliability Add-on, how do I add DB2 (v9.7) into a service group to have the service controlled by the cluster?

I have a cluster of machines running RHEL 6.3 with the High Reliability Add-on. I have configured a Clustered Logical Volume Manager (CLVM) file system for DB2, which is working correctly. Our DBA's ...
2
votes
3answers
2k 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 ...
1
vote
1answer
2k views

Install db2 express c on Mac OSX

I have posted the question yesterday, then I was able to figure it out by myself. As I haven't found any complete guide, I'm writing down the steps just in case. So the question is: "How do I ...
1
vote
1answer
215 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 ...
1
vote
1answer
206 views

Should indexes automatically be placed into their own bufferpool?

We work with DB2 LUW (specifically we are currently on 9.7 FP4) running on AIX. Per best practices from IBM, they recommend that when you build a table, you place the data, the indexes, and LOBs/LONG ...
4
votes
2answers
947 views

Replicate DB2 table to SQL Server 2008

I need to replicate data from a DB2 database into a SQL Server Database (along the lines of about 80 tables). I can create an SSIS package, to just flat copy the data from one to another pretty easy, ...
1
vote
2answers
867 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 ...
2
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
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 ...
3
votes
2answers
2k views

Problem installing DB2Express

I installed DB2 Express 10.1 on my Windows 7 (64bit) notebook. Now after the installation finished I cannot connect to the database. During the installation I specified "C:\Daten\db\db2" as the ...
4
votes
2answers
408 views

Can I optimize for the zIIP processor?

Is it possible to change SQL in a z/OS mainframe COBOL application so that it becomes eligible to be directed to the IBM System z Integrated Information Processor (zIIP)?
3
votes
1answer
2k views

eliminate extra spaces in VARCHAR columns

In a table, I have an ID column defined as BIGINT(8) and one VOUCHER column that is VARCHAR(100). No matter the actual length of the value in that field, the SQL always returns a full length value, ...
2
votes
1answer
772 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 ...
3
votes
1answer
2k views

Filtering on a virtual column from a UNION ALL with LEFT OUTER join causes a table scan?

I asked this question on SO but havn't got many bites and even a vote to close for being "Off Topic." So, I thought this stack exchange might be better suited. Consider the following SQL... SELECT ...
2
votes
3answers
1k 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 ...
6
votes
2answers
900 views

Stored Procedures Best Practices: Fenced or Unfenced?

I believe I understand the reasons behind fenced and unfenced stored procedures. Fenced run "outside" of the database (in our case DB2) so as to prevent possible corruption of the database engine ...
1
vote
3answers
3k views

What is the purpose of having a table NOT LOGGED INITIALLY

I came across this recently. When defining a table in DB2 LUW (at least 9.5 or higher), you can define it as NOT LOGGED INITIALLY. Example from the book I read: CREATE TABLE products ( productID ...
2
votes
2answers
790 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
629 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
451 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 ...
2
votes
2answers
622 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 ...
-1
votes
1answer
318 views

Important distinctions between DBMSs [closed]

DBA is a career I'm strongly considering after school, but my limited experience mostly involves some PL/SQL Oracle web programming, some basic PHP/MySQL web pages, and some queries in SQL Server. ...
1
vote
1answer
308 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 ...
7
votes
1answer
8k views

What exactly is binding in DB2?

I recently crossed over from being a Java developer to an actual DBA in our company. I am learning the ropes, so to speak, about being a DBA (which is actually somewhat of a new position for our ...
5
votes
1answer
9k views

Cannot connect to DB2 database after restoring an offline backup

This is for DB2 9.7 Enterprise Server Edition on AIX. I had a full, offline backup taken of several databases within our instance in a performance environment. I wanted to restore these databases to ...
3
votes
2answers
2k views

DB2 Express-C on Mac OS X

I have followed all the steps described on the Getting Started with DB2 Express v9.7 e-book and installed DB2 Express-C on my Mac. The installation succeeded without a problem. I did setup OS X ...
2
votes
1answer
2k 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 ...
5
votes
1answer
1k views

How do I resolve this data source connection issue with Cognos?

We have (fairly recently) installed IBM's Cognos 10 as our business intelligence reporting tool. Most of the databases that we report over are DB2 9.7 LUW Enterprise Edition. We installed the DB2 ...
4
votes
2answers
2k views

Why do I get leading zeros when converting from decimal to char in a db2 query?

I have a column named length defined as: TYPE_NAME: DECIMAL DATA_TYPE: 3 COLUMN_SIZE: 9 BUFFER_LENGTH: 11 DECIMAL_DIGITS: 5 NUM_PREC_RADIX: 10 When I run the following select: select ...
2
votes
1answer
602 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 ...
1
vote
1answer
96 views

Are there any guidelines for the “IBM Premier Level Business Partner”? [closed]

Our company currently subcontracts a DB2 project to a company which have "IBM Premier Level Business Partner". I was just wondering, are there any guideline about what they should provide (say, SQAP, ...
4
votes
2answers
852 views

What are the available options to backup DB2 Express-C?

I want to use DB2 Express-C edition with my application. I have never used DB2 but now want to use the Express Edition in a production environment to learn more about it. I want to know what are the ...
3
votes
1answer
2k views

DB2 9.5 How to get tablespace monitor information?

How can I get information about tablespace in DB2 9.5? I need to review information about if the autoresize option is enabled or disabled.
2
votes
2answers
878 views

In DB2, how can I disable NLJOIN?

I want to indicate to the optimizer, via SET or optimization profiles, that NLJOIN shouldn't be used at all when optimizing a query. I've been looking for this for a while without any success. I ...