Application Deployment and Other Goodies - Page 2
July 26, 2005
by Paul C. Zikopoulos, IBM Canada
Do you use Microsoft Systems Management Server?
You can also distribute your DB2 UDB code via the Microsoft Systems Management Server (SMS) product. You can use Microsoft SMS to install DB2 UDB across a network, and set up the installation from a central location using a push or pull strategy. Such an installation will minimize the amount of deployment work that you have to perform in a Windows environment. This installation method is ideal if you want to roll out an installation on a large number of clients all based on the same setup. (Moreover, since an SMS CAL license is part of the Microsoft Core CAL license, there is a good chance your enterprise is already licensed for this technology.)
When you are using Microsoft SMS, you have control over which response files you will use. You can have several different installation options, resulting in several different response files. When you configure the installation package, you can specify which response file to use.
Like any other product that you want to distribute via Microsoft SMS, you need to create an SMS package, which is a bundle of information that you send from the SMS server to an SMS client. This package consists of a set of commands that can be run on the client workstation. These commands could be for system maintenance, changing client configuration parameters, or installing software.
The screen shots below depict the integration between DB2 UDB and Microsoft SMS:
You can learn more about this method of installing DB2 UDB products at: http://publib.boulder.ibm.com/...t0007297.htm.
The code is installed; now what?
At this point, you have installed a DB2 UDB client and you need to configure connections to the required databases and potentially perform configuration work on each of these client workstations (setting registry variables, and so on). There are many ways to do this in DB2 UDB, and your experience and comfort level with DB2 UDB will likely guide you to the right path.
Microsoft .NET developers can leverage the rich configuration features in the IBM Explorer that I covered in Part 1 of this series. You can catalog and add databases that you are authorized to connect to with mere clicks of a button.
Power users are likely to use the DB2 UDB Configuration Assistant's Add Database Wizard, shown in the figure below:
The Configuration Assistant provides a graphical environment for configuring connections and settings for DB2 UDB workstations. It provides a full set of the discovery functions that were added to VS.NET, as well as alternate methods for cataloging database connections and testing them. Quite simply, you can ask DB2 UDB to send out messages across your network in order to find any DB2 UDB servers and automatically catalog them. Of course, you need to have the correct authorization and authentication credentials to access these databases, and database administrators (DBAs) have the option to configure DB2 UDB not to respond to these requests at a per database level, but it's a handy feature indeed especially for developers!
You can also use the Active Directory protocol to centralize the administration of catalog information for database connections. Using Active Directory provides a central server that hosts catalog information for database connections that developers need to do their work. When they need to connect to a database, they simply specify the database name and the DB2 client contacts the Active Directory server to retrieve the required connection information. This environment requires a little more setup and attention to detail, but provides an easy administrative framework once it is up and running since you only need to change, delete, or add connection information in one place. The DB2 UDB GUI tools and the CLP commands have extensions for LDAP directory servers.
An example of a database connection assisted by Active Directory is shown below:
Finally, you can use client profiles (which are generated from the command line or by one of the graphical DB2 UDB tools) to generate text files that contain the configuration information of a DB2 UDB product. For example, you can catalog any required database connections and set registry variables on a single machine, and then export that machine's profile, and subsequently import it on any target workstation.
READ THIS: Now for some hints and tips for DB2 UDB product distribution
In this final section, I will give you some hints and tips that seem to provide a best-practice framework for DB2 UDB production deployment
(A) You don't have to be a baker to cut cookies
The DB2 UDB Response File Generator utility (db2rspgn) is a virtually unknown Windows-only utility that might prove to be your best friend. For all intents and purposes, this tool is a 'cookie-cutter'. If you look back through this article, you will see there are various mechanisms to include or exclude components in a DB2 UDB installation, and to set up configuration information such as database connections, and so on. The db2rspgn tool allows you to fully configure a machine with all the components, database connections, registry variable settings, and so on. When you run this tool, DB2 UDB automatically creates the response file and profiles that will allow you to duplicate that workstation's DB2 UDB image and configuration on any target workstation. Underneath the covers, this tool invokes some of the profiling capabilities I mentioned earlier, but using this utility is a more streamlined and easier process. I recommend you follow this method versus setting up your own response file, creating profiles, and so on.
(B) Hide Your Installation
DB2 UDB V8.2.2 introduced a host of new features that you can use to hide the installation of DB2 UDB in your own product's installation. If you are embedding DB2 UDB in your product's installation, get to know these features! For example, as of DB2 UDB V8.2.2, you can completely suppress any of the DB2 UDB dialog boxes and simply show a status bar that shows the progress of the DB2 UDB installation, override user account settings in a response file, and more. SAP is a prime example of an application that installs DB2 UDB for its customer base. The new version of SAP leverages these key new features to make the installation of the database server as transparent as possible.
(C) Use the DB2 Run-Time Client Lite
For simple connectivity, give the DB2 Run-Time Client Lite to your production people to enable your application for a DB2 UDB database. It is simply a collection of drivers (including .NET, OLEDB, ODBC, SQLJ, and so on). In fact, it includes all the drivers you will ever need for any application, no matter what the language. Remember, you do not have to ask IBM for permission to redistribute it. It is very easy to deploy the DB2 UDB client code this way: you just build the installation program for your application and you include the MSI merge modules that you need no need for response files or anything!
Wrapping it all up
In this article, I covered the key topics, information, and tools that you need to be aware of to easily deploy the DB2 UDB product that is a pre-requisite to your application.
Ready to try it out for yourself? Get a free trial copy of a DB2 UDB for Windows server at: www.ibm.com/software/data/db2/udb/support/downloadv8.html. You can also get a free copy of DB2 UDB Personal Edition for development purposes at: http://www14.software.ibm.com/webapp/download/search.jsp?go=y&rs=db2udbpde.
About the Author
Paul C. Zikopoulos, BA, MBA, is an award-winning writer and speaker with the IBM Database Competitive Technology team. He has more than ten years of experience with DB2 UDB and has written over sixty magazine articles and several books about it. Paul has co-authored the books: DB2 Version 8: The Official Guide, DB2: The Complete Reference, DB2 Fundamentals Certification for Dummies, DB2 for Dummies, and A DBA's Guide to Databases on Linux. Paul is a DB2 Certified Advanced Technical Expert (DRDA and Cluster/EEE) and a DB2 Certified Solutions Expert (Business Intelligence and Database Administration). In his spare time, he enjoys all sorts of sporting activities, running with his dog Chachi, and trying to figure out the world according to Chloë his new daughter. You can reach him at: firstname.lastname@example.org.
IBM, DB2, and DB2 Universal Database, are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
Copyright International Business Machines Corporation, 2005. All rights reserved.
The opinions, solutions, and advice in this article are from the author's experiences and are not intended to represent official communication from IBM or an endorsement of any products listed within. Neither the author nor IBM is liable for any of the contents in this article. The accuracy of the information in this article is based on the author's knowledge at the time of writing.