by Vikram Khatri | May 27, 2009
Starting version DB2 9.7, you can use following query to detect unused indexes in DB2. SELECT INDSCHEMA, INDNAME, TABNAME FROM SYSCAT.INDEXES WHERE LASTUSED = ’01/01/0001′; The column LASTUSED tells when that index was last accessed in DB2. This is not per...
by Vikram Khatri | May 20, 2009
I am going to show you an easy way to do online schema changes in DB2. The best to learn things is by doing some simple examples. My intent is to make you an expert in 1/2 hour if you learn the following concepts. Create a database with and without automatic storage...
by Vikram Khatri | Apr 30, 2009
Finally DB2 implemented a long standing demand for setting the Java application name so that you could see the name through DB2 utilities instead of seeing db2jcc_applica. You set a connection property clientProgramName to your chosen name and the db2 utilities will...
by Vikram Khatri | Apr 22, 2009
Use this DB2 Stored Procedure to build an INSERT statement. This is very useful when you are developing some Java or .Net program or any other program and need an easy way to do this. Thanks to Serge Rielau of DB2 Toronto lab for sharing this with the DB2 community....
by Vikram Khatri | Mar 5, 2009
Thanks to Serge Rielau for insight in DB2 MERGE. For example, if you have this Oracle UPDATE statement and wondering how can you use this in DB2. Here is the solution. Oracle UPDATE UPDATE ( SELECT clm.c2 wc1, m.c2 wc2 FROM schema1.table1 m, schema1.table2 clm WHERE...
by Vikram Khatri | Jan 14, 2009
If you have DB2 scripts that you want to run through your Java programs, you normally use Runtime.getRuntime().exec method to run system commands. The following sample code tells how to run DB2 scripts. The following code shows it for both Windows and Unix systems....
by Vikram Khatri | Jan 10, 2009
Are you looking for Matt Devlin’s Perl Scripts for DB2? Even though, they are old but still they are relevant with new release of DB2 particularly if you know how to modify them. Matt Devlin’s website http://mattdevlin.net is no longer available but you...
by Vikram Khatri | Dec 18, 2008
If you use MTK (Migration Toolkit from IBM) to migrate your database to DB2 on Windows platform, the migration goes smooth but you may see problem when you FTP data file and LOAD script to Unix platform if you do not do it right. For example, you chose ASC (ASCII)...
by Vikram Khatri | Nov 14, 2008
Thanks to Max Petrenko of DB2 Toronto Lab for sharing a very useful script to remove check pending status from the DB2 tables after LOAD or other operations. It is easy to generate a check pending script, but the importance of this script is that it builds the...
by Vikram Khatri | Aug 11, 2008
Say, you want to concatenate all rows of a column and show it as a single row in the same fashion aggregate function works. $ db2 “create table t1(line# int not null, word varchar(20))” $ db2 “insert into t1...
by Vikram Khatri | Jul 11, 2008
Edin I. Aganagic shares his tips on how to increase incremental refresh/maintenance performance of MQTs in DB2. Create an index on the GROUP BY columns. It helps speed up MQT look-ups needed to decide whether existing row needs to be changed, new one inserted, or last...
by Vikram Khatri | Jul 8, 2008
Download DB2 Logger from here Make sure that you read Readme.txt file before you compile the tool.
by Vikram Khatri | Jul 7, 2008
You can always turn off global logging by setting global_logging to N. However, if you want to shave every millisecond from your stored procedure’s execution time, comment out all CALL DB2. statements when you are sure that your SQL-PL or external stored...
by Vikram Khatri | Jul 7, 2008
The logger stored procedures run under the DB2 fenced user. Log in as the DB2 fenced user and try again to remove it. If the DB2 fenced user is nobody, ask your system administrator to free the shared memory using the ipcrm command.
by Vikram Khatri | Jul 7, 2008
Yes. This is an open source stored procedure logger. Please retain the IBM Copyright message in each source file.
by Vikram Khatri | Jul 7, 2008
Did you copy the bldrtn and bldapp files from ~/sqllib/samples/c to your directory? Try again and if you still get error, please send me a note and tell me what did you do to fix the errors.
by Vikram Khatri | Jul 7, 2008
I have not tested this framework on the Solaris platform. Please let me know the errors and I will try to fix them.
by Vikram Khatri | Jul 7, 2008
This logging framework works on Linux/Unix platforms only at this moment. I am looking for help who can port or rewrite this on Windows. If you are interested, please send me mail at vikram@zinox.com
by Vikram Khatri | Jul 7, 2008
Verify that the file system containing the splog directory is not full.
by Vikram Khatri | Jul 7, 2008
The logging framework is designed to debug the stored procedures, and the hardw method is used to debug these logging routines.