DevX Skillbuilding for IBM DeveloperWorks
DevX Skillbuilding for IBM DeveloperWorks
DevX Skillbuilding for IBM DeveloperWorks
Get regular email alerts when we publish new features!
DevX Update for IBM developerWorks

More Newsletters
 Print Print
Introducing DB2 Express-C, with Demos
IBM offers its first free version of DB2, DB2 Express-C. But what is it, exactly, and how does it differ from the other versions? This article gives developers an overview of the new database. As a bonus, watch a couple of demos of some hidden treasures of the DB2 family, including the Auto-Maintenance Configuration utility. 

With the release of DB2 Express-C, IBM offers its first absolutely free version of DB2. That's right, free. So what's the catch? What's gimped in Express-C and how does it differ from the "bigger" versions? Well, you'll be surprised to discover that, aside from a few features, it's really not that much different. It's the same powerful database, with the same powerful tools.

More Resources
  • Video: How DB2 Express-C Saved the World, Part 1
  • Download DB2 Express-C
  • But see for yourself. This article will describe the particulars of Express-C, then walk you through installation and setup of a sample database. After that you'll jump in and explore some particularly fun, but under-used, features.

    What's All This About DB2 Express-C?
    IBM dropped their already low licensing rate for Express to, well, nothing, offering an alternative to new "express" databases from Microsoft and Oracle. As you can see in the sidebar "How Do They Compare," database devs have an advantage out of the starting gate because of the generous resource minimums offered by Express-C.

    But Express-C gives developers advantages over other databases, as well. For example, many large companies with tight vendor control may have already approved enterprise powerhouse DB2. But they may be reluctant to consider an open-source solution like MySQL, which is not as scalable. With Express-C, developers gain a foothold into the existing corporate architecture, developing on a database that scales nicely to fit needs and standards. And because all versions of DB2 use the same basic engine and tools, they gain a skill set that can be directly applied to other versions.

    How Is Express-C Different?
    As you use Express-C, you may find that some DB2 features, such as Disaster Recovery (HADR), have been disabled or removed. This gives Express-C a lower footprint than other versions. For a complete list of differences, check out the DB2 Express-C FAQ.

    Coinciding with the launch of Express-C, IBM beefed up its Linux and Windows support forums, which for the first time have a team of full-time specialists behind the curtain. If you find you find you like Express-C and want more personal support, buy the license for Express. You can install it directly on top of Express-C for a seamless upgrade that includes additional features and 12-months of support.

    A Note About XML
    DB2 Express-C does not include the DB2 XML Extender, but it does include the powerful standards based SQL/XML. SQL/XML is an ideal way of creating XML fragments and documents from relational data. Watch out for the upcoming DB2 Viper as it is expected to provide support for the new XQuery standard and also provide a native XML data store with indexing.

    Add-In Support
    Express-C fits snugly in several IDEs that previously supported DB2. Though Eclipse includes Web Tools Project data tooling that's not DB2-specific, Rational tools integrate nicely with DB2, and thus Express-C. Zend Studio v5 has improved support and code assist for its native DB2 PHP driver, including the ability to browse DB2 database objects from within the IDE. Lastly, the Visual Studio 2005 add-in can be installed on top of Express-C, as well as other versions of DB2.

    Install DB2 Express-C
    If you're ready to take a look, then now would be a good time to download the latest release. The install file is about 300 MB, with the final product taking up about 447 MB. If you have another version of DB2 currently installed, you'll want to uninstall it or use a different machine for this one.

    As you install DB2 Express-C, you might want to include sample databases when presented with the option. If not, you'll still have the chance to do it later, but this will save you an extra step.

    Connect to the Sample Database
    After you've installed DB2 Express-C, if you didn't include the sample databases in your install, add them using First Steps (IBM DB2 -> Start-up Tools -> First Steps). (See Figure 1).


    Figure 1.
    First Steps

    To take a look at the SAMPLE database, open up the DB2 Control Center. Keep in mind that the graphic interfaces are essentially the same for all versions of DB2. So as you explore and familiarize yourself with Express-C, you'll be able to use everything you learn should you decide to upgrade to a different license down the road. In the left pane, the Object View of the Control Center, you should see a couple of collapsed folders—"All Systems" and "All Databases".

    When you first start, you won't be connected to any of your databases. The easiest way to locate the SAMPLE database and connect to it is to expand the "All Systems" folder, drilling down to the Databases folder. This will be under the Instance you created during your install, "DB2" by default. Right-click on the folder and choose "Add…" from the context menu. You should be able to find SAMPLE in the list of Database Names, as in Figure 2.


    Figure 2.
    Add SAMPLE Database

    After connecting to the SAMPLE database, poke around a bit. Next, you'll be making a backup of it. Or better yet, make a backup and then poke around. Just in case, you know.

    Backup the Sample Database
    While not a particularly flashy feature, the Backup utility is obviously one of great importance—and woefully underused in many cases. Most databases have a backup utility of some sort, but how does it work in DB2? What are the options?


    Figure 3.
    Backup Demo

    Click on Figure 3 for a short demo on using the backup utility. This utility has a lot of options that may not be familiar to the casual database developer, such as "Quiesce Database" (allow current transactions to end normally while rejecting any new requests for work) and "Throttle" (place limits on the resources consumed for this process). The online Help should be able to cover anything you're not familiar with.

    Configure Auto-Maintenance
    One of the great unsung treasures of the DB2 family, including DB2 Express and now Express-C, the Automatic Maintenance Configuration lets you "set and forget" essential maintenance options. For example, the backup you just performed? Set it to happen automatically during a low-usage period, say between 3 and 5 in the morning on Saturday and Wednesday.

    Click on Figure 4 for a demo on setting auto-maintenance.


    Figure 4.
    Auto-Maintenance Demo

    What's Next
    If you're a new developer looking for a rock-solid database for your Java or PHP app (or .NET for that matter), or you need an enterprise database but want to try before you buy, you'll find a strong solution in DB2 Express-C. You can build fully functioning apps and familiarize yourself with all the tools you'll need in the long run and then upgrade to the license appropriate to your situation.

    For example, if you need a little bit more memory than is allowed in Express-C, or perhaps a couple more CPUs, then upgrade to DB2 Workgroup Edition, which allows 4 CPUs and 16GB RAM. IBM, as a philosophy, puts no disk space limits on any of its databases, so that's never a concern.

    To get started now, download DB2 Express-C. You can read more about Express and Express-C on the DB2 Express Page. Last, be sure to read this piece about DB2 Express-C. It explains everything you need to know about what it is and how it's used.

    Page 1 of 1
    Justin Whitney is a regular contributor to DevX.com and Jupitermedia. He currently lives in San Francisco, where he consults for leading high-tech firms and writes about emerging technologies.
    Submit article to:
    Featured Resources from IBM