DB2 for Domino 8 Administrators and Developers
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


DB2 for Domino 8 Administrators and Developers






Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

DB2 for Domino 8 Administrators and Developers Document Transcript

  • 1. DB2 for Domino 8 Administrators and Developers Version 1.0
  • 2. Copyright information ©2008 wareSource.com Part #DB2D8, updated for Notes/Domino 8.0 and DB2 9.1. Under the copyright laws, this book may not be photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent of wareSource. While every reasonable precaution has been taken in the preparation of this book, the author assumes no responsibility for errors or omissions, nor for the uses made of the material contained herein and the decisions based on such use. No warrantees are made, express or implied, with regard to either the contents of this work, its merchantability, or fitness for a particular purpose. The author shall not be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the contents of this book. In no event shall the author be liable for any damages whatsoever (including without limitation, damages for loss of business profits, business interruption, loss of business information, or any other loss) arising out the use of or inability to use this material, even if the author has been advised of the possibility of such damages. Lotus, Domino, Domino Designer, Lotus Notes, Notes, and IBM, AIX, DB2, DB2 Universal Database, and WebSphere are trademarks or registered trademarks Lotus Development Corporation and/or IBM Corporation. Windows is a trademark of Microsoft Corporation. Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation. Java and JavaScript are trademarks of Sun Microsystems, Inc. All other marks are the property of their respective owners. 2 DB2 for Domino 8 Administrators and Developers
  • 3. Table of Contents Topic 1: Domino and DB2 Overview......................................................................7 Topic 2: Install DB2 Server ...................................................................................25 Topic 3: Administer DB2.......................................................................................59 Topic 4: Define Table ............................................................................................99 Topic 5: Open Table ............................................................................................107 Topic 6: Query from the Command Editor..........................................................117 Topic 7: Install DB2 Runtime Client ...................................................................153 Topic 8: Configure Domino to Use DB2.............................................................175 Topic 9: Install DB2 Access Server.....................................................................215 Topic 10: Create DB2 Access Views...................................................................241 Topic 11: Create Query Views ............................................................................271 Topic 12: Create Query Views of Federated Data...............................................297 Index ....................................................................................................................329 DB2 for Domino 8 Administrators and Developers 3
  • 4. Description An exciting feature of Domino is its ability to use DB2 as an alternate data store. While this opens up expansive vistas for both Domino and DB2 shops, it requires Domino administrators and developers not only to learn how to work with DB2 but how it works with Domino. During this course you will learn the essentials of DB2 installation, configuration, and security. You will learn how to interact with the DB2 server using the DB2 Control Center and query DB2 tables using the Command Editor and SQL Assist. The course then turns to implementing DB2 as the Domino data store. You will create DB2 Access Views that give external SQL applications access to Domino data and create Query Views that give Notes access to DB2 data. Course goals In this course, you will learn how to: • Build a test/development environment that demonstrates the full capabilities of Domino and DB2 integration. • Install the DB2 server and monitor its status and health using various administration tools. • Use the DB2 Control Center to configure the server and the License Center to apply a license file. • Create a sample DB2 database and use graphical tools to open and query the database using SQL. • Configure Domino to use DB2 as its data store. • Install and configure the DB2 Access Server and create several DB2 Access Views to make Domino data available to external SQL applications. • Create Query Views to give Notes access to DB2 data. 4 DB2 for Domino 8 Administrators and Developers
  • 5. Audience This course is designed for individuals who are new to DB2, relational databases, and SQL but who have experience programming Notes applications using Domino Designer 8 and experience administering Domino using Domino Administrator 8. This course provides enough DB2, relational database, and SQL knowledge to set up a test/development environment in which you can begin to work with DB2 databases and Domino 8. This course does not, however, fully prepare you to become a DB2 administrator. Course design This is a lecture/lab course that follows a task-oriented approach. During the many exercises you will create a working test/development environment where you will work with the all aspects of the Domino 8/DB2 integration. Data disk There is no separate data disk for this course, but a Domino database template named Support Contacts (SupportC.NTF) template is installed with the courseware files. You can use this template or follow the two exercises in the course that create the database from scratch. Please consult the Set Up document for this course to make sure the correct software environment is in place before starting. Conventions This course follows these font conventions: • Italic - database, view, page, form, document, macro, and field names, as well as object event types • Bold - Notes menu options, command button names (whether Notes or developer defined), and accelerator keys • Courier- user input, sample values, and code examples • Helvetica – SQL code examples and URLs to Web resources • - shows when lines of code wrap in this text but should be one continuous line in the Programming Pane. DB2 for Domino 8 Administrators and Developers 5
  • 6. Notes 6 DB2 for Domino 8 Administrators and Developers
  • 7. Topic 1: Domino and DB2 Overview Key points In this Topic you will learn how Domino can store its data in DB2, leveraging the strengths of both products. You will also learn the difference between a local and a remote DB2 connection for Domino and how to determine which connection type is appropriate for both development and production environments. A history of Domino data storage Since its inception, Domino has stored its data in the proprietary “Notes Storage Facility” (NSF) database file structure. While the NSF is not a relational structure, it possesses many unique attributes that have been proven over time to be one of the most flexible, secure, reliable, and popular databases on the market. As Domino evolved, so did its low-level database engine capabilities along with the NSF file structure, particularly in Domino 5. IBM’s database expertise injected into Lotus (following its acquisition by IBM in June 1995) resulted in significant enhancements to the database storage subsystem, including unlimited database storage size (to the limits of the system hardware and operating system), memory and I/O optimization, transaction logging, and scalability improvements resulting in huge databases and a directory that scales to more than a million registered users, and a two- to four-fold increase in the number of Notes, IMAP, POP, and browser users supported by a single Domino server. The latest Domino releases boast even greater performance and an increased number of users per server. Couple these performance improvements with binary compatibility between the Notes client and across several server hardware platforms and operating systems, and it is easy to see why the NSF has endured in spite of the criticism that it isn’t relational. Topic 1: Domino and DB2 Overview 7
  • 8. A birds-eye perspective of DB2 DB2 is IBM’s premier object-relational database management system (RDBMS). Note: The “object” part of “object-relational” means that in addition to possessing all the usual relational database features, DB2 developers can also define their own custom data types and methods and apply them to the database. DB2 competes in the enterprise database market with the likes of Oracle and Microsoft SQL Server. DB2 serves both structured and unstructured data for a wide range of applications deployed on a variety of hardware and software platforms (everything from a PDA to a massive parallel multiprocessor mainframe system). DB2 server processes Like the Domino server, DB2 is also a collection of processes that manage communication, process SQL (Structured Query Language) statements, fetch data, manage memory, handle locking, and perform logging. Note: See http://www- 128.ibm.com/developerworks/db2/library/techarticle/0304chong/0304chong.html for a description of the DB2 server processes. DB2 database objects DB2 operates on a hierarchy of objects (as seen from the DB2 Control Center Object View, which you will use later): Computer Name Instance Name Database Name Database Objects 8 Topic 1: Domino and DB2 Overview
  • 9. This table defines some of the objects you will encounter while working with DB2: Object Definition Instance A complete, independent execution environment (in Windows, a service represents the instance) that maintains its own databases in its own directory (as well as instance- specific database manager configuration file, system database directory, log files, etc.), and controls its own security. You can configure one or more instances on the same DB2 system. Database Within each instance you will create one or more databases. Fundamentally a database is a collection of one or more tables. In addition to table(s), a database also contains a number of other objects, such as a description of its own structure (schema), event monitors, buffer pools (area in memory where data is read, modified, and held during processing), and a recovery log of ongoing and pending transactions. Unlike Domino databases, which are contained in a single NSF file (ignoring for the moment full text index files, which are stored outside the NSF), DB2 databases are made up of many files in a unique parent database folder and a number of subfolders. Table(s) A table is defined by its columns and rows. Each column stores a particular type of data. When a record is inserted, it is added as a row in the table. The Notes document is the equivalent of a record, with each value (the intersection of a row and a column in a table) being an “item.” When ported to a DB2 database, Notes documents are actually represented by multiple rows in a table, with the items from the document stored in columns. Note: Though not relevant to Domino data, it is good to know that DB2 9+ handles XML as a data type that is stored in a natural hierarchy that also supports both SQL and Xquery queries. Topic 1: Domino and DB2 Overview 9
  • 10. Object Definition Index(es) Records in tables are stored in the order in which they are created. To quickly find a particular record, you must create one or more indexes, which map a key value to a pointer to where the data exists in a table. For example, an index could be built on the value of PartNumber, LastName, EmployeeNumber, or whatever column uniquely describes one or more matching records. Indexes can also be created such that they enforce uniqueness in the key values so only one record maps to a particular key value. View(s) A way to filter and list data from one or more tables. Compare relational database views to views in Notes: • Similar to Notes views, the DB2 view has columns of data and a SELECT statement (though written in SQL to determine which rows should be included in the view). Changes made to data in the view are made to the data in the underlying table(s). • Unlike Notes views, a DB2 view by itself does not have a user interface, though many applications utilize views to populate a UI rather than the underlying table(s). Table The space in the database used to store tables and indexes. Space(s) Table spaces are mapped to physical storage (drive and directory). When you create a new table or index in a database, you assign it to a table space. To make things even more interesting, you can assign a table’s indexes to another table space, and its large objects in a third. This way you can use faster and/or larger storage devices as needed for specific purposes. Schema A logical collection of other database objects (tables, views, nicknames, etc.) that allows you to logically organize the objects in unison as a group. As other objects are created, you place them in a schema so that they are distinguished from other objects in other schemas. To eliminate ambiguity when referring to objects (such as in SQL statements), the schema name is prepended to the object name, for example, ADMINISTRATOR.EMPLOYEE. The schema name is ADMINISTRATOR, and the table is EMPLOYEE. 10 Topic 1: Domino and DB2 Overview
  • 11. Note: See http://www- 128.ibm.com/developerworks/db2/library/techarticle/0301chong/0301chong.html for a colorful overview of these and more DB2 concepts. Programming interfaces There is really nothing useful you can do with DB2 by itself. You need to buy or build some application to make use of the data stored in DB2. The application can run on a client and directly access DB2 data, or more likely the application will run on an application server (either client-server or Web-based). Unlike Domino, which almost always runs applications built in Domino Designer, you can use a number of programming interfaces to access DB2 data, including: • DB2 Call Level Interface (CLI). This is what Domino uses to connect to and interact with DB2. The CLI is based on the Microsoft Open Database Connectivity (ODBC) specification and the ISO CLI standard. In addition to using embedded SQL, the CLI also has full access to the DB2 APIs. • Java applications and applets that use JDBC. • Visual Basic and C++ applications that use Data Access Object (DAO) and Remote Data Object (RDO). • ActiveX Data Object (ADO) applications that use the OLE DB Bridge. • ADO.NET applications that use the DB2 .NET Data Provider, OLE DB .NET Data Provider, or ODBC .NET Data Provider. • Any other development tools that use Net.Data, Excel, Perl, and Open Database Connectivity (ODBC). You will find, for example, DB2 being used by enterprise-wide CRM/ERP/CSM/BI applications, as well as Web applications such as IBM’s Portal and Workplace platforms. The common base of all these programming interfaces is that they all issue standard SQL statements to define and secure databases, and insert, delete, update, and query data stored in the databases. Note: Keep in mind that while the SQL language follows a number of standards (ANSI, ISO, X/OPEN, etc.), every database system varies somewhat in its implementation of the language and also includes a number of extensions to support proprietary features and extended data types, which makes it almost impossible to port SQL expressions unchanged between RDBMSs. But rest easy, the bulk of the basic the SQL language elements are fairly universal. Topic 1: Domino and DB2 Overview 11
  • 12. DB2 Server editions IBM has packaged the features of DB2 into several products offerings. You make the choice of one over the other based on various criteria, such as number of users, number of transactions, hardware platform, etc. The only versions supported by Domino 8, however, are these two: • DB2 Workgroup Server Edition • DB2 Enterprise Server Edition The Enterprise Server Edition allows you to create and manage single or multi- partitioned environments (higher volumes of data, increased performance, and high availability features). If you do not already have a licensed copy of DB2 Workgroup or Enterprise Editions, Domino 8 includes (at no additional charge) a limited entitlement to use DB2 Enterprise Server Edition, subject to these restrictions: • Any access of Domino data stored in DB2 via third-party software (other than backup/restore) is only allowed if DB2 Enterprise or Workgroup is licensed separately. • Any use of the DB2 for non-Domino data requires a paid DB2 Enterprise or Workgroup edition license. Note: For a list of entitlements that are included with your Domino server license, see http://www- 306.ibm.com/software/lotus/notesanddomino/additionalswentitlements.html. Note: See the article, “Which distributed edition of DB2 Version 8 is right for you?” (http://www-106.ibm.com/developerworks/DB2/library/techarticle/ 0211zikopoulos/0211zikopoulos.html) for a thorough overview of the various editions. Domino release number and DB2 Server version The particular release of Domino you are using requires a specific DB2 version and Fix Pack number. Domino 8.0 (and only the 32-bit version is supported) requires one of these DB2 versions: • DB2 Enterprise Server Ed 9.1 Fix Pack 2 - Microsoft Windows 32-bit • DB2 Enterprise Server Ed 9.1 interim special build 2a - IBM AIX 5.3 and Linux (SLES10 & RHEL5) 64-bit • DB2 Workgroup Server Ed 9.1 Fix Pack 2 - Microsoft Windows 32 bit 12 Topic 1: Domino and DB2 Overview
  • 13. • DB2 Workgroup Server Ed 9.1 interim special build 2a - IBM AIX 5.3 and Linux (SLES10 & RHEL5) 64-bit You will learn in the next Topic where to obtain the correct version of the “limited entitlement” DB2 and supporting software for Domino 8.0. Note: iSeries not a supported platform. The present and future of Domino data storage Along with the evolution of the NSF, Lotus and third-party developers have also developed a number of tools to integrate Domino and non-Domino data (Lotus Enterprise Integrator, Domino Enterprise Connection Services, LS:DO, LCLSX, Data Connection Resource, NotesSQL, and a number of third-party tools such as CASAHL’s Replic-Action for IBM Lotus Notes). But only IBM could recode Domino to natively support DB2. And now it is not hard to imagine someday DB2 becoming the default Domino data storage subsystem while NSFs are relegated to “legacy” status. This table describes the three ways Domino supports DB2: Part Function Alternate data Store Domino databases on a DB2 server. storage in DB2 database While NSFs are still supported and managed by Domino, DB2 is an optional storage type in which the DB2 server manages the physical database. DB2-backed NSFs are referred to as NSFDB2 databases. Both NSF databases and the NSFDB2 database are visible to the Domino server. This may be all you choose to implement with respect to Domino and DB2, as DB2 Access Views and Query Views are optional. For the most part, access to the NSFDB2 database is transparent. For example, Notes and any C-API program continues to work the same as if accessing an NSF. Topic 1: Domino and DB2 Overview 13
  • 14. Part Function DB2 Access Expose Domino NSFDB2 data to external DB2 View applications. But don’t expect to find any data in the form of readable character-based columns in DB2. Virtually all of the Domino data is stored as binary large objects (BLOB), including any attachments, and is private to Domino. Only path and object names and design element names are stored as variable length text that is human readable. Indeed the very purpose of DB2 Access Views is to expose parts of this “structured-but-somewhat messy” data in a manner that is accessible to external SQL clients (using DB2 Client Access or ODBC/JDBC drivers). The data from the private tables is copied and translated (differences between Domino’s unstructured data and DB2 structured tables are resolved) to the DAV. Query View Access DB2 data from Notes or browsers. A new type of Notes View can be built based on a SQL query. This opens up some interesting possibilities, like enabling Notes and browser users to view external relational data and/or to join this data with one or more DAVs to indirectly query across multiple Domino databases. 14 Topic 1: Domino and DB2 Overview
  • 15. How Domino data is stored in DB2 Storing Domino’s unstructured data in a structured database isn’t easy. There is no one-to-one correspondence between the various objects in the two database structures. Within the single DB2 database you will find that each Domino database is represented by a single table space. Then within that table space the contents of the Domino database have been split into several DB2 tables. Domino DB2 Database Database Document Table Space Item Table Rows Columns View Index(es) While it is possible that DB2 and Domino run on the same server computer, you will see in a moment that the recommended configuration is that they run on separate computers, with one DB2 server storing databases for many DB2 servers. Under this one-to-many configuration, every Domino server is represented by a single DB2 database on the DB2 server, regardless of how many databases there are to be stored as NSFDB2s. NSF_1 NSF_1 Table Space NSF_1 Tables Domino DB2 NSFDB2 NSF_2 Table Space NSF_2 Tables NSF_2 NSF_3 Table Space NSF_3 Tables NSF_3 What this means is that if multiple Domino servers store their databases on the same DB2 server, you will find only one DB2 database for each server. To keep track of the NSFDB2 databases in the container DB2 database for the Domino server, the DOMINO.CATALOG table lists all of the NSFDB2 databases, their schemas, and their table space names. Topic 1: Domino and DB2 Overview 15
  • 16. Operationally, the ability to use DB2 for data storage is virtually transparent to the Domino developer and administrator. This is because only the low-level data storage layer has been rewritten to add support for DB2; all the other higher-level subsystems—such as application logic and deployment, security, and replication—operate the same regardless of the data storage mechanism used for a particular database. In case developers need to distinguish a particular element as running in a NSF or NSFDB2, the @IsDB2( server : filename ) function ( “”:”” for current database) returns TRUE if the database is a NSFDB2. Working with NSFDB2 databases from Domino Administrator is virtually the same as working with NSFs, with these minor exceptions: • You see 1KB .NSF stub files in the file system. These refer to the database on DB2 (and work much like database links). The stub files maintain referential integrity for URLs and application code. • The Compact tool can convert existing NSFs to NSFDB2s, and Domino can be configured to create NSFDB2s instead of NSFs by default. You must, however, still learn how to administer DB2 using its administrative tools for backup/restore, performance tuning, troubleshooting, etc. Note: Read the technote Security considerations for Domino -> DB2 integration for more on this subject (search for 1224455 at http://www- 306.ibm.com/software/lotus/support/). Notes and DB2 What about Notes and DB2? • The Notes client still (only) uses NSFs for local data storage. • Any version of the Notes client that has access to the Domino server can open or replicate NSF or NSFDB2 databases. • Because Domino handles connectivity to the DB2 server on behalf of Notes users, there is no need for users to have direct DB2 connectivity. Note: The notable exception to previous versions of Notes being able to benefit from DB2 is that they cannot use some of the new R7+ design features introduced in Domino, including Query Views. But as long as the database design sticks to what works in Notes R6.x, everything will work fine even though the data is actually stored in a NSFDB2. 16 Topic 1: Domino and DB2 Overview
  • 17. Local or remote DB2 Server There are essentially only three ways to architect a Domino/DB2 environment. Local connection The Domino and DB2 servers are installed and running on the same computer. Server Computer NSF_3 Notes Client Domino NSF_2 Server NSF_1 Web Browser DB2 NSFDB2 Server Storage DB2 Tables for “NSF_4” Tables for “NSF_5” Access SQL server with Domino Security Domino provides clients with data from its own NSFs as well from the NSFDB2 it accesses through its connection to the DB2 server. If you also want to give any SQL client access to NSFDB2 databases through DB2, while enforcing the Domino security model (ACLs and document-level security via Authors/Readers fields), then you also need to install the DB2 Access Server software on the combined server. Note: With both servers running on the same computer, it is required that DB2 is running before Domino starts. Under Windows you can define a “service dependency” in the Registry to make this happen. Search the Domino Administrator 8 Help for “Creating a service dependency for Domino and DB2” for details. Be aware that the first edition of Help incorrectly names the variable you should add; it should be “DependOnService” (data type is REG_MULTI_SZ). Caution: While it is possible to run both the Domino and DB2 servers on the same computer, you won’t see any performance improvements if you are simply adding another resource-intensive server in addition to Domino without also significantly beefing up the hardware. And in many businesses, security guidelines dictate that application and database servers must run on different computers separated by a firewall. But if you decide to run both Domino and DB2 on the same computer, then you should dedicate the computer to Domino (and limit which server tasks are running) and have no more than one DB2 instance and one DB2 database for the Domino server. Topic 1: Domino and DB2 Overview 17
  • 18. Remote connection, one Domino-to-one DB2 Domino and DB2 are running on separate server computers. To make this possible, the DB2 Runtime Client is installed on the same computer as Domino and the Domino server is pointing to one instance of DB2 installed on the other computer. The DB2 Runtime Client running on the Domino server enables and manages the connection to the remote DB2 server. Domino Computer DB2 Computer Notes Client NSF_3 Domino DB2 NSF_2 SQL Server 1 Access with NSF_1 server Domino Security Web Browser NSFDB2 DB2 DB2 Runtime Storage Server Client Domino supports a limited number of platform combinations for remote connections: • Both Domino and DB2 computers are installed on separate computers, but both computers must run the same platform (Windows, LINX, or AIX). • Domino is installed on the Windows computer, and DB2 is installed on the other computer, which can run either Linux or AIX. It is also possible that DB2 and Domino are installed in logical partitions or VM guest on the same physical computer, though this configuration is treated as a remote connection. Note: There is a variation of this configuration in which DB2 is installed on both the Domino and DB2 servers, with these caveats: Both DB2 servers must be running the same version, DB2 9.1, and the DB2 server can only have one DB2 instance and one DB2 database for the Domino server. 18 Topic 1: Domino and DB2 Overview
  • 19. Remote connection, many Domino-to-one DB2 Multiple Domino server computers are configured to connect to a single DB2 server. There are two ways to implement this type of connection: • All in the same DB2 instance. Each Domino server manages its own NSFDB2 database on the DB2 server. • Each in its own DB2 instance. Each Domino server manages its own NSFDB2 database in its own dedicated DB2 instance. This is the recommended configuration, as shown in this diagram: Domino Server 2 Domino Server 2 SQL DB2 DB2 Server 2 Runtime Client with Domino Security DB2 Access server Domino Server 3 DB2 Instance 1 NSFDB2_2 Domino Server 3 DB2 Runtime Client DB2 Instance 2 NSFDB2_3 DB2 Instance 3 NSFDB2_4 Domino Server 4 Domino Server 4 DB2 Storage Runtime Client With either configuration, each Domino server must point to its own unique NSFDB2 database on the DB2 server whether it is in a shared or individual DB2 instance. Benefits that DB2 brings to Domino So what are the advantages to adding DB2 to Domino? The benefits to using DB2 for Domino data storage are: • Improved performance for some applications (greater transaction processing speed of DB2 compared to Domino, as well as resource savings to Domino due to the offloading of processing to the computer running DB2 especially when it comes to view indexing) and increased scalability. • Access to SQL-based views of Domino and non-Domino data by Notes, as well as other clients, for example to create reports using SQL that can join data from multiple NSFDB2 and/or DB2 databases. SQL overcomes the performance limitations of Domino views that use @UserName, the current time, or other dynamic criteria provided by the user. Even off-the-shelf clients like Excel can use DB2 data that originates from Domino (see Topic 1: Domino and DB2 Overview 19
  • 20. http://www- 128.ibm.com/developerworks/db2/library/techarticle/0305singh/0305singh.html for instructions on how to use Office Connect). • Make NSFDB2 and DB2 databases available to browsers and mobile devices through Domino applications. • Better integration of Domino data with other external applications, including J2EE applications. • Like Domino, DB2 runs on a variety of hardware and software platforms (though not all are supported to run with Domino). • Store all enterprise data in a single database, making administration and disaster planning easier. Caveats But before you jump to the conclusion that you should use DB2 for all of your Domino databases, keep these things in mind: • It isn’t required that all databases get converted to run under DB2. Some you may want to keep as NSFs, and others convert to NSFDB2 on an as-needed basis. Domino can access both NSFs and NSFDB2 databases. • Some essential features are not supported for NSFDB2 databases, such as Extended ACLs. • If you decide to store user Mail databases in DB2, Shared Mail (Shared Copy Object Store) is not supported unless you unlink the database prior to converting them to NSFDB2. Also, the IMAP server does not support Mail databases that are NSFDB2s. • Most system databases MUST run as NSFs, including Domino Log (LOG.NSF), Domino Directory (NAMES.NSF), Directory Catalog (DIRCAT.NSF), Rooms and Resources (RESRC7.NSF), Administration Requests (ADMIN4.NSF), Domino Domain Monitor (DDM.NSF), Monitoring Configuration (EVENTS4.NSF), Domino Directory Cache (DBDIRMAN.NTF), Internet Certifier List (ICL.NSF), Domino Web Administrator (WEBADMIN.NSF), etc. Why is this? Aside from performance reasons, should the connection to DB2 be lost, the Domino Server can still start and run because all its essential system databases are local NSFs. This means that you must install and configure all server tasks to make sure required NSFs are created before you enable Domino to create new databases as NSFDB2s by default. 20 Topic 1: Domino and DB2 Overview
  • 21. • Transaction Logging (linear, circular, or archival) must be enabled to run on the DB2-backed Domino server. Enabling Transaction Logging has resource implications for your existing Domino server. • Backing up, relocating, or transporting an NSF (a single file that contains everything) has always been easy, whereas doing these things with a DB2 database is more difficult. • NSFs with an ODS of 41 or earlier or 48 (for R8) cannot be converted to NSFDB2s (which leaves ODS 43, R7’s). This really isn’t much of a problem, as upgrading or downgrading the ODS first is only a minor inconvenience. • Not all DB2 database features are supported, including: • Stored procedures cannot be triggered from a Domino application event. • Identity columns. • All the benefits of using DB2 come at a higher price than using just Domino: • You will have to install, configure, and administer the DB2 server software (and there may be added licensing costs). And if you don’t already know how to safely and securely administer DB2, you have much to learn. • The network connection between the DB2 and Domino servers must be equipped to handle a substantial increase in traffic. Having DB2 and Domino on the same computer is technically more efficient because the movement of data is done at memory level (no trip through the network layer), but for other reasons the two servers will most likely be on two computers, likely necessitating a network upgrade. • NSFDB2s are approximately three times larger on disk than the same database stored as a NSF. • Production DB2 servers are not lightweight. If you want the performance gains or scalability that has been promised in the marketing brochures, IBM’s DB2 performance-tuning guides quickly turn to the need for 64-bit systems with huge amounts of memory, n-way clustered systems (you can cluster up to 14 two-way IBM blade servers with 8 GB of memory each), and GB Ethernet and Fiber Channel connectivity to multiple disk arrays (at minimum, IBM recommends 6 to 10 disks per CPU). Topic 1: Domino and DB2 Overview 21
  • 22. Benefits that Domino brings to DB2 To get a sense of how Domino relates to DB2, you may want to compare it to how IBM’s other application server, WebSphere Application Server, relates to DB2: • If resources permit, Domino can be installed on the same computer as DB2 or on a remote computer, so there is some flexibility in how Domino is added to a DB2 environment. • WebSphere brokers the connection to DB2 on behalf of users. (They don’t interact directly with DB2.) • WebSphere defines the application logic, authenticates users (and passes credentials to DB2), and controls database access. So in this comparison (however simplistic it may be), WebSphere is one application server that uses DB2 databases; Domino is another. In the case of Domino as an application server that can front-end DB2, DB2 gain the ability to: • Quickly develop (using Domino Designer) and host robust, secure applications that can be consumed by millions of Notes users and countless browser and PDA users serviced by Domino. • Exploit all the (tightly integrated) Domino services such as directory, mail, security/encryption, and replication. • Integrate huge repositories of information stored in NSF databases with DB2 data. One could argue that DB2 has more to gain from the integration with Domino than what Domino gains from supporting DB2! 22 Topic 1: Domino and DB2 Overview
  • 23. DB2 resources This course provides only enough DB2, relational database, and SQL knowledge to set up a test/development environment in which you can begin to work with DB2 databases and Domino. This course does not, however, fully prepare you to become a DB2 administrator. IBM has a plethora of information on all aspects of DB2 administration and application development. The DB2 Information Center for Version 9.1 can be found at: http://publib.boulder.ibm.com/infocenter/DB2luw/v9/topic/com.ibm.DB2.udb.doc/w elcome.htm. Aside from the very thorough online help and release notes that come with Domino Administrator and Domino Designer, there are several helpful entry points into IBM’s world of information about DB2: • http://www.ibm.com/developerworks/DB2/ • http://publib.boulder.ibm.com/infocenter/DB2help/index.jsp (this is the online help) • http://www.ibm.com/redbooks You will also find this learning guide from SearchDomino.com helpful: http://searchdomino.techtarget.com/generic/0,295582,sid4_gci1124621,00.html Topic 1: Domino and DB2 Overview 23
  • 24. Notes 24 Topic 1: Domino and DB2 Overview
  • 25. Topic 2: Install DB2 Server Key points In this Topic you will see how to install and configure the DB2 Server software as the Instructor installs it, applies a license key, and creates a sample database. You will also be introduced to the three Command Line Tools as well as the graphical DB2 Control Center. Classroom environment In the classroom you and the Instructor will build a “Remote connection, many Domino-to-one DB2” environment. Each pair of students will be assigned two computers: • Domino already installed and configured. The Router, Replicator, and Administration Process tasks are running. • Notes/Domino Designer/Domino Administrator installed and configured. All the Domino servers and Notes clients are in the same Domino Domain as the Instructor’s Domino Server. This diagram shows the classroom environment that will be built, from your perspective: Your Client Computer Your Domino Computer Shared DB2 Computer DB2 Access DB2 Domino Server for Lotus Access Domino Views (already installed) Already installed: (to be installed) (to be created) • Notes 8 • Domino Administrator 8 • Domino Designer 8 NSFDB2_1 DB2 (to be created) To be installed: Runtime DB2 Server • DB2 (Administration) Client Client (already installed) NSFDB2_2 (includes DB2 Runtime Client and (to be installed) all the DB2 administration tools) NSFDB2_3 NSFDB2_4 You will add to this test/development environment as the course unfolds. Topic 2: Install DB2 Server 25
  • 26. DB2 on Windows platform requirements The Instructor will install the one DB2 Server software on a computer that meets these minimum requirements: • Intel processor running at 2GHz+ and 1 GB RAM (plus an additional 16 MB of RAM per five client connections), and 2 GB free disk space. • Windows XP Professional (SP 2+), Windows 2003 Server Standard Edition, or Windows 2003 Server Enterprise Edition (SP 1+). • The latest version of Internet Explorer or Mozilla Firefox. Caution: This configuration is only appropriate for creating a test/development environment supporting a handful of users. See the DB2 documentation for additional requirements you must meet in order to support more users. For an example (Windows 2003) of how to scale DB2, read this IBM Redbook: http://www.redbooks.ibm.com/abstracts/sg247019.html. 26 Topic 2: Install DB2 Server
  • 27. Obtain DB2 software installation packages Most people download IBM software from the IBM Passport or PartnerWorld download sites. Search for “IBM DB2 Enterprise Server Edition 9.1 for Domino 8.0” and choose eAssembly at either site to return the images to download: Note: As Domino and DB2 are upgraded, keep an eye on the release notes to verify that you are searching for and downloading the correct versions of each. Topic 2: Install DB2 Server 27
  • 28. This course will use the following DB2 software that has already been downloaded and is available on the local network: Package Function DB2 Enterprise Server Edition Shared DB2 Server that stores NSFDB2 9.1 for Domino 8.0 (C92APML) databases for multiple Domino servers installed in the classroom. DB2 Runtime Client 9.1 Required for Domino to access DB2 (C92FSML) when making a remote connection. You will install this software in Topic 7. Note: DB2 Run Time Client Lite (RTCL) is not supported. IBM DB2 Access for Lotus This is the DB2 Access Server that is Domino 8.0 (C13P5EN) installed on the DB2 Server computer. You will install this software in Topic 9. Note: If you are using a paid license version of DB2 9.1, you must have Fix Pack 2 installed (level or higher). You can download DB2 9.1 Fix Packs from http://www- 306.ibm.com/software/data/DB2/support/DB2_9/?S_CMP=rnav. There you will also find instructions on how to apply Fix Packs. If you are using the limited entitlement version of DB2 Enterprise Server Edition 9.1 for Domino 8.0 as shown above, however, the necessary Fix Packs have already been applied ( is the current level). 28 Topic 2: Install DB2 Server
  • 29. Extract DB2 Server installation packages After you download the installation packages, you can either: • Not recommended. Run it directly, which extracts the installer files to a temporary directory and then launches Setup.exe. After setup finishes, the temporary files will be deleted. • Recommended. Unzip it first using a utility such as WinZip to a more permanent installation directory. Then after the files are extracted, you can delete the original download file to save disk space and then manually run Setup.exe from the folder where you unzipped the package. This is the recommended approach and the one taken in the classroom, as it allows you to run the installer more than once and from anywhere on the network. Firewalls and DB2 Be sure to configure any personal and network firewalls that come between Domino, DB2, and the Client computers. This includes allowing program exceptions and traffic over specific ports (TCP/IP, Named Pipes, and Multiprotocol Remote Procedure Call) and so that DB2 can run and communicate. For example, to configure the Windows XP Firewall to allow DB2 communication, follow the instructions found in Configuring Windows XP SP2 Firewall for DB2 UDB (search for document 1175595 at http://www.ibm.com/support/us/). Instructor Demonstration: Install DB2 Server product The Instructor will follow these steps to install the one DB2 Server in the classroom: Step Action 1 Work at the DB2 server computer. 2 Log in as a user in the Windows Administrator group (local Administrator if the computer is not part of a Windows Domain or Active Directory; global Administrator group if it is). This security level is required because among other things, the DB2 installation adds a local Windows user account for the DB2 administrator. Topic 2: Install DB2 Server 29
  • 30. Step Action 3 Locate the installation directory for DB2 Enterprise Server Edition 9.1 for Domino 8.0. Run setup.exe to open the DB2 Setup Launchpad: 4 In the navigation pane on the left you can read about the installation prerequisites, release notes, and migration information. Click Install a Product. 5 Because this installer happens to include multiple products, click the Install New button under DB2 Enterprise Server Edition: This launches the InstallShield Wizard for the DB2 Enterprise Server Edition. 30 Topic 2: Install DB2 Server
  • 31. Step Action 6 The DB2 Setup Wizard starts. Click Next to start the installation. 7 The License Agreement page opens. Read the agreement and select I accept the terms in the license agreement. Click Next. Topic 2: Install DB2 Server 31
  • 32. Step Action 8 The Select the installation type page opens. Leave the installation type as Typical. Click Next. 9 The Select the installation, response file creation, or both page opens. Select Install DB2 Enterprise Server Edition on this computer. A response file comes in handy only if you are installing many servers using the same installation options. Click Next. 10 The Select installation folder page opens. Select a drive that has enough space for the installation. If you aren’t sure, click the Disk space button to check the space on the currently selected drive. Set the directory to something like C:IBMSQLLIB (Some of our examples show the installation to D:IBMSQLLIB and others to D:Program FilesIBMSQLLIB; in both cases you should translate them to the actual directory where you install DB2.) Click Next. 32 Topic 2: Install DB2 Server
  • 33. Step Action 11 The Set user information for the DB2 Administration Server page opens: The DB2 Administration Server is a Windows service that supports the DB2 GUI tools and assists with administration tasks on local and remote servers. (The analogue in Domino is the Administration Server for the Domino Directory and the Administration Process.) The DB2 Administration Server must be given authority to run. The DB2 Administration Server needs to run with Administrator authority under Windows (Act as part of the operating system, Create token object, Log on as a service, Increase quotas, and Replace a process level token) so that it can start or stop database instances/processes and perform other actions as required. Don’t click Next just yet. Topic 2: Install DB2 Server 33
  • 34. Step Action 12 If you decide to use an existing Windows user name, be sure the name exists (local or global) and has Administrator rights. If the name you choose is not in the Windows local or global directory, it will be added for you as a local Windows account. The only catch with using external directories is that there may be different rules for what constitutes a valid name. When working in a Windows directory, for example, a user name must be a valid Windows user name as well as a valid DB2 user name. Though both Windows and DB2 allow more characters (see both Help systems for details), for simplicity we’ll declare that the name can contain only lowercase letters a-z. For cross-system compatibility user names cannot exceed eight characters. And, user names cannot use: • Spaces, numbers, or any other character, punctuation mark, or accented characters. • SYS, DBM or IBM or any DB2 system or CLP command • Cannot begin with IBM, SYS, SQL, DBM, be any DB2 command or reserved word (such as USERS, ADMINS, GUESTS, PUBLIC, or LOCAL), or any SQL reserved word. 13 Leave the Domain field blank if the computer is not part of a Windows Domain; otherwise pick the domain name. Leave the User name field as the default name, db2admin. This user will be added as a local Windows user. For this course enter the password ibm (normally you would enter a strong password). Confirm the password ibm. Leave the option Use the same user and password for the remaining DB2 services selected. This will make it easier to administer all aspects of DB2 using a single administrative user’s authority. Click Next. 34 Topic 2: Install DB2 Server
  • 35. Step Action 14 The Configure DB2 instances page opens. The default instance name is DB2. Leave this default value. Click the Configure button. This is used to customize how the server communicates on the network. • On the TCP/IP tab, notice but do not change the Service name (db2c_DB2) or Port number (50001). You will see these again later when you configure Domino to connect to the DB2 Server. • On the Named Pipes tab, leave named pipes disabled. TCP/IP is the better and cross platform protocol choice. • The Startup tab specifies how the DB2 instance starts. Leave Autostart the instance at system startup selected so that Windows starts the DB2 Server (services) automatically after boot up. Click OK to close the DB2 instance configuration. Click Next. 15 The Prepare the DB2 tools catalog page opens. Select Prepare the DB2 tools catalog database and leave the default values for the database and schema names. The DB2 tools catalog includes the DB2 Task Center, Scheduler, and Information Catalog Center. Click Next. Topic 2: Install DB2 Server 35
  • 36. Step Action 16 The Set up notifications page opens. DB2 can contact administrators via email or pager when certain thresholds are met or events occur. Each server can save its own local Contact List or you can point all your DB2 Servers to a global Contact List. But we won’t be using the notifications feature in this course. (You can always specify the SMTP server and enable email notification after DB2 is running.) De-select Set up your DB2 server to send notifications. Click Next. 17 The Enable operating system security for DB2 objects page opens. Like Domino, DB2 restricts access to data first by authenticating the user against some directory (in this case Windows local accounts) and then giving the trusted name specific authorities and privileges within DB2. In addition to using the operating system account, DB2 also supports several external authentication methods. Regardless of the authentication method, the outcome of the authentication is a trusted user name that can then be used by DB2 to assign specific authorities and privileges. Select Enable operating system security. Leave the default DB2 administrator group as DB2ADMINS and the DB2 users group as DB2USERS. You will further configure DB2 user security (and sync it with Domino user security) in a later Topic. Click Next. 36 Topic 2: Install DB2 Server
  • 37. Step Action 18 The Start copying files page opens, displaying your responses. (This is what would have been stored in a response file if you elected to create one earlier.) Scroll down to review what will be installed (but not necessarily enabled). Click Install. 19 The installer copies the DB2 files and configures your system. It takes about ten minutes depending on the options you selected. If you have a previous version of DB2 Version 8, the installation program detects it and updates it to the newer version you are installing. The DB2 installer will install other software if it doesn’t already exist on the computer such as Java Runtime Environment (JRE) and Microsoft Data Access Components (MDAC). When the installation finishes, click Next. Topic 2: Install DB2 Server 37
  • 38. Step Action 20 The Setup is complete page opens. It reports what was accomplished, where to find the installation log files, and recommends any additional steps based on your choices during the installation. Don’t install any add-ins, as they are not needed (checkbox at the bottom). Click Finish. 38 Topic 2: Install DB2 Server
  • 39. Step Action 21 Assuming that you have a supported browser installed (you will be warned if not), the next thing that will happen is that the DB2 First Steps setup tool launches. But first you are prompted to create a browser profile: This gives your browser access to local DB2 files. Click Create profile. Topic 2: Install DB2 Server 39
  • 40. Step Action 22 The DB2 First Steps page opens in a browser window: If the DB2 Product Updates dialog box also opens, click No to decline going to the update service. We won’t be taking any “first steps” so you can close the window. Note: To run this Launchpad again in the future, run D:IBMSQLBINdb2fs.exe. 23 Reboot the computer. When the Windows restarts you will notice the new login for the user named db2admin. Log into Windows using this account (remember the password we suggested was “ibm”.) Note: It may take Windows a few minutes to add the new user’s personalized settings. 40 Topic 2: Install DB2 Server
  • 41. Step Action 24 DB2 starts as a Windows service (as you elected during the installation). To validate that DB2 has started, open Services from the Control PanelAdministrative Tools window. Find the services that constitute the basic DB2 Server. Notice that several have logged in under the credentials of the DB2admin user. Close the Services window. 25 Notice the menus under the Windows Start - Programs - IBM DB2 - <instance name>: But don’t start any tools just yet. Also, the Windows System Tray includes an icon you can use to quickly start and stop DB2 or open the DB2 Control Center: Click the icon for a menu. If Start (DB2) is grayed out this means that DB2 is already running. Otherwise, there is no “server console” like Domino that tells you DB2 is running. Important: For all the exercises to work, DB2 must be running. So if it isn’t running, start it now and leave it running unless told otherwise. Topic 2: Install DB2 Server 41
  • 42. Two types of DB2 commands Now that DB2 is installed and running, it is time to see how it operates. DB2 is a cutting-edge RDBMS that is ironically controlled by text commands issued to the server. There are two kinds of commands that you can issue to DB2: • System Commands. These “commands” are run only from the operating system command prompt or from a shell script. These commands control the overall operation of the server like adding new instances and users or to run utilities like the DB2 Control Center. Most of the executables in the IBMSQLLIBBIN folder make up the System Commands, and most of them require additional parameters. DB2 System Commands are analogous to running Domino server tasks like ncompact.exe or nfixup.exe from the operating system (when Domino isn’t running). • Command Line Processor (CLP) Commands. These commands are typically directed to a particular database, such as to execute SQL commands or perform database maintenance operations such as to catalog or backup and restore. 42 Topic 2: Install DB2 Server
  • 43. To learn about the two types of commands, open the DB2 Information Center. To do this in Windows, choose Start - Programs - IBM DB2 - <instance name> - Information – Information Center. The DB2 Information Center opens in a browser: Expand Reference in the Contents pane to find help on the two types of commands: CLP Commands System Commands Note: Also see http://www.ibm.com/developerworks/DB2/library/techarticle/dm- 0406dang/index.html for links to comprehensive examples of DB2 commands (a little dated, but still useful). Topic 2: Install DB2 Server 43
  • 44. Command Line Tools So now you know that there are two types of commands, how do you enter them? There are three Command Line Tools you can use to enter one or both types of DB2 commands: • Command Line Processor (CLP). Send CLP commands directly to the DB2 Server. • Command Editor. This is the more useful tool in that you can repeat CLP commands and edit previous commands you can then re-issue (especially useful when hammering out SQL statements). • Command Window. This tool is used only to issue System Commands. These three Command Line Tools can perform many administrative tasks from the most simple to very complex operations. They differ only in their usability. Again, to start one of the Command Line Tools, choose Start - Programs - IBM DB2 - <instance name> - Command Line Tools, which opens the menu to the three tools: Pick the tool you want to use. If you use these tools frequently, drag each one to the Windows Desktop to create a Shortcut to it. Instructor Demonstration: Add license key This is a perfect opportunity to demonstrate how to issue a System Command using the Command Window tool. Before you can run DB2, it must have a valid license key installed. If you installed the trial version of DB2, a license key will be applied for you during the installation process. Otherwise you must add a valid license or DB2 will not operate. 44 Topic 2: Install DB2 Server
  • 45. We’ll assume here that you are using the “limited entitlement to DB2 Enterprise Server Edition” that comes with Domino 8. In this case the license file (db2ese_o.lic) can be found in the directory where you unzipped the DB2 Access Server software. It is a text file, which you can view in a text editor: Follow these steps to install the license key to DB2: Step Action 1 The Control Center must be closed (if you happened to open it). 2 Working in Windows Explorer, locate the license key file (IBM DB2 License Certificates file) named db2ese_o.lic in the directory where you unzipped the DB2 Access Server software. Copy the file to the IBMSQLLIBBIN folder (this isn’t strictly necessary, but makes the next step easier). Topic 2: Install DB2 Server 45
  • 46. Step Action 3 For this operation we’re going to use the Command Window, one of the Command Line Tools (you will learn these tools later in the Topic). In Windows, choose Start - Programs - IBM DB2 - <instance name> - Command Line Tools, which opens the menu to the three Command Line Tools: Pick the last tool, Command Window. A Windows command prompt window opens to the D: IBMSQLLIBBIN folder. 4 Enter this System Command: db2licm -a db2ese_o.lic This command can add (hence the –a parameter), remove, list, and modify licenses and policies installed on the local server. Remember that you copied the .lic file to the BIN directory and db2licm is a program also in the BIN directory, so you don’t need to specify the full paths to either file name. DB2 adds the license and reports the success, for example: 5 Close the command window. 46 Topic 2: Install DB2 Server
  • 47. Note: If you had thought ahead, you could have added the license key to the /db2/license directory of the installation image before launching the DB2 Setup wizard, and it would have been added automatically. Or of course you could have used the License Center tool launched from the DB2 Control Center. Instructor Demonstration: Create SAMPLE database Now that DB2 licensed, the Instructor is going to create a database named SAMPLE. This database is a canned database provided with DB2. It has sample data that is used in all the examples in the documentation. Not coincidentally, SAMPLE is also used in this course to demonstrate how to administer the DB2 system and its databases. SAMPLE is so widely used that there is even a System Command db2sampl to create and populate the database! Note: You can also create this database from the DB2 First Steps page, but it too calls the same System Command that we are going to use to create and populate the database. Also, this is not the procedure you would normally follow to create other databases…it only works for SAMPLE. The Instructor will follow these steps to create the SAMPLE database using a System Command: Step Action 1 From Windows, choose Start - Programs - IBM DB2 - <instance name> - Command Line Tools - Command Window. A Command Window opens to the D:IBMSQLLIBBIN folder. Topic 2: Install DB2 Server 47
  • 48. Step Action 2 If it is possible that the SAMPLE database already exists, then the first attempt at using db2sampl fails: The second attempt uses the –force parameter, which drops and recreates the database. This is not a problem in the case of SAMPLE because all the data is recreated as well. The database is created in the default database directory specified during the installation, in this example D:DB2. There are other parameters to this command. To see what they are, append “?” to the System Command, for example: db2sampl ? 48 Topic 2: Install DB2 Server
  • 49. Instructor Demonstration: List databases To better describe all three of the Command Line Tools, let’s look at how they can be used on the DB2 Server to perform a very simple task, for example, to list all the databases on the server. FYI, DB2 databases are stored (in Windows) under the default DB2 data directory: <installation drive>:DB2NODE0000 For each database created, DB2 creates a folder for the database under the node root folder. DB2 handles the naming and cataloging of the database and stores all the files associated with the database files in its folder, for example: SQL00001 is a system database and TOOLSDB the tools catalog created during the server installation and of course SAMPLE, which was just created. The SQLDBDIR folder holds the database that the system uses to store information regarding the other databases. Generally speaking it is not necessary to know the directory structure of databases because the DB2 Control Center displays the database name (such as “SAMPLE”). But you can also list the database names stored in the numbered subdirectories using the Command Line Tools. Topic 2: Install DB2 Server 49
  • 50. Command Window As you have seen, the Command Window opens to an operating system prompt starting in the BIN directory where all the server executables are found. You have already seen the db2licm and db2sampl System Commands in action. Another System Command is “db2”, which runs the specified CLP command, for example: D:IBMSQLLIBBIN>db2 list database directory The CLP command is issued and the results are displayed: Append “?” to see a list of CLP commands you can issue from the Command Window: D:IBMSQLLIBBIN>db2 ? 50 Topic 2: Install DB2 Server
  • 51. Command Line Processor Rather than use the Command Window and the db2 System Command, you can interactively send commands from the DB2 Command Line Processor (CLP) window. This is like issuing commands at the Domino Server Console. The DB2 CLP window opens to a DB2 => prompt, where you can enter the list database directory command: But since you are already in “CLP mode”, you don’t need to enter the db2 prefix as you did in the Command Window. Feedback is listed, and the db2 => prompt waits for the next command. Enter quit to stop the Command Line Processor. To see a list of CLP commands just enter a question mark: Db2 =>? Tip: Press the Up/Down cursor keys to scroll through commands you have already entered. You can edit the command and press Enter to issue the revised version. Topic 2: Install DB2 Server 51
  • 52. Command Editor The Command Editor lets you issue CLP commands but is much easier to use than the other two tools. This tool is like the Remote Server Console in Domino Administrator, where you can enter and edit commands before issuing them. A quick way to the Command Editor is the tool in the DB2 Control Center Tool Selection Bar. The Command Editor window opens. Enter a command in the upper pane, and then click the Execute button. In this example the command is “list database directory”: The results of the command are displayed in the Results Pane below. Your previous commands can be recalled from the History window and you can save more complicated commands (like SQL statements) to a file, which you can then execute later. If a command is particular to a database (local or on a remote DB2 Server), select it as the Target (click the Add button) before running the command. 52 Topic 2: Install DB2 Server
  • 53. DB2 Control Center The Command Line Tools may come in handy under certain circumstances (like knowing DOS commands in Windows or grep in UNIX) versus using their GUI equivalents. But in this course and in practice you will more likely use the GUI tools that come with DB2 for system administration. Note: One exception is when developers use the Command Editor to prototype SQL statements before putting them into scripts or programs. You will do this in a later Topic to interact with DB2 data and to create Query View selection formulas. The DB2 Control Center is a cross-platform (Windows and HP- UX/Linux/AIX/Solaris), Java-based administration tool that is used to manage DB2 instances, databases, and database objects. The DB2 Control Center is installed by default on the DB2 Server for local server administration. From the DB2 Control Center you can also launch a number of tools and wizards to perform various administrative tasks. The DB2 Control Center is itself an example of an application that uses DB2 as its data store. The user sees a nice GUI interface, and the program logic formulates embedded SQL calls and DB2 Call Level Interface (CLI) commands, sending them out through the runtime client communication layer as DB2 and updating the GUI with the return results. The DB2 Control Center is analogous to Domino Administrator. Follow these steps to open the DB2 Control Center at the DB2 Server computer: Step Action 1 There are two ways to start the DB2 Control Center from Windows: • Click the DB2 System Tray icon and choose DB2 Control Center. • Choose Start - Programs - IBM DB2 - <instance name> - General Administration Tools - Control Center. Note: You can open multiple DB2 Control Center windows to work on different aspects of DB2. Topic 2: Install DB2 Server 53
  • 54. Step Action 2 The first time the DB2 Control Center opens, the Control Center View dialog box opens. This lets you set the initial window arrangement. Leave the default view Advanced. Deselect Show this window at startup time. Click OK. 3 The DB2 Control Center window opens to the Object View tab. We’ll come back to this later. Instructor Demonstration: Confirm license key Follow these steps to use the DB2 Control Center to confirm that a valid license key was applied earlier: Step Action 1 Start the DB2 Control Center on the DB2 Server computer. You can use the DB2 System Tray icon or choose Start - Programs - IBM DB2 - General Administration Tools - Control Center. 2 Choose Tools – License Center (or click the tool). 54 Topic 2: Install DB2 Server
  • 55. Step Action 3 The License Center opens. 4 Select the system name from the System name drop-down. You will be prompted to select the instance name. The only instance in our case is DB2. 5 The license information for the instance is displayed: Make sure that a license certificate has been installed and that the Expiry date is in the future. In this case, the restricted license that comes with Domino is “Permanent” meaning it won’t expire. 6 FYI, to add a new license key from within the License Center, choose License – Add. Topic 2: Install DB2 Server 55
  • 56. Step Action 7 The Add License window opens. License keys can be entered manually or preferably imported via a .lic file. Select a valid .lic file. Click the Apply button. You will see this message to the left of the buttons, “The license certificate has been added successfully.” Click OK. The new license certificate details appear. 8 Close the License Center window (don’t choose License – Shut Down DB2 Tools or the DB2 Control Center will close as well). DB2 Control Center Object View tab Now that we have a database to look at, this screen capture shows the DB2 Control Center window open to the default Object View tab; we’ve expanded the Object View to see the tables of the SAMPLE database: Tool Selection Bar Object View Contents Pane Contents Pane Toolbar Object Details Pane Object Details Pane Actions Alerts Bar 56 Topic 2: Install DB2 Server
  • 57. This table briefly describes the features of the DB2 Control Center Object View tab: Part Function Object View Displays system and database objects. As you expand the tree, the contents of the object are displayed in the Contents Pane. Right-click an object to see a context-sensitive menu. For example, right-click a server name and choose About to see the DB2 and operating system version numbers: Tool Selector Mostly repeats the items in the Tools menu to open up Bar other administration tools (all in their own windows) or to customize the DB2 Control Center and Tools windows. Contents Pane Displays the contents of the object selected in the Object Tree. For example, the columns of a table. Right-click an object to see a context-sensitive menu. The object details appear in the Object Details Pane. Contents Pane The items in the Contents Pane may be easier to work with Toolbar if sorted alphabetically or filtered. You can customize the column display, search, and select/deselect all items. Click the Default View to remove your customizations. Object Details When you click on an item in the Contents Pane, there are Pane often details. In the example above, clicking a table in the Contents Pane displays the table columns in the Object Details Pane. Topic 2: Install DB2 Server 57
  • 58. Part Function Object Details The Object Details Pane also lists some common actions Pane Actions that you can take on the current item. Alerts Bar Click the button to open the Health Center to see alerts and alarms that report the status of the instance and its databases and if any administrative actions are required. Note: You will learn more about the various DB2 Control Center features and tools in later Topics. See this two-part article about the DB2 Control Center tools: http://www- 128.ibm.com/developerworks/db2/library/techarticle/0307chong/0307chong.html and http://www- 128.ibm.com/developerworks/db2/library/techarticle/0308chong/0308chong.html. 58 Topic 2: Install DB2 Server
  • 59. Error! Reference source not found. 59