< Day Day Up > |
To implement DB2 effectively, you must have a set of standards and procedures that are the blueprint for DB2 development in your organization. Standards are common practices that provide an environment that is consistent, efficient, or understandable (for example, a naming standard for DB2 objects). Procedures are scripts that outline the way a proscribed event should be handled, such as a disaster recovery plan. DB2 standards and procedures are usually developed in conjunction with one another and stored in a common place. Standards and procedures are usually part of a corporate-wide (or IT-wide) standards and procedures document. They can be stored in printed format as well as being made available online for easy access. Most organizations publish their standards and procedures on their internal, corporate intranet site on the Web. Several vendors offer "canned" standards and procedures (both hard copy and online). One such example is Quest Software's DB2 Knowledge Xpert, which is a Windows -based technical resource designed to help developers and DBAs research and solve DB2 problems. This section describes the items that should be addressed by DB2 standards and procedures. Roles and ResponsibilitiesRunning DB2 requires a large degree of administrative overhead. Not only must the DB2 subsystem be installed and then maintained , but the functionality of DB2 must also be administered. This work constitutes the bulk of the administrative burden . A matrix of DB2 functions and who will support them is necessary. The matrix can be at the department level or at the job description level. Table 40.1 shows a sample matrix you can use as a template for your organization. Table 40.1. DB2 Roles and Responsibilities
The matrix in Table 40.1 represents a sampling of roles and responsibilities for the DB2 environment. Each block of the matrix represents a portion of the total responsibility for the given role. Your organization might have different roles responsible for different areas. Additionally, you might have more categories or a further breakdown of the categories (for example, dividing the Utilities Development line into a single line for each utility). Each position on the matrix should be accompanied by in-depth text as follows :
Remember, Table 40.1 is only an example. It is not uncommon for DB2 administrative tasks to be assigned to departments or jobs different from the ones shown in the table. Likewise, your organization might identify additional roles that need to be documented. Each shop should have a document appropriately modified to reflect the needs and organization of the company. This document will eliminate confusion when DB2 development is initiated. Analysts, programmers, and management will have an organized and agreed-on delineation of tasks and responsibilities before the development and implementation of DB2 applications. Based on the roles and responsibilities matrix in use at your shop, you might need to augment or change the following procedures. Certain functions may move to a different area, but all the necessary standards are covered. Data AdministrationA thorough treatment of data administration is beyond the scope of this book, but this section lists some basic guidelines. All DB2 applications must be built using the techniques of logical database design. This design involves the creation of a normalized, logical data model that establishes the foundation for any subsequent development. It documents the data requirements for the organization. Each piece of business data is defined and incorporated into the logical data model. All physical DB2 tables should be traceable to the logical data model. The data administration standards should outline the following:
Database Administration GuideA database administration guide is essential to ensure the ongoing success of the DBA function. The guide serves as a cookbook of approaches to be used in the following circumstances:
This document, although geared primarily for DBA staff, is useful for the programming staff as well. If the program developers understand the role of the DBA and the tasks that must be performed, more effective communication can be established between DBA and application development, thereby increasing the chances of achieving an effective and efficient DB2 application system. System Administration GuideThe DB2 system administrator is considered to be at a higher level than the database administrator. It is not unusual, though, for a DBA to be the system administrator also. A system administrator guide is needed for many of the same reasons that a DBA guide is required. It should consist of the following items:
Application Development GuideThe development of DB2 applications differs from typical program development. Providing an application development guide specifically for DB2 programmers is therefore essential. It can operate as an adjunct to the standard application development procedures for your organization. This guide should include the following topics:
DB2 Security GuideThe DBA unit often applies and administers DB2 security. However, at some shops , the corporate data security unit handles DB2 security. You must provide a resource outlining the necessary standards and procedures for administering DB2 security. It should consist of the following:
SQL Performance GuideThe SQL performance guide can be a component of the application development guide, but it should also exist independently. This document should contain tips and tricks for efficient SQL coding. It is useful not only for application programmers but also for all users of DB2 who regularly code SQL. QMF GuideIf QMF (or another query tool) is in use at your site, a QMF guide must be available. It should contain information from the simple to the complex so that all levels of QMF users will find it useful. This guide should cover the following topics, in increasing order of complexity:
Vendor Tools Guide(s)It is a good idea to have user guides available for each vendor tool in use at your company. Many of the vendors supply a user's guide that can be used "as is," or augmented with site-specific details such as who is authorized to use the tool, when it can be used, and how it was installed. Naming ConventionsAll DB2 objects should follow a strict naming convention. You learned some basic guidelines for DB2 naming conventions in Chapter 5, "Data Definition Guidelines." This section details the rules to follow in naming a DB2 object. Make names as English-like as possible. In other words, do not encode DB2 object names , and avoid abbreviations unless the name would be too long otherwise . Do not needlessly restrict DB2 object names to a limited subset of characters or a smaller size than DB2 provides. For example, do not forbid an underscore in table names, and do not restrict DB2 table names to eight characters or fewer (DB2 allows as many as 128 characters). Another rule in naming objects is to standardize abbreviations. Use the abbreviations only when the English text is too long. In most cases, provide a way to differentiate types of DB2 objects. For example, start indexes with I , tablespaces with S , and databases with D . In two cases, however, this approach is inappropriate. You should not constrain tables in this manner; you need to provide as descriptive a name as possible. The second exception is that views, aliases, and synonyms should follow the same naming convention as tables. In this way, DB2 objects that operate like tables can be defined similarly. The type of object can always be determined by querying the DB2 Catalog using the queries presented in Chapter 26, "DB2 Object Monitoring Using the DB2 Catalog and RTS." Provide naming conventions for the following items:
Migration and Turnover ProceduresThe minimum number of environments for supporting DB2 applications is two: test and production. Most shops, however, have multiple environments. For example, a shop could have the following DB2 environments to support different phases of the development life cycle:
Having multiple environments requires a strict procedure for migrating DB2 objects and moving DB2 programs and plans from environment to environment. Each shop must have guidelines specific to its environment because all sites do not implement these different environments in the same way. For example, both test and production DB2 could be supported using either a single DB2 subsystem or two DB2 subsystems. (Two are recommended to increase efficiency and turnaround time, but having two is a luxury some smaller shops cannot afford.) Dual versions of these procedures should exist to describe what is entailed from the point of view of both the requester and the person implementing the request. For the requester, the procedures should include what will be migrated, why and when it will be migrated, who is requesting the migration, and the authorization for the migration. For the person implementing the request, the procedures should include who is responsible for which portions of the migration and a description of the methods used to migrate. Design Review GuidelinesAll DB2 applications, regardless of their size, should participate in a design review both before and after they are implemented. Design reviews are critical for ensuring that an application is properly designed to achieve its purpose. Design reviews can take many forms. Some of the areas that can be addressed by a design review include the following:
Before discussing the different types of DB2 design reviews, I must first outline who must participate to ensure a successful review of all elements of the application. The following personnel should engage in the design review process:
Each of these participants does not need to take part in every facet of the design review. Holding more than one design review is best, with each one focusing on an aspect of the design. The scope of each design review should be determined before the review is scheduled so that only the appropriate participants are invited. You can break down the design review into seven distinct phases, which are described in the following sections. Phase 1The first phase of the design review process is the Conceptual Design Review (CDR). This review validates the concept of the application. This review involves a presentation of the statement of purpose as well as an overview of the desired functionality. A CDR should be conducted as early as possible to determine the feasibility of a project. Failure to conduct a CDR can result in projects that provide duplicate or inadequate functionality ”projects that are canceled because of lack of funds, staffing, planning, user participation, or management interest; or projects over budget. Participants should include AA, AD, DA, DBA, EU, EUM, and MM. Phase 2Phase 2 of the design review process is the Logical Design Review (LDR). This phase should be conducted when the first cut of the logical data model has been completed. A thorough review of all data elements, descriptions, and relationships should occur during the LDR. The LDR should scrutinize the following areas:
Failure to hold an LDR can result in a failure to identify all required pieces of data, a lack of documentation, and a database that is poorly designed and difficult to maintain. This failure results in the development of an application that is difficult to maintain. If further data modeling occurs after the logical design review is held, further LDRs can be scheduled as the project progresses. Participants should include AA, AD, DA, DBA, EU, EUM, and IC. Phase 3The third phase of the design review process is the Physical Design Review (PDR). Most DB2 developers associate this component with the design review process. In this phase, the database is reviewed in detail to ensure that all the proper design choices were made. In addition, the DA and DBA should ensure that the logical model was translated properly to the physical model, with all denormalization decisions documented. In addition, the overall operating environment for the application should be described and verified . The choice of a teleprocessing monitor and a description of the online environment and any batch processes should be provided. Data sharing and distributed data requirements should be addressed during this phase. At this stage, the SQL that will be used for this application might be unavailable. General descriptions of the processes, however, should be available. From the process descriptions, a first-cut denormalization effort (if required) should be attempted or verified. Because the PDR phase requires much in-depth attention, it can be further divided. The PDR, or pieces of it, can be repeated before implementation if significant changes occur to the physical design of the database or application. Participants should include AA, AD, DA, DBA, EU, EUM, IC, MM, OLS, OS, and TS. Phase 4Phase 4 is the Organization Design Review (ODR). It is smaller in scope ”but no less critical ”than the Physical Design Review. This review addresses the enterprise-wide concerns of the organization with respect to the application being reviewed. Some common review points follow:
Participants should include AA, AD, DA, DBA, EU, EUM, IC, MM, OLS, OS, and TS. Phase 5Phase 5, the SQL Design Review (SDR), must occur for each SQL statement before production turnover. This phase should consist of the following analyses. An EXPLAIN should be run for each SQL statement using production statistics. The PLAN_TABLE s should then be analyzed to determine whether the most efficient access paths have been chosen , whether the runtime estimates are within the agreed service level, and to verify function resolution when UDFs are used. If a plan analysis tool is available, the output from it should be analyzed as well. Every DB2 program should be reviewed to ensure that inefficient host language constructs were not used. In addition, efficient SQL implemented inefficiently in loops should be analyzed for its appropriateness. To accomplish this, you will need knowledge of the application language being used, whether it is COBOL, Java, or some other language. All dynamic SQL should be reviewed whether it is embedded in an application program or earmarked for QMF. The review should include multiple EXPLAIN s for various combinations of host variables . Be sure to EXPLAIN combinations of host variable values so that you test both values that are not one of the 10 most frequently occurring values and values that are one of the 10 most frequently occurring values. These values can be determined by running the column occurrence query as presented in Chapter 26. Different access paths can be chosen for the same query based on differing column value distributions. This needs to be taken into account to determine how best to implement RUNSTATS for tables accessed dynamically. Suggestions for performance improvements should be made and tested before implementation to determine their effect. If better performance is achieved, the SQL should be modified. Participants should include AD, DBA, EU, and IC. Phase 6Phase 6 is the Pre-Implementation Design Review (Pre-IDR). This phase is simply a review of the system components before implementation. Loose ends from the preceding five phases should be taken care of, and a final, quick review of each application component should be performed. Participants should include AA, AD, DA, DBA, EU, EUM, IC, MM, OLS, OS, and TS. Phase 7The last design review phase is phase 7, the Post-Implementation Design Review (Post-IDR). This phase is necessary to determine whether the application is meeting its performance objectives and functionality objectives. If any objective is not being met, a plan for addressing the deficiency must be proposed and acted on. Multiple Post-IDR phases can occur. Participants should include AA, AD, DA, DBA, EU, EUM, IC, MM, OLS, OS, and TS. |
< Day Day Up > |