by Vikram Khatri | Sep 21, 2007
When DB2 agent (db2bp process) makes a connection for your CONNECT request, it stores the IP address of the client in the application ID as shown below: $ db2 list applications Auth Id Application Appl. Application Id DB # of Name Handle Name Agents...
by Vikram Khatri | Sep 20, 2007
How do I know what is installed in DB2? Is there a way, I can determine about hidden components installed in DB2? How do I know which language packs are installed in DB2? Sometime, you might want to know answers about above questions. Normally, you will run db2level...
by Vikram Khatri | Sep 14, 2007
If you are converting from Sybase, you might run into issues for converting INT to HEX. In Sybase: 1> select inttohex(234) 2> go ——– 000000EA (1 row affected) In DB2: DB2 => values hex(234) 1 ——– EA000000 If you want the same exact...
by Vikram Khatri | Aug 30, 2007
Did you get this DB2 SQL1035N error if you were trying to take offline backup? The error is obvious as someone is connected to the database and you cannot take offline database backup. There are several solution that you can take to do offline backup when you get SQL...
by Vikram Khatri | Aug 29, 2007
Did somebody create a DB2 database for you and you are just getting started to work on inherited legacy? How do you find if the database was created with automatic storage YES or NO? Let us do a simple exercise. My laptop has two drives C: and D: and I have DB2 9...
by Vikram Khatri | Aug 9, 2007
Did you ever wonder what is cursor blocking or row blocking in DB2? Cursor or Row blocking in DB2 is a way to fetch number of rows in a single operation. This can improve performance of the applications. There are 3 types of blocking which can be used for your...
by Vikram Khatri | May 20, 2007
DB2 provides a tool db2dclgn that you can use effectively as an aid in your C/C++ or Java coding efforts. The example shown here is for embedded SQL in C. Create a table for demo CREATE TABLE “EXE”.”CUTION” ( “UT_UD” BIGINT NOT NULL...
by Vikram Khatri | May 18, 2007
Did you ever know how powerful MERGE is in DB2? Let me demonstrate that to you through this simple example. Create a table $ db2 connect to sample $ db2 “create table fmtmerge (c1 int not null generated always as identity primary key, c2 decimal(13,4) not null,...
by Vikram Khatri | May 17, 2007
The following program is an example of CLI and embedded SQL statements in the same C program to perform array inserts to achieve high performance. Why do you need to use a mixture of CLI and embedded SQL program? Sometimes, it is desirable from the coding perspective...
by Vikram Khatri | May 16, 2007
Say for an example, you want to increment a column whenever a user logs in using an application for audit purpose. Normally in a single unit of work, DB2 will guarantee the data and there will not be an issue of concurrency if you use an INSERT and do an UPDATE upon...
by Vikram Khatri | May 16, 2007
If you are writing embedded SQL application using C/C++ or SQLJ application using Java, you will come across an issue about how to use DB2 PREPARE statement effectively in your application code. When I talk to Oracle or SQL Server DBA, they all seem to have an...
by Vikram Khatri | May 16, 2007
The concept of packages in DB2 conflicts with the package understanding that comes with an Oracle DBA who is expanding his/her horizon to include DB2 as an added skill-set. Please refer to this excellent article...
by Vikram Khatri | Apr 13, 2007
When you use embedded SQL in your C/C++ code, you first run PREP command to process all EXEC SQL statements in your source. The PREP step happens before C/C++ compiler is able to invoke its preprocessor that will include header files, expand trigraph and replace...
by Vikram Khatri | Mar 14, 2007
I am trying to install Tomcat to test DB2 web services and I ran into several problems on my Fedora Core 5 server to start the Tomcat server. This is how I solved this. I found this problem widely reported but very few instructions to solve the problem. Install...
by Vikram Khatri | Mar 13, 2007
If you are migrating other database data to db2 and encounter a timestamp like 2007-03-07 19:30:00+05, you will need to adjust the timestamp correctly if you are in a different time zone. I used this Java function to massage the timestamp properly so that I get the...
by Vikram Khatri | Mar 6, 2007
If you are trying to install a jar file using sqlj.install_jar command and getting SQL4302N error, you may follow these steps to fix this problem. These may not work exactly in the same manner for you but it will give you some insight as how to fix this issue. This...
by Vikram Khatri | Mar 6, 2007
When you create a DB2 instance in Unix, you have the option of specifying a fenced user-id different than instance owner. The purpose of fenced user id is to protect DB2 from untested or malicious code from the external stored procedures, user defined functions etc....
by Vikram Khatri | Mar 2, 2007
When you need to load the data on DB2 server and the data files reside somewhere else, you need to FTP or copy them to the server. You can take help from a sample Perl driver program provided in your sqllib/samples/autoloader/loadFtpFtc.pl.
by Vikram Khatri | Mar 2, 2007
Normally, you would run the DB2 LOAD on the DB2 server. But, when you try to run DB2 LOAD from a client, you need to take care of few things. A sample DB2 LOAD script that runs well on Server. SET CURRENT SCHEMA=”ADMIN”; LOAD FROM...
by Vikram Khatri | Feb 15, 2007
If you are planning to use PHP with DB2 Express-C on Linux, you will need PHP extension for the DB2. The same extension will also work for IBM Cloudscape or Apache Derby databases. [Note: The instructions here are for the Redhat Linux and you will need slight...