Baltimore/Washington DB2 Users Group LUW Meeting – Friday, 3/6

Posted by Frank Fillmore on March 3, 2009 under Baltimore Washington DB2 Users Group, Data Studio, DB2 Education, DB2 for Linux Unix Windows, MQT's, SQL Tuning. Tags: .

The second LUW track meeting is scheduled for this Friday, March 6, 2009, at the IBM TEC in McLean, Virginia.  Petrus Chan from the Toronto Lab will be presenting. 

I’ve spent a good portion of the past couple weeks getting individual invitations out to local DB2 for LUW users but if you are out there and I have not personally invited you, please consider yourself welcome – and try to join us.  Details on the presentations are below.   There is no charge for the sessions (they are *free* thanks to Tak Lee and the local IBM team) and pizza will be provided by The Fillmore Group. Read More…

Bryan Smith Needs More User Input on Data Studio – Please Help

Posted by Frank Fillmore on March 3, 2009 under Data Studio, DB2 for Linux Unix Windows, DB2 for z/OS. Tags: , , .

We mentioned a few weeks back that Bryan Smith, from the IBM Data Studio team, is working with a group of developers and marketing folks on IBM’s Data Studio go-to-market strategy.  Based on the quality of feedback Bryan received from the user community after his last request, he’s back for more.  If you can spare them time, please help.

Here is what he has posted on this blog:

“I need your help again. Read More…

db2cli.ini Mysteries Revealed!

Posted by Frank Fillmore on January 16, 2009 under DB2 for Linux Unix Windows, DB2 for VSE&VM, DB2 for z/OS. Tags: , , .

After a Winter Solstice break, I’m back to blogging.

In recent days, I have been working with customers who have distributed applications that access a host DB2 system: one is DB2 for z/OS and the other is DB2 for VSE.  In each case, the customer is using a tool – Visual Basic and a Hyperion three-tier (browser, mid-tier server, and host database) reporting tool respectively – that exploits the ODBC API.  While ODBC has been around for decades (I used it to access SQL/DS data on VM with MS Excel at The World Bank in 1991), some review is in order.

Open Database Connectivity (ODBC) is a “lingua franca” or common language used by, primarily, Windows applications to access data stored in a variety of databases, data stores, and file systems.  The implementation of the ODBC API meant that each desktop productivity tool or programming language didn’t need to have an individual interface for each of the possible back end data stores that customers might want to access.  For example, over the years I have used Word Perfect, Excel, Access, DataDirect Explorer, Hyperion, PowerBuilder, VisualBasic, FoxPro, Clipper (among many others) to interface with data stores as disparate as DB2, Oracle, SQL Server, Sybase, and Access.  ODBC sat in the middle between the application/tool and the data store transforming a request into a common ODBC call, then delivering to the database a request it understood – in most cases an SQL Data Manipulation Language (DML) statement such as SELECT or UPDATE.  One final note is that IBM’s Call Level Interface (CLI) is a superset of the ODBC API.

The reason for this lengthy introduction is to establish a foundation to talk about how you can manage and manipulate the way an ODBC tool or application interacts with DB2 as a back-end database.  In order to access DB2 on a host (z/OS, System i, z/VSE, z/VM) or distributed (Linux, Unix, Windows) platform there needs to be a DB2 client.  The client can be DB2 Connect to access a host database, a version of DB2 distributed database (e.g. Enterprise Server Edition), or the new consolidated Data Server client.  The client might be located on a mid-tier platform along with a web server.  End users would only need a browser to connect to the web server; the mid-tier application would issue calls to the database.  Or each end-user can have an appropriate client installed on their desktop.

Wherever the client is located in your topology, there will likely be a directory called SQLLIB and in it will be a file called db2cli.ini.  The db2cli.ini file contains a series of parameters to govern the ODBC interface to your database.  When configuring the client database connection(s), you need to specify that they will accept ODBC API statements.  This can be done when manually configuring the database connection via the GUI wizard.  Alternatively, you can issue the follow command from the DB2 Command Window:
db2 catalog system odbc data source <database alias>

So what does the db2cli.ini file look like and what are the important parameters?

Let’s say we have cataloged a connection to a remote DB2 database using the alias MY_DB.  We specified that this is an ODBC database by either of the two methods mentioned above.  Here is the db2cli.ini entry.  You will have one entry for each database connection that you have cataloged.

[MY_DB]
UID=userid
PWD=password
SysSchema=SYSIBM
SchemaList=”’SYSIBM’,’PAYROLL’,’FINANCE’”
DeferredPrepare=1
ConnectTimeout=10
ReceiveTimeout=120
LockTimeout=60
AppendForFetchOnly=1
AutoCommit=1
ConnectType=1
CursorHold=0
TxnIsolation=1

So what do we have here?  Overall I have configured an ODBC read-only reporting tool to access DB2.  Note: the explanations below are based on the values chosen for each parameter in the example.

You might or might not want to imbed the userid and password in an in-the-clear text file.  Some shops do this to minimize authentication and privilege maintenance by specifying a single userid and password to be used by everyone for database connections.

SysSchema gives the creator or owner name for the DB2 system catalog (metadata) tables on the target server.  Typically this is SYSIBM although on DB2 Server for VSE&VM it’s SYSTEM.  SchemaList is a list of creator/owners of the tables that will be accessed by this application.  By limiting the number of schemas, you reduce the time it takes to populate the table names in GUI point-and-shoot SQL generation tools like MS Query.  Note that each schema name is enclosed in single quotes(‘) and the entire string is enclosed in double quotes (“).

The DeferredPrepare reduces network traffic by sending the dynamic SQL prepare statement along with the execute request.  The three adjacent Timeout parameters will cause the request to fail if a connection to the server database is not made within 10 seconds, data is not returned from the server in 120 seconds, and lock wait extends for 60 seconds respectively.  Obviously these thresholds are only examples and will vary from shop to shop.  The benefit to setting them is that in most cases, the default timeouts are indefinite.  When users get tired of waiting, they cancel the application or reboot.  That means resources will continue to be consumed on the DB2 server even after the end-user has given up.  In addition, by setting and tuning these parameters, the database administrator can focus on the reasons user requests are lengthy (e.g. timeouts due to I/O waits vs. locking).

AppendForFetchOnly means that FOR FETCH ONLY will be added to the end of all SQL SELECT statements.  These unambiguous read-only selects – remember, this is a read-only reporting database – might help with blocking from the server to the application (more on this is a future post).  AutoCommit  makes each individual SQL statement sent to the server its own logical unit of work; no ROLLBACK WORK will be possible.  ConnectType is set for Remote Unit of Work meaning that only a single database will be accessed within a logical unit of work.  CursorHold is set to destroy cursors after each commit (in this case after each SQL request because AutoCommit is also specified).  TxnIsolation will use the uncommitted read (“dirty” read) isolation level to avoid locking.

The goal here is to optimize SQL SELECT statements and to minimize DB2 server resource consumption as much as possible.  You application profile might be very different and require different settings for these parameters.  For example, if your application has complex update logic and many SQL statements comprise a single logical unit of work, you won’t want to specify AutoCommit=1.

A full description of all of these parameters, and many more, is found at the DB2 Information Center
(http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp).

IBM Authorized Training – Private Classes – Part 1

Posted by Frank Fillmore on December 19, 2008 under Authorized Training Partner, Data Studio, DB2 Education, DB2 for Linux Unix Windows, DB2 Gold Consultants, Q-Replication. Tags: , , , , .

The Information Management training team, led by Mike Agostino and Jim Jackson, recently instituted a program to enable Frank Fillmore, as a DB2 Gold Consultant, to obtain IBM authorized course curriculum for private class delivery.  What this means to DB2 customers is that IBM has created an alternate source from which to obtain DB2 training, which should encourage everyone delivering training to sharpen their pencils to keep pricing competitive, and at the same time raise the level of delivery quality by welcoming seasoned speakers and consultants like Frank back into the business of IBM Information Management training.  Listed below are some of the courses available – the complete list is on our website at www.thefillmoregroup.com under the training link.  I will blog on the rest of the list when I have time for the typing!

CE030 DB2 Family Fundamentals, CE120 SQL Workshop, CE130 DB2 SQL Workshop for Experienced Users, CE242 Using Q-Replication, CE820 Using Rational Data Architect, CF180 Relational Database Design, DW145 Data Replication: Basic Usage (SQL Replication), DW154 Data Replication: Advanced Topics (SQL Replication), DW030 Changing Business with Data Insight, DW112 Architecting the Data Warehouse, DW314 Alphablox Essentials with Blox Builder, DW321 Managing Workloads for DB2 LUW and Infosphere Warehouse, DW351 Infosphere Warehouse 9 Components, DW820 Advanced Data Warehousing Workshop: Multi-Dimensional Modeling, DWA51 Infosphere Warehouse 9 – SQL Warehouse Tool and Admin Console, DWB51 Infosphere Warehouse 9 – Cubing Services, DWC51 Infosphere Warehouse 9 – Data Mining and Unstructured Text Analysis, CF242 DB2 9 for LUW Multi-Partition Database Administration, CF492 DB2 9 for LUW Advanced Recovery, CF602 DB2 Connect DRDA Implementation with TCP/IP, CF632 DB2 Connect 9 for z/OS Problem Determination and Performance, CF710 DB2 9 Stored Procedures Programming Workshop, CG100 Using xQuery to Query XML Data with DB2, CG130 Query and Manage XML Data with DB2 9, CG242, DB2 for LUW Multi-Partition Environment for Single Partition DBAs…and more coming soon!

Baltimore/Washington DB2 Users Group – LUW in 2 Weeks

Posted by Frank Fillmore on November 26, 2008 under Baltimore Washington DB2 Users Group, DB2 for Linux Unix Windows, International DB2 Users Group (IDUG), Uncategorized.

I can’t believe Thanksgiving is tomorrow and we are just two weeks away from the first Baltimore/Washington DB2 Users Group LUW track meeting.  I haven’t seen the registration numbers yet but have been trying to contact any and everyone I can about the meeting.  The presenters are lined up and ready – DB2 evangelist Dwaine Snow from IBM on compression, an excited Bill Kincaid from xkoto, who closed a Gridscale deal with CNN just this week, and of course my favorite, Frank Fillmore, on high availability options.

If you will be in town, please join us.  Please!  It’s critical to show support for an LUW track as the legacy Baltimore/Washington DB2 Users Group core membership is comprised of DB2 for z/OS users.   They have been very tolerant of my persistent clamor to add an LUW track.  If we draw a crowd it will enable us to continue to offer an LUW track, providing LUW users with the same quality of low cost education that makes IDUG such a great contributor to the DB2 community.

Changing the Hostname for a DB2 Server

Posted by Frank Fillmore on November 14, 2008 under DB2 for Linux Unix Windows. Tags: , , .

Sorry I haven’t posted in a little while.  October was a 250 hour month with a critical customer project and the IBM Information OnDemand Conference (IOD – you know all about IOD from Kim).  My VP of Biz Dev is all about trying to make her “number”, so it’s been busy.

The Fillmore Group is an IBM Authorized Training Partner (ATP) so we use a product called Acronis to create a single image of our student lab machines and then deploy that image to multiple PCs.  Since these are Windows XP PCs running DB2 9 for Linux, Unix, Windows Fixpack (FP) 2, the computer name must be unique within the domain.  However, once you change the computer name, DB2 stops working.  The common error is SQL1042C.  Here’s how to fix that problem.

First, there is a file in each DB2 instance subdirectory (e.g. “c:\Program Files\IBM\SQLLIB\DB2”) called db2nodes.cfg; in this post we’re only going to address single-node (i.e. not Data Partitioning Feature or DPF) databases.  Open this file for each DB2 instance on the server – I use WordPad – and change the imbedded hostname to the current computer name for that PC.  The same hostname will be repeated twice on a single line in the db2nodes.cfg file.  Change both.  This used to be all you needed to do to fix the problem.  Now, there are a few more steps.

If you installed using the extended operating system security option, you likely will now receive an SQL1652N file I/O error.  In DB2 9.1 FP 2, support was added for domain userids and groups.  Use the db2extsec command to correct the authorities for the installation-defined groups DB2ADMNS and DB2USERS.  For example, let’s say the PC image was created using a computer name of TFGXP01.  We’ve deployed this image to another PC and changed the Windows computer name to TFGXP02.  Enter the command:

db2extsec -a TFGXP02\DB2ADMNS -u TFGXP02\DB2USERS

The last step involves correcting the DB2 registry variables.  Use the db2set -all command to examine the current registry variables.  In our example, you likely will have seen three variables with TFGXP01 as part of the value.  Issue the following commands:

db2set db2accountname=TFGXP02\db2admin

db2set db2instowner=TFGXP02

db2set db2system=TFGXP02

At this point, you should be able to start the DB2 instances.