Your SlideShare is downloading. ×
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Table of contents
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Table of contents

2,213

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,213
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Table of contents Course overview ..................................................................................................................................1 Agenda ................................................................................................................................................2 DB2 UDB for iSeries strategic initiatives .............................................................................................3 DB2 UDB for iSeries V5R3 enhancements .........................................................................................4 Application development enhancements.............................................................................................5 SQL and RPG......................................................................................................................................6 Microsoft .NET Framework..................................................................................................................7 Microsoft .NET Framework (continued)...............................................................................................8 Java and Web services .......................................................................................................................9 OLE DB, ODBC, CLI .........................................................................................................................10 Cursor sensitivity ...............................................................................................................................11 Improved SQL diagnostics and dynamic cursor control ....................................................................12 Quiz ...................................................................................................................................................13 DB2 and SQL enhancements............................................................................................................14 New column types and attributes ......................................................................................................15 New functions for column encryption and decryption........................................................................16 New functions for column encryption and decryption (continued).....................................................17 Sequence object ................................................................................................................................18 Sequence object (continued).............................................................................................................19 INSERT and SELECT enhancements...............................................................................................20 Stored procedure enhancements ......................................................................................................21 Stored procedure enhancements (continued) ...................................................................................22 Richer SQL function set.....................................................................................................................23 Miscellaneous DB2 UDB enhancements ..........................................................................................24 INSTEAD OF triggers ........................................................................................................................25 Quiz ...................................................................................................................................................26 Performance improvements ..............................................................................................................27 V5R3 DB2 UDB performance enhancements ...................................................................................28 V5R3 SQE enhancements ................................................................................................................29 V5R3 SQE enhancements (continued) .............................................................................................30 Performance: New QAQQINI options................................................................................................31 Quiz ...................................................................................................................................................32 High availability and other enhancements.........................................................................................33 Journal enhancements ......................................................................................................................34 Online and parallel reorganize...........................................................................................................35 Online and parallel reorganize comparison.......................................................................................36 Tools and utilities ...............................................................................................................................37 iSeries Navigator enhancements.......................................................................................................38 iSeries Navigator: Index evaluator.....................................................................................................39 iSeries Navigator: Show related ........................................................................................................40 iSeries Navigator: Graphical procedure debugger ............................................................................41 iSeries Navigator: Constraint management.......................................................................................42 Rational XDE modeler .....................................................................................................................43 DB2 Migration Toolkit enhancements................................................................................................44 IBM software utilities for DB2 UDB for iSeries ..................................................................................45 Quiz ...................................................................................................................................................46 New table types for DB2 UDB ...........................................................................................................47 Education roadmap ...........................................................................................................................48 Summary ...........................................................................................................................................49 Additional information ........................................................................................................................52 Trademarks and Disclaimers.............................................................................................................56
  • 2. Instructions Requirements • JavaScript is required to navigate Click here to test your browser for compatibility. Browsers If you have one of these browsers you should be set. • Netscape Communicator/Navigator Version 4.0.5 or better • Microsoft Internet Explorer Version 4.0 or better • Mozilla Firefox You can download this course and take it off-line This course can be downloaded so you can conveniently take it off-line. You will need to have installed a copy of Adobe Acrobat Reader (you can download this reader by clicking here). If you want to download the Acrobat files related to this course click here. There are two separate files to download. One contains the foil screens (graphics), the other contains the speaker notes (text). The foil and speaker notes pages have been numbered to help you in putting them together. Additional information As you go through this course, you will observe, and probably take advantage of, frequent hotlinks that send you to other Web sites for more details about a particular topic. These hotlinks have been compiled in one long list at the end of the course (under “Additional information”) and can be accessed by clicking on the LINKS option in the navigator bar. We think these links are important, but you might prefer to visit these sites at some later point so that, for right now, you can stay focused on the “meat” within this course. You can clip the contents of this “Additional information” page into a document file on your local PC drive. Then, at your convenience, you can use these saved hotlinks to explore these topics in greater detail. The “Additional information” page also has references pertaining to this course. Speaker Notes Open or close the Speaker Note window with these buttons. Navigation These are the general navigation buttons: • Click NEXT to go forward one page. • Click PREV to go back one page. • The AGENDA page lists all the pages in this IBE for quick navigation. • The LINKS page contains the hotlinks to related information. • The GLOSSARY page contains definitions of terminology used in this course. • The FAQ page lists frequently asked questions about the subject. • The QUIZ page asks you questions about what you've learned. • Click EXIT to leave the course.
  • 3. Kent Milligan DB2 technology specialist IBM eServer Solutions Enablement Kent Milligan is a DB2 technology specialist in IBM eServer Solutions Enablement. Kent spent many years of his IBM career as a member of the DB2 development group in Rochester, Minnesota. He speaks and writes regularly on various iSeries relational database topics.
  • 4. DB2 UDB for iSeries: V5R3 Overview ® DB2 UDB for iSeries: V5R3 O verview Kent M illigan DB2 technology specialist IBM eServer Solutions Enablem ent 8 Copyright IBM Corporation, 2005. All Rights Reserved. This publication m ay refer to products that are not currently available in your country. IBM m akes no com m itm ent to m ake available any products referred to herein. Course overview This course is intended to educate DB2® developers on the new functions and features offered by the V5R3 release of IBM® i5/OS™. This operating system supports the IBM® eServer™ iSeries™ family of systems that are based on IBM POWER5™ processors. (Previous releases of the iSeries operating system were called OS/400®.) This course is not designed to be an initial primer for those who want to learn DB2 coding skills. To be successful in taking this course, you should be familiar with the iSeries operating environment, basic IBM terminology, and the basic principles related to IBM DB2 Universal Database™ (UDB) for iSeries programming and Structured Query Language (SQL) coding. Page 1 of 55
  • 5. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities Agenda This course is divided into five sections. First, you will learn a high-level overview of the development enhancements for DB2 UDB for iSeries that relate to your application design efforts. You will also look at the IBM strategic objectives with this broadly popular database system. Then you will delve into DB2 UDB and SQL enhancements. You will also learn about performance improvements that are part of the V5R3 release. There is also a discussion about high availability and enhancements to support IBM On Demand Business™. And, you will look briefly at the tools and utilities available to work with DB2 UDB in your iSeries environment. Page 2 of 55
  • 6. DB2 UDB for iSeries: V5R3 Overview DB2 UDB for iSeries strategic initiatives Openness - Industry standard support Accommodate solution providers The industry trend Portability and compatibility toward off-the-shelf Flexibility software results in iSeries installations using SQL a move to SQL ... 100% Continued LEADERSHIP in database technologies 80% 60% Consistency across DB2 family 40% Shared R and D across IBM labs 20% Continued leveraging of iSeries strengths 0% 1988 1992 1996 2000 2004 Availability Scalability V5R3 DB2 UDB for iSeries V5R2 Usability (Total cost of ownership) Application flexibility Microsoft SQL Server 2000 Oracle 9i Release 2 0 10 20 30 40 50 60 70 80 90 2003 Core Items DB2 UDB for iSeries strategic initiatives This chart shows the strategic direction IBM has established for DB2 UDB for iSeries. As you progress through this course, you will be able to relate the V5R3 enhancements back to these initiatives. SQL is the industry standard for database access and programming. While the heritage of application development on the iSeries platform has been to use native interfaces, more and more iSeries application builders are using SQL as a programming language. This is the result of the critical investments IBM has made in support of SQL technologies within the DB2 UDB for iSeries product. In the upper graph on this chart, you can see the trend toward greater usage of SQL. SQL is the strategic database interface for DB2 UDB for iSeries to accommodate all the porting of third-party applications and tools, almost all of which utilize SQL-based interfaces for their data access. As you can also see on the lower right-hand graph, DB2 UDB for iSeries actually leads the industry in support of the latest SQL core standard. i5/OS V5R3 has significantly increased the compatibility of DB2 UDB for iSeries with the standard. Several IBM research labs consistently produce advances in database technology. The beauty of the IBM DB2 family is that the DB2 implementation on all eServer platforms can share from this research. DB2 UDB for iSeries will continue to leverage this technology leadership position and will maintain close compatibility with the other DB2 family members. Additionally, DB2 UDB for iSeries will sustain its record of leveraging and building on the strengths of the iSeries platform. Those strengths include: reliability, availability, total cost of ownership, scalability, and usability. Page 3 of 55
  • 7. DB2 UDB for iSeries: V5R3 Overview DB2 UDB for iSeries V5R3 enhancements Application flexibility and portability Performance • Enhanced support for SQL standards • SQL query engine enhancements – INTERSECT – Star Join enhancements – GET DIAGNOSTICS – Constraint awareness • Improved compatibility with DB2 UDB – OnDemand stats generation family • Faster SQL deletes – SEQUENCE object • Faster stored procedure call – UTF encodings for unicode processing – Column encryption – Instead Of triggers Usability • Native .NET provider • iSeries Navigator enhancements – Index evaluator Server consolidation – Reorg table manager • Database migration toolkits – RI constraint manager • Enhanced RPG SQL precompiler On Demand and availability • Online and parallel reorganize • "Ragged" save while active • Journal enhancements DB2 UDB for iSeries V5R3 enhancements DB2 UDB for iSeries enhancements for V5R3 provide an extensive breadth of features focused on standardization, globalization, and expansion of support for a broad range of applications. New functions range from an enhanced ILE RPG SQL precompiler and improved Web services and Java interfaces, to native support for the Microsoft® .NET Framework. Business intelligence (data warehousing) applications benefit from advances in query optimization technology, too. Globalization support is enhanced with new features for Unicode Transformation Format (UTF) encodings. Availability enhancements include online and parallel table reorganization. Industry-leading standard SQL and DB2 family improvements make it even easier to port applications to DB2 UDB for iSeries. These SQL enhancements also provide a side benefit of improving support for several database migration toolkits available from IBM. The toolkits include new capabilities that help developers convert IBM Informix® databases. Features such as the generation of IBM On Demand Business statistics and the recognition of star schemas will benefit data warehousing applications through the enhanced SQL Query Engine (SQE) optimizer. The query optimizer uses statistics that are automatically collected in real time by DB2 UDB for iSeries to enhance performance in an SQL environment. A native .NET managed provider, delivered through IBM iSeries Access for Windows®, allows you to build applications with the .NET Framework to leverage and access DB2 UDB data. In addition, through the IBM DB2 Connect™ product, applications can leverage the wizards and plug-ins to the Visual Studio development environment that provide tight integration with DB2 UDB for iSeries. Page 4 of 55
  • 8. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities Application development enhancements SQL, .NET, Java™, and Web services, even OLE DB, ODBC, and call level interface (CLI) are among the many options available for your flexible coding needs that keep growing with each operating system release for the iSeries platform. Next, you will get to see more details about the DB2 UDB support for these standards. Page 5 of 55
  • 9. DB2 UDB for iSeries: V5R3 Overview SQL and RPG Enhanced ILE RPG SQL precompiler V5 qualified subfield names support based on RPG IV D-spec QUALIFIED keyword only 1 level of qualification - arrays not supported Conditional precompilation /If, /Define, /Include, and other directives Support for Nested /Copy Properly parse source members with sub procedures eliminates out-of-sequence error Allow use of array data structures on blocked Fetch and Insert Support for host structure in Update statements cannot be array data structure Allow use of LIKEDS and LIKEREC 2nd optional parameter of LIKEREC not supported New COMPILEOPT parameter on CRTSQLRPGI eliminates 2-step compile process Support for RPG logical (indicator) variable application responsible for only allowing values of 0 or 1 Some restrictions still remain: Free-format SQL and support for qualified names (greater than 1 level) Support for proper scoping of local variables (multi-pass) SQL and RPG The iSeries Developer Roadmap* has caused many solution providers to look at modernizing their iSeries applications by utilizing SQL for data access instead of the native iSeries interfaces. This type of data access modernization effort has most often been accomplished by embedding SQL into existing RPG and COBOL programs. Many iSeries developers have successfully utilized embedded SQL in their applications. Here on this screen, you can see the list of enhancements to the RPG SQL precompiler in V5R3 so that embedding SQL programming is easier. There are still a few remaining restrictions with the RPG SQL precompiler of which developers should be aware. Issues that need to be addressed in future releases include: support for free-format SQL, multi-pass compilation to allow proper scoping of variables, and elimination of remaining restrictions for qualified names. *Note: The iSeries Developer Roadmap represents a logical and recommended path for bringing traditional iSeries applications into a Web application-driven environment. There is an online tutorial regarding this roadmap. (A link to this education site is provided in the “Additional information” section of this course.) Page 6 of 55
  • 10. DB2 UDB for iSeries: V5R3 Overview Microsoft .NET Framework Native .NET provider for iSeries systems – Packaged in iSeries Access for Windows V5R3 Client V5R3 functionality includes: Restrictions: – Connection pooling – Package support (Extended – Stored procedures Dynamic) – SQL and SYS naming formats – Datalink columns – Unicode and LOBs – CMD/PGM call – Isolation level/commitment control – Data queues – Tracing – Blocked inserts – Compression – AutoCommit restricted to isolation level (*none) Microsoft .NET Framework One approach to modernizing solutions involves the use of embedded SQL. Taking advantage of one of the latest programming technologies, such as Java, is another option. The Microsoft® .NET Framework is yet another technique. The V5R3 release of iSeries Access for Windows client includes a new .NET native provider to access DB2 UDB data; this will be helpful for companies that have standardized on Microsoft languages and development tools. The integrated .NET provider offers better performance than ODBC- based solutions that have been available in previous releases. The .NET native provider does have functional limitations, which are listed on this screen. These restrictions will be addressed in a future release. For specific examples of using this .NET provider, you can read the Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET IBM Redbook™. (A link is provided in the “Additional information” section of this course.) Page 7 of 55
  • 11. DB2 UDB for iSeries: V5R3 Overview Microsoft .NET Framework (continued) DB2 application development "Stinger” technology Improved DB2 .NET data provider Better performance and support for DB2 UDB for iSeries Part of DB2 Connect Enhanced DB2 UDB add-ins for Microsoft Visual Studio Integrate DB2 UDB functionality into Microsoft development tooling Ease creation of DB2 UDB objects: – Stored procedures – Triggers – User-defined functions ibm.com/iseries/db2/awp.html ibm.com/servers/enable/site/education/ibo/view.html?oc#db2 Microsoft .NET Framework (continued) The DB2 Connect product also contains a .NET provider that can be used by iSeries developers to access DB2 UDB databases. This .NET provider also includes a set of wizards and plug-ins for the Microsoft Visual Studio development environment that allow seamless access to DB2 UDB data. Additionally, the wizards make it easy to embed business logic into DB2 UDB stored procedures from a Visual Studio interface. For details on how to get and use this .NET provider, you can read the Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET Redbook. (A link is provided in the “Additional information” section of this course.) Page 8 of 55
  • 12. DB2 UDB for iSeries: V5R3 Overview Application development enhancements: Java and Web services Support for scrollable stored procedure result sets (all SQL interfaces) Toolbox JDBC driver enhancements Enhanced AutoCommit (isolation level other than *NONE can now be used) Enhanced XA (distributed transaction support) Native JDBC driver enhancements Improved performance of character data processing Connection refusal for connections/jobs using 65535 CCSID to prevent confusion on “Row not found” errors DB2 UDB Web services Available on Post-GA V5R2 with WebSphere Application Server Express Support for SQL select, insert, update, and delete statements along with stored procedure calls WORF component handles invocation and XML formatting out of results More details in white paper: DB2 UDB for iSeries and Web services Java and Web services DB2 UDB for iSeries has supported scrollable result sets for several releases, but result sets returned from stored procedure calls were not scrollable. With V5R3, all application programming interfaces support scrollable stored procedure result sets. Java is a strategic programming interface for IBM, so the JDBC drivers were enhanced to keep this Java-based middleware robust and current. Better transaction support was the biggest area of improvement for the JDBC drivers. Web services constitute an emerging technology that provides a model for offering business or application services over the Internet, as well as within an organization. The value of DB2 UDB-specific Web services is that they let you provide direct access to your business data without any high-level-language (HLL) programming. This streamlined approach allows you to concentrate on the SQL request rather than worrying about the Java application code having to establish a database connection. You also do not need to be concerned with packaging and deploying the Java code. DB2-specific Web services permit you to retrieve and change data in iSeries databases and invoke stored procedures. The WebSphere® Web Services Object Runtime Framework (WORF) component simplifies deployment and maintenance of DB2 UDB-specific Web services. This component was actually made available after the GA of OS/400 V5R2. More details can be found in the IBM white paper “DB2 UDB for iSeries and Web Services.” (A hotlink to this course is located in the “Additional information” section of this course.) Page 9 of 55
  • 13. DB2 UDB for iSeries: V5R3 Overview OLE DB, ODBC, CLI Enhanced OLE DB provider – SQL-only provider (IBMDASQL) including MTS support – Support for commitment control – Support for SQL packages (for example, Extended Dynamic) ODBC driver enhancements – Enhanced MTS and XA transaction support – Enhanced AutoCommit – ODBC driver for Linux applications CLI improvements – Column-wise binding to complement existing row-wise binding support – SQLGetInfo enhanced to return SQL_Keywords and Connection_Job_Name – New connection attributes for: • Setting minimum and maximum values for precision and scale • Unicode SQL statements (SQL_ATTR_UCS2 - also available on V5R2) • Hex literals designation OLE DB, ODBC, CLI ODBC and OLE DB are two popular database interfaces used by many Microsoft Windows-based solutions to access business data stored in DB2 UDB for iSeries. Both programming interfaces are included with iSeries Access for Windows and received substantial enhancements in V5R3. Almost all restrictions that existed for the OLE DB provider, including support for packages and commitment control, have been eliminated with the introduction of the SQL-only provider, IBMDASQL. As with the IBM Toolbox for Java JDBC driver, the ODBC driver features improved support for distributed transactions. The SQL call level interface (CLI) is a popular server-side programming interface used by many applications for data access. New support for column-wise binding eliminates one of the biggest hurdles encountered in the past when porting CLI-based applications to the iSeries platform. The new connection attributes give application developers greater flexibility in customizing applications for i5/OS and OS/400. Page 10 of 55
  • 14. DB2 UDB for iSeries: V5R3 Overview Cursor sensitivity Determines if database recognizes table changes (insert, update, delete) after a cursor has been opened ASENSITIVE - Default, DB2 UDB can choose any setting. Updateable cursors always default to SENSITIVE. INSENSITIVE - Cursor will be insensitive to changes and behave as a read-only cursor by creating a temporary result file to process. SENSITIVE - Cursor implementation will have some sensitivity to changes. Prevents temporary copies and usage of DB2 SMP. Interface (get more details in Cursor Sensitivity article at: ibm.com/iseries/db2/sqe.html) Embedded SQL: New keywords on DECLARE CURSOR and PREPARE ATTRIBUTES OLE DB "Cursor Sensitivity" connection property (0-Asensitive/1- Insensitive/2-Sensitive) Static cursors are always insensitive (same for ODBC). Forward Only cursors can never be sensitive (same for ODBC). ODBC: SQL_ATTR_CURSOR_SENSITIVITY attribute on SQLSetStatementAttr (ODBC 3.0) or CURSORSENSITIVITY Connection keyword for ODBC 2.0 JDBC: "Cursor sensitivity" connection property (asensitive/insensitive/sensitive) Insenstive value only recognized with TYPE_FORWARD_ONLY result set type Sensitivie value only recognize with TYPE_SCROLL_SENSITIVE result set type Cursor sensitivity Cursor sensitivity refers to a cursor setting that defines whether or not the result set returned by a cursor will include recent changes to the underlying table. V5R3 allows the developer to choose from three sensitivity settings: • Asensitive: is the default setting and lets DB2 UDB for iSeries pick the setting it thinks will perform best. But, updateable cursors always default to the sensitive setting. • Sensitive: is the setting that causes DB2 UDB to avoid using algorithms that make data copies, including DB2 symmetric multiprocessing (DB2 SMP). Thus, it can access the latest changes made to a table when running a query. For example, a sensitive cursor declared as SELECT * FROM orders would return all current orders and any new orders inserted in the database after the cursor was opened. • Insensitive: is the setting that causes DB2 UDB for iSeries to use an implementation that makes data copies up front so that table activity after the cursor is opened is not recognized. Because the sensitive and insensitive settings limit the options for the query optimizer, the asensitive setting is recommended for better application performance. The support for controlling the sensitivity setting on the ODBC, OLE DB, and IBM Toolbox for Java JDBC programming interfaces is also available on V5R2 via PTFs. The ability to control cursor sensitivity with embedded SQL using the DECLARE CURSOR or PREPARE ATTRIBUTES statements is only available on V5R3. For more details on cursor sensitivity, including programming examples, see the Web site shown on this screen. (Also listed in the “Additional information” section of this course.) Page 11 of 55
  • 15. DB2 UDB for iSeries: V5R3 Overview Improved SQL diagnostics and dynamic cursor control Dynamic cursor control with cursor attributes on PREPARE – Allows you to adjust the sensitivity, scrolling, lock holding, and result set attributes of an existing cursor – PREPARE s1 ATTRIBUTES :hv1 FROM :stmt New GET DIAGNOSTICS statement – Superset of all SQL error and diagnostic interfaces – Provides functionality and information similar to ODBC "SQLGet“ functions like SQLGetConnectAttr and SQLGetStmtAttr Examples: Statement Info: GET DIAGNOSTICS rcount = ROW_COUNT, rcmd = COMMAND_FUNCTION, rnbr = NUMBER, Connection Info: rmore = MORE GET DIAGNOSTICS rcname = CONNECTION_NAME, rcsts = CONNECTION_STATUS, rnbr = DB2_PRODUCT_ID Improved SQL diagnostics and dynamic cursor control The new PREPARE ATTRIBUTES statement allows you to adjust different attributes of a cursor definition dynamically. In the past, if an application required the ability for a single cursor to be used both as a scrollable and nonscrollable cursor, the application would need to define the same cursor twice with different settings. The PREPARE ATTRIBUTES functionality allows the application developer to easily modify the behavior of an existing embedded SQL cursor definition without defining a different version of the same cursor. Embedded SQL error processing in V5R3 is also easier with the introduction of a new SQL statement, GET DIAGNOSTICS. This statement provides a single interface to all SQL error and diagnostic information and incorporates the information provided previously only by Get methods, such as the ODBC SQLGetStmtAttr and SQLGetConnAttr functions. Access to diagnostic information is also simplified by the use of keywords as opposed to extracting information out of a complicated data structure, such as the SQL communication area (SQLCA). Here you see examples of using the GET DIAGNOSTICS statement to get feedback on the results of a previously executed SQL statement and to acquire details on the current database connection. Page 12 of 55
  • 16. DB2 UDB for iSeries: V5R3 Overview Quiz 1) The enhancements made to the RPG SQL precompiler with V5R3 fix all the restrictions that existed in earlier releases. True False – IBM has several restrictions such as support for free format RPG that need to be added to the precompiler in a future release. 2) Which of the cursor sensitivity settings provides the best performance: a) Asensitive – In general, this setting provides the best performance because it gives DB2 UDB the freedom to choose the most efficient implementation regardless of the sensitivity setting. b) Sensitive c) Insensitive 3) The iSeries .NET provider supports stored procedures and connection pooling. True False Page 13 of 55
  • 17. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities DB2 and SQL enhancements In this section, you will learn more about the new column type and attributes, as well as new functions for column encryption and decryption. We will discuss the sequence object, which is also new with V5R3 and can improve developer productivity. There are also improvements to the insert and select statements and enhancements to stored procedures. Page 14 of 55
  • 18. DB2 UDB for iSeries: V5R3 Overview New column types and attributes BINARY and VARBINARY data types Large decimals (up to 63-digit precision) New Unicode support: UTF-16 and UTF-8 encodings – Enhances performance in Unicode-based environments, like Java, by eliminating EBCDIC to Unicode conversion. – Examples: • UTF-16: name GRAPHIC(10) CCSID(1200) • UTF-8: name CHAR(10) CCSID(1208) • UCS-2 : name GRAPHIC(10) CCSID(13488) New column types and attributes V5R3 includes some data type enhancements to give developers more options. The maximum precision for decimal fields was increased from 31 to 63. Support was also enhanced with the ability to allow Unicode data to be encoded in a UTF-8 or UTF-16 format. This complements the universal character set 2-byte encoding (UCS-2) that has been available for several releases. In addition, DB2 UDB for iSeries supports the normalization of Unicode data. The BINARY and VARBINARY SQL data types were primarily added for the column encryption support that will be discussed next. Page 15 of 55
  • 19. DB2 UDB for iSeries: V5R3 Overview New functions for column encryption and decryption Encrypt and decrypt SQL scalar functions Requires the IBM Cryptographic Access Provider 128-bit product Column requirements: Data type requirements: BINARY/VARBINARY, CHAR/VARCHAR FOR BIT DATA, BLOB, and DDS CHAR/VARCHAR with CCSID(65535) Length requirements: Extra 8 bytes and total length must be rounded to 8-byte boundary (replace 8 with 16, if BLOB or double-byte CCSID) 32-byte hint can optionally be stored with encrypted value Example: 6-byte employee ID with no hint needs to be stored in a VARBINARY(16): CREATE TABLE emp( id VARCHAR(16) FOR BIT DATA, name VARCHAR(50)) SET ENCRYPTION PASSWORD = 'protect' INSERT INTO emp VALUES(ENCRYPT('112233'), 'BOB SANDERS' ) SELECT DECRYPT_CHAR(id), name FROM emp New functions for column encryption and decryption Protection of personal and sensitive data is a new requirement that affects many application solutions. DB2 UDB for iSeries now includes encryption and decryption column functions, so that iSeries developers do not need to write their own encryption routines. Underneath the covers, the DB2 encrypt and decrypt scalar functions utilize the IBM Cryptographic Access Provider for iSeries 128-bit product to add another layer of security around your data. i5/OS and OS/400 security services do a good job of preventing unauthorized users from accessing personal and financial data stored in DB2 UDB objects. i5/OS and OS/400 object-level security, however, is not as useful when trying to prevent authorized users, such as a customer support representative, from seeing your social security number. Object-level security will also not prevent access to columns containing sensitive data when a hacker has stolen the ID and password of an authorized user. Specific data type and length requirements must be met in order to use the column encryption function. This is because the encrypted version of the data will be a binary value and longer than the original data string. Here on this screen, you see a simple example of how to set the encryption password, as well as the encryption of the employee ID value, as inserted into a DB2 UDB table. The decrypt_char function on the SELECT statement uses the same password to return the original employee ID value of ‘112233’ back to the application. Page 16 of 55
  • 20. DB2 UDB for iSeries: V5R3 Overview New functions for column encryption and decryption (continued) Encrypt and decrypt SQL scalar functions – Password management: • When connected to remote databases, password is sent in the clear – Consider using communication encryption (IPSEC or SSL) • Best option is to store password in i5/OS validation list – Encryption password would be stored in encrypted data value – List entry name can be table name or other identifier – Validation list suggestions: » Make public authority *EXCL » Programs need authority to access validation list, best to use program adopted authority • Password hint (if stored) retrieved with GETHINT function: SELECT GETHINT(id) FROM... – Native program access: • Encryption: Use before or instead of triggers to intercept write requests; then have trigger execute Encrypt function against sensitive columns. • Decryption: Define SQL view containing decrypt; then open SQL view as logical file to read unencrypted data. New functions for column encryption and decryption (continued) If a remote client (that is, a Java applet running in a Web browser) sends an encryption password to encrypt or decrypt data on an iSeries server (to DB2 UDB for iSeries), extra precautions should also be taken. This is necessary because the password itself is sent “in the clear.” It is not encrypted. To protect the password, use one of the encryption mechanisms listed on this screen. A best practice that was not used in the previous coding example is the technique of hardcoding the password string on the SET ENCRYPTION PASSWORD statement, as well as on the encryption and decryption functions. The SET ENCRYPTION PASSWORD statement and its associated functions allow the password string to be passed in with a host variable or parameter marker. The next logical question is, “Where is the safest place to store encryption passwords so that they can be retrieved and assigned to the password string variables?” On iSeries systems, a validation list object is a good container for encryption passwords, because the password can be encrypted when stored in the list object. Each validation list entry allows you to store an entry identifier with an encrypted data value. The encryption password is stored in the encrypted data value and the list entry identifier is assigned the table name or another value that makes it easy to retrieve the encryption password for a specific column or row. A set of i5/OS APIs make it simple for application programs to populate a validation list and retrieve values from the list. Native I/O programs will either use SQL to leverage the new encryption and decryption functions, or utilize the design alternatives listed here. Details on DB2 UDB column encryption are found in a white paper entitled: Column Encryption in IBM DB2 UDB for iSeries. (A link to this paper is given in the “Additional information” section of this course.) Page 17 of 55
  • 21. DB2 UDB for iSeries: V5R3 Overview Sequence object Another DB2 UDB construct that supports the automatic generation of column values Viewed as a superset of V5R2 identity columns Generated values easily shared across tables Can create constant sequence to be used as global DB2 UDB variables Example: CREATE SEQUENCE order_seq START WITH 1 INCREMENT BY 1 NO MAX VALUE INSERT INTO orders(ordnum,custnum) VALUES (NEXT VALUE FOR order_seq, 123) VALUES NEXT VALUE FOR order_seq INTO :hostvar UPDATE orders SET ordnum = :hostvar WHERE custnum = 123 Sequence object The sequence object, new to DB2 UDB in V5R3, can improve the productivity of iSeries developers by moving simple business processing, such as key value generation, into the DB2 UDB engine. A sequence object can be viewed as providing a superset of the capabilities found in the identity column attribute support (that was delivered in V5R2). Identity columns work well for generating independent key values, but what if the generated key value needs to be shared across several different tables? A DB2 UDB sequence object makes this much easier because the current key value is stored in the sequence object itself. The following example shows how to create the sequence object and how to access the next key value. The CREATE SEQUENCE statement creates the sequence object and initializes it with the value defined on the START WITH clause. There is also an ALTER SEQUENCE statement to allow the sequence object attributes to be changed. The INSERT statement uses the NEXT VALUE expression to grab the current sequence value. DB2 UDB then increments the sequence object to the next value in the sequence. In this example, the value of 1 would be written to the ordnum column in the orders table. The VALUES statement shows how to use the NEXT VALUE expression to copy the current sequence value into a host variable. The generated key value in the host variable can then be easily shared across different tables. Page 18 of 55
  • 22. DB2 UDB for iSeries: V5R3 Overview Sequence object (continued) Sequence values can be used to generate non-numeric key CREATE SEQUENCE s START WITH 1001; ... ID='N'||CAST(NEXT VALUE FOR s AS CHAR(4)) Customizable sequence attributes START WITH and INCREMENT BY MINVALUE and MAXVALUE CYCLE and NO CYCLE CACHE and NO CACHE - To improve performance, DB2 allocates a block of sequence values at the job/connection level. ORDER and NO ORDER - ORDER ensures that values are returned in the actual order that they are requested independent of the job/connection. NO ORDER is the default. ORDER also disables caching. Sequence attributes can be changed with the ALTER SEQUENCE statement CREATE SEQUENCE s1 NO CACHE ORDER CREATE SEQUENCE s1 CACHE 20 NO ORDER Job1: NEXT VALUE FOR s1 => VALUE = 1 Job1: NEXT VALUE FOR s1 => VALUE = 1 Job 2: NEXT VALUE FOR s1 => VALUE = 2 Job 2: NEXT VALUE FOR s1 => VALUE = 21 Job 1: NEXT VALUE FOR s1 => VALUE = 3 Job 1: NEXT VALUE FOR s1 => VALUE = 2 Job 1: NEXT VALUE FOR s1 => VALUE = 4 Job 1: NEXT VALUE FOR s1 => VALUE = 3 Job 2: NEXT VALUE FOR s1 => VALUE = 5 Job 2: NEXT VALUE FOR s1 => VALUE = 22 Sequence object (continued) Another advantage that sequence objects have over the identity column is that a sequence object can be used to generate alphanumeric key values, as demonstrated in this first example. Different attributes are available, such as the increment value and cycling option to control the key values generated by a sequence object. These attributes can be specified when the sequence object is created or changed with the ALTER SEQUENCE statement. The ALTER SEQUENCE statement can also be used to change the current value of a sequence object. The example at the bottom of this screen (on the right in blue) shows the effect of the ORDER and CACHE default attributes. For performance reasons, sequence objects are created by default with the NO ORDER and CACHE 20 attributes. The first time a job or database connection accesses a sequence object, DB2 UDB for iSeries allocates the next 20 sequence values (that is, the cache) for usage within that job. This allows DB2 UDB for iSeries to supply the next 20 sequence values without going back to the sequence object and locking that object. This caching of sequence values provides the best performance. The side-effect of this caching behavior is that the sequence values are not assigned in a true increasing order. If the sequence values do need to be assigned in the exact increasing sequence, then the ORDER attribute can be specified as demonstrated in the example on the left. Specifying the ORDER attribute does not perform as well because this attribute prevents any caching of sequence values. Page 19 of 55
  • 23. DB2 UDB for iSeries: V5R3 Overview INSERT and SELECT enhancements INSERT row expression values for blocked inserts INSERT INTO table1 VALUES (11,'TESTING'), (2,'ADMINSTRATION') EXCEPT and INTERSECT operators Return all rows that are in t1, but not t2 (SELECT cusnum FROM orders2003) EXCEPT DISTINCT (SELECT cusnum FROM orders2004) All rows that exist in t1 and t2 (SELECT cusnum FROM orders2003) INTERSECT DISTINCT (SELECT cusnum FROM orders2004 ) Named column joins SELECT * FROM t1 INNER JOIN t2 USING (c1, c2) Lateral correlation SELECT * FROM t1,TABLE(SELECT * FROM t2 WHERE t1.c1=t2.c1) AS t3 INSERT and SELECT enhancements V5R3 provides an enhanced INSERT statement with new syntax for blocked inserts. Blocked inserts can now be performed without a host language array by simply repeating the row values on a single INSERT statement, as demonstrated in this example. V5R3 also supports the INTERSECT and EXCEPT set operations. In the first example, the EXCEPT DISTINCT operator returns the difference between two sets. In this case, the difference between the two result sets are a list of those companies that placed an order in 2003, but not in 2004. The second query returns a list of companies that placed orders in both 2003 and 2004 with the INTERSECT DISTINCT operator. Named column join support simplifies a join query when the name of the join columns in the tables being joined is the same. The USING clause simplifies the join logic by eliminating the need to code: T1.C1 = T2.C1 AND T1.C2 = T2.C2 Page 20 of 55
  • 24. DB2 UDB for iSeries: V5R3 Overview Stored procedure enhancements Faster call processing Up to 50% performance improvement on repeated calls within a connection Improved processing of long SQL procedure names Improved procedure resolution with unqualified procedure calls and *SYS naming External procedure enhancements Support for service program objects Improved external program marking More efficient code generation for SQL procedure (function and triggers) DB2 UDB family compatability: WITH HOLD clause for FOR loop FOR v1 AS c1 CURSOR WITH HOLD FOR SELECT firstname, lastname FROM emp DO SET fullname = firstname || ' ' || lastname; INSERT INTO namelist VALUES (fullname); ... END FOR; Stored procedure enhancements With V5R3, the internal processing and caching that DB2 UDB performs is improved when a stored procedure is called repeatedly from the same job. IBM measurements of this enhancement have shown up to a 50% performance improvement on repeated stored procedure calls. Stored procedure calls are also more efficient because of improved resolution of unqualified procedure calls. The external stored procedure support also receives a boost by now allowing service program objects to be registered as stored procedures. In previous releases, only program objects could be registered as external stored procedures. The FOR loop statement was also enhanced for better compatibility with other DB2 UDB products by allowing the WITH HOLD clause to be specified on the cursor definition. Page 21 of 55
  • 25. DB2 UDB for iSeries: V5R3 Overview Stored procedure enhancements (continued) Result set enhancements Scrollable stored procedure result sets (cursor result sets only) Result set consumer control RETURN TO CLIENT DECLARE c1 CURSOR FOR WITH RETURN TO CLIENT SELECT * FROM t1 SET RESULT SETS WITH RETURN TO CLIENT FOR CURSOR x1 RETURN TO CALLER DECLARE c1 CURSOR FOR WITH RETURN TO CALLER SELECT * FROM t1 SET RESULT SETS WITH RETURN TO CALLER FOR ARRAY :array1 FOR :hv1 ROWS Return Return to Proc A to Proc A client caller Proc B Proc B Stored procedure enhancements (continued) Result sets returned by stored procedures are now scrollable with V5R3. Two new clauses for the DECLARE CURSOR and SET RESULT SET statements give programmers greater control of how stored procedure result sets are consumed. In V5R2, if ProcedureA calls ProcedureB, there is no way for ProcedureB to return a result set to the invoker of ProcedureA. The result set is only returned to the caller, ProcedureA. V5R3 supports a WITH RETURN TO CLIENT clause on the DECLARE CURSOR and SET RESULT SET statements that allows the result set from ProcedureB to be passed back to the application that invoked ProcedureA (as demonstrated in the screen). The WITH RETURN TO CALLER clause allows a programmer to specify pre-V5R3 behavior where the stored procedure result set is only passed back one level to the direct caller of the stored procedure. Support for the WITH RETURN TO CLIENT and WITH RETURN TO CALLER clauses is now available on V5R2 by applying the latest V5R2 database group PTF. Page 22 of 55
  • 26. DB2 UDB for iSeries: V5R3 Overview Richer SQL function set REPLACE Returns a string where a given SELECT REPLACE('ABCXYZ','ABC','123') FROM t1 string is replaced with another returns '123XYZ'. string. EXTRACT Returns the specified portion of SELECT EXTRACT(YEAR FROM datecol) FROM t1 a datetime value. returns the year from the date. INSERT Returns a string where one SELECT INSERT('INSERTING',1,3,'XX') FROM t1 substring is deleted and another returns 'XXERTING' substring is inserted. REPEAT Returns a string composed of SELECT REPEAT('ABC', 2) FROM t1 another string repeated n times. returns 'ABCABC'. DAYNAME Returns the name of the day of SELECT DAYNAME(datecol) FROM t1 the week. returns the name of the day from the date MONTHNAME Returns the month name from a SELECT MONTHNAME(datecol) FROM t1 datetime value. returns the name of the month from the date. RIGHT Returns the rightmost N SELECT RIGHT('ABCXYZ',3) FROM t1 characters from a string. returns 'XYZ'. TIMESTAMP_ISO Returns a timestamp based on SELECT TIMESTAMP_ISO(datecol) FROM t1 a date, time, or timestamp returns the timestamp from datecol. argument. Other new functions include: MULTIPLY_ALT, BIT_LENGTH, OCTET_LENGTH, DATABASE Richer SQL function set The toolset of built-in SQL scalar functions is also richer in V5R3 with the addition of functions such as: REPLACE, EXTRACT, INSERT, REPEAT, DAYNAME, MONTHNAME, RIGHT, and TIMESTAMP_ISO. These new functions help with the manipulation and processing of character strings as well as date and time values. Page 23 of 55
  • 27. DB2 UDB for iSeries: V5R3 Overview Miscellaneous DB2 UDB enhancements DATE, TIME, and TIMESTAMP literals LOCALTIME and LOCALTIMESTAMP special registers Limit improvements – 256 tables in a View – 1.7 TB table size limit CPYFRMIMPF support for BLOBs (V5R2 PTF available: SI08237) Easier database creation script management with RUNSQLSTM – Severity level 20 now causes DROP errors to be ignored. New Exit Point for database Open: QIBM_QDB_OPEN – Offers more information and control than object-level auditing • Exit Program cancels Open operation if it considers access to be unauthorized. • Exit Program differentiates between Opens caused by query versus application. – Exit Point available on V5R2 PTF (SI17353 and SI17578) Miscellaneous DB2 UDB enhancements Here are some miscellaneous DB2 UDB enhancements. The processing of date, time, and timestamp values have been made easier with the new literal support and special registers in V5R3. Two items support growth of DB2 UDB for iSeries environments. The increased maximum number of tables allowed on a View definition has risen from 32 to 256, while the increased maximum table storage size is 1.7 terabytes. The latest V5R2 PTFs also increase the table storage limit on V5R2 from 1.4 to 1.7 terabytes. The Copy From Imported File (CPYFRMIMPF) CL command has more functionality when loading data copied from other databases now that it supports the importing of BLOB, CLOB, and DBCLOB values. A V5R2 PTF is also available for this V5R3 enhancement. Finally, the Run SQL Statement (RUNSQLSTM) CL command has been enhanced to allow errors on DROP SQL statements to be ignored by setting the severity level on the RUNSQLSTM command to 20. The first time that an SQL database creation script is run on a server, the SQL DROP statements often fail because the database objects that are being deleted do not exist. Specifying a severity level of 20 allows the RUNSQLSTM command to successfully execute the database creation script by ignoring errors generated by DROP requests. A new exit point allows user programs to be called on every database OPEN operation. The capabilities offered by this exit program are similar to object-level auditing, but the exit program receives more information on the type of database request and has the ability to reject the open operation if it determines the data access is unauthorized. Page 24 of 55
  • 28. DB2 UDB for iSeries: V5R3 Overview INSTEAD OF triggers New trigger type can be used to change semantics of INSERTs, UPDATEs, and DELETE operations against a view. – Certain views contain transformations that make the view read-only, but application really wants to use the View for all I/O operations – Not part of V5R3 GA, delivered with V5R3 database group PTF #4 (ibm.com/iseries/db2/iot.html) • New trigger type not viewable with iSeries Navigator, or DSPFD, in V5R3 • All view types are NOT supported in V5R3 (for example, views referencing more than one table not supported until next release) – Example: CREATE VIEW my_logins(system, login, passwd) AS SELECT system,login,decrypt_char(passwd) FROM regusers WHERE userid=USER CREATE TRIGGER insert_my_logins INSTEAD OF INSERT ON my_logins REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL INSERT INTO regusers VALUES (USER,n.system,n.login,Encrypt(n.passwd)) CREATE TRIGGER update_my_logins INSTEAD OF UPDATE ON my_logins REFERENCING OLD AS o NEW AS n FOR EACH ROW MODE DB2SQL UPDATE reguser SET system=n.system,login=n.login,passwd=Encrypt(n.passwd) WHERE system=o.system AND login=o.login AND userid=USER INSTEAD OF triggers The most recent V5R3 database group PTF includes support for a new type of trigger that makes it even easier to incorporate encryption and decryption into your applications. This new type of trigger is known as an INSTEAD OF trigger. It should be noted that the INSTEAD OF trigger PTF support does include some restrictions (see he link provided in the “Additional in formation” section for more details) that will be eliminated when the full support is delivered in a future i5/OS release. The biggest difference with INSTEAD OF triggers compared to the existing DB2 trigger support is that INSTEAD OF triggers can only be defined over views. INSTEAD OF triggers were created to enhance the behavior of INSERT, UPDATE, and DELETE operations against views. Certain views contain transformations that make the view read- only. For instance, INSERT and UPDATE operations cannot be performed against the my_logins view defined in this example because the decrypt_char scalar function causes this view to be treated as read-only. The my_logins view is used by applications so that the password column can be automatically decrypted on read operations. It would make sense that, if an application performed write operations against this view, the my_logins view would automatically encrypt the data. An INSTEAD OF trigger can be defined on the my_logins view to perform this automatic data encryption, as shown in these INSTEAD OF trigger examples. Page 25 of 55
  • 29. DB2 UDB for iSeries: V5R3 Overview Quiz 1) The IBM cryptographic coprocessor card must be installed in order to use the DB2 encryption and description scalar functions. True False – The cryptographic hardware cards are not required. The DB2 functions do not use any of the services provided by these cards. 2) Storing encrypted column values in an existing column requires the length of that column to be: a) Shorter b) Longer – The encrypted column value will be longer than the original column value. c) Unchanged 3) The values returned from a sequence object are sometimes out of sequence. True – By default, DB2 UDB allocates a cache of the next 20 sequence values the first time a sequence object is referenced within a job or connection. When multiple jobs are sharing a sequence object the sequence values are not given out in sequence. False 4) Which of the following clauses on the DECLARE CURSOR statement can be used to return a result set back further than just the invoker of the stored procedure: a) RETURN TO CALLER b) RETURN TO CLIENT – c) RETURN TO INVOKER Page 26 of 55
  • 30. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities Performance improvements Performance is so critical to today’s applications, even though the requirements for almost any application effort continue to become more complex. You will be pleased with some of the strong performance announcements with i5/OS V5R3 and DB2 UDB for iSeries. Page 27 of 55
  • 31. DB2 UDB for iSeries: V5R3 Overview V5R3 DB2 UDB performance enhancements Enhanced SQE capabilities Caching of deterministic UDF calls (SQE only) Faster stored procedure call processing Improved SQL function and procedure expressions Faster DELETE without WHERE clause statements CLRPFM used when used with "No Commit" isolation level Special ALTER TABLE used when run with isolation level/commitment control Enhanced database monitor Ability to suppress monitor records for short-running SQL requests Filter to eliminate DB2 generated SQL statements More diagnostic details on events that force Full Open/ODP Creation Parallel reorganize V5R3 DB2 UDB performance enhancements A faster database engine always simplifies the life of a developer and there are several SQL performance enhancements in V5R3. The SQL Query Engine (SQE) picks up steam in V5R3 as it can now process a wider range of SQL statements including support for subqueries and views. The SQE enhancements will be discussed in greater detail in upcoming screens. SQL requests executed by SQE, and that invoke deterministic user-defined functions (UDFs), are also faster in V5R3. The Deterministic function attribute allows DB2 UDB for iSeries to cache the input and output values for a function call. Future function executions that match the cached input values will return the cached output value without rerunning the user-defined function. As developers have moved from native I/O to embedded SQL, they often wonder why a Clear Physical File Member (ClrPfm) command is faster than the SQL equivalent of DELETE FROM t1. The reason is that the SQL DELETE statement removes a single row at a time. In V5R3, DB2 UDB for iSeries utilizes new techniques to speed up processing when every row in the table is deleted. In some cases, DB2 UDB will try to use the Clear Physical File command under the covers to delete all the rows; and in other instances, will use new algorithms that delete groups of rows, instead of only one row at a time. One tool for analyzing SQL performance problems is the database monitor. However, collecting database monitor data can add a significant amount of overhead to the server. Thus, new QAQQINI settings reduce the amount of data collected by the monitor to lessen the overall impact on system performance. Enhancements to the monitor data also make analysis of ODP (open data path) creation and deletion easier. Page 28 of 55
  • 32. DB2 UDB for iSeries: V5R3 Overview V5R3 SQE enhancements Elimination of the following V5R2 restrictions: View references UNION Subqueries Derived tables and common table expressions Update and delete-capable statements Remaining SQE restrictions: LIKE Predicate LOB columns Sort sequences ALWCPYDTA(*NO) and SENSITIVE cursors Logical file references Select/omit logical files Non-SQL interface V5R3 SQE enhancements As mentioned, SQE is enhanced in V5R3 to process a greater number of SQL requests by eliminating many restrictions from the previous release. However, SQE needs further enhancements before SQL requests involving LIKE predicates, LOB columns, sort sequences, or select/omit logical files can benefit from the new engine. Page 29 of 55
  • 33. DB2 UDB for iSeries: V5R3 Overview V5R3 SQE enhancements (continued) Star Join recognition (Lookahead Predicate Generation) Check constraint awareness – SQE stats manager can use constraints to improve accuracy of filter factors and cardinality – SQE optimizer will rewrite query to avoid execution when input data is out of range Constraint def: CHECK(col1 BETWEEN 1 AND 100) Original query: SELECT * FROM t2 WHERE col1=:hv Rewritten query: SELECT * FROM t2 WHERE (:hv BETWEEN 1 AND 100) AND col1 = :hv RI constraint awareness – SQE optimizer can rewrite query to eliminate join combinations Immediate on-demand statistics generation Result set caching Customized Visual Explain for SQE access methods “Enhanced” index advisor (requires latest database group PTF) V5R3 SQE enhancements (continued) The DB2 UDB optimizer and engine were re-engineered in V5R2 partly to provide a modern code architecture that would make it easier to add new technologies. That design point is starting to be realized in V5R3 with the SQE query optimizer’s ability to recognize star schema joins as well as an awareness of check and referential integrity (RI) database constraints. Optimizer constraint awareness means the query optimizer can use check and referential integrity constraint definitions to make query implementations more efficient by reducing the amount of data to be searched. For example, a check constraint is now in place to ensure that the order quantity column value is between 1 and 100. If a user runs a query to see all orders with a quantity value greater than 100, the optimizer will use the constraint definition to prevent the query from running at all. This is because the constraint prevents the insertion of any row with a quantity value greater than 100. When V5R2 became available, SQE delivered automatic statistics collections that allow query performance to improve over time without any administrator intervention. With that release, statistics automatically collect in the background and are then available for future executions of the query, resulting in improved query performance. With V5R3, SQE adds extra intelligence to the optimizer that enables DB2 UDB to automatically collect statistics inline, immediately improving the performance of complex, long running queries. For decision support or data warehouse environments, in which the underlying data remains fairly static, the ability of the SQE to cache the result set of a query can also dramatically improve performance when many users are running the same report frequently. After the first user runs the report, SQE will cache the results and then return the cached result to the next user who runs the report, (without executing the query at all). The latest V5R3 database group PTF includes an enhanced index advisor for queries processed by SQE. Before this PTF, advised index information was incomplete because the advisor only considered columns referenced by selection predicates; it did not look at columns referenced on join predicates or ordering and grouping clauses. By evaluating all predicates and clauses on the queries, the new index advisor provides recommendations on the “perfect” index for a query. (For details on building the perfect index, read the Indexing Strategy white paper found in the “Additional information” section of this course.) Page 30 of 55
  • 34. DB2 UDB for iSeries: V5R3 Overview Performance: New QAQQINI options Option Description Possible values SQL_STMT_COMPRESS_MAX 1 Allows the user to adjust background Integer(1-255, 2) access path compression when using SQL packages. IGNORE_DERIVED_INDEX Allows SQE to process SQL *NO, *YES statement even when an unsupported index type exists over the table(s). SQL_FAST_DELETE_COUNT 1 Allows user to control when and *NONE, how V5R3 SQL Fast Delete support *OPTIMIZE, Integer is used. CACHE_RESULTS 1 Allows SQE to use cached results *SYSTEM, sets from previously run queries. *JOB,*NONE 1 Only available on V5R3, no PTFs for prior releases Performance: New QAQQINI options This table shows some of the important, new QAQQINI options in V5R3. One of these options (IGNORE_DERIVED_INDEX) is also available on V5R2 with the latest PTFs. The values highlighted with bold text are the default settings for each of the QAQQINI options. The first two QAQQINI options listed on the screen reduce the data collected by the database performance monitor, which similarly reduces CPU and disk resources that would otherwise have been consumed by the database monitors. The Database Monitor Threshold option allows monitor data to only be collected for the longest running SQL statements. If a value of 300 seconds (five minutes) is specified, then monitor data is only collected for those SQL statements the query optimizer estimates will run longer than 300 seconds. Sometimes the DB2 UDB engine will generate SQL statements to perform actions as a result of an application request. By default, SQL_DBMON_OUTPUT will not collect monitor data for SQL statements generated by DB2 UDB. If you need to see information for all SQL statements executed, this QAQQINI option can be modified to specify that setting. The Ignore Derived Index (IGNORE_DERIVED_INDEX) option can be used to process more SQL requests through the SQL query engine (SQE). If a query runs against a table or physical file with a select/omit logical file created over it, SQE will not be used to process the request. The Ignore Derived Index setting of *YES lets the SQL query engine process this request, but the SQE query optimizer will ignore the select/omit logical files in the query implementation. Before running with this setting, analyze the database tables to confirm that there are enough other indexes in place to make up for the fact that the SQE optimizer cannot use the select/omit logical files. The last two QAQQINI options, SQL_FAST_DELETE_COUNT and CACHE_RESULTS, turn off the two V5R3 enhancements discussed earlier. This is not recommended, but may be required in rare cases where applications depend on pre-V5R3 implementations of these features. CACHE_RESULTS can also be used to specify that result caching be done at a job or connection level. Page 31 of 55
  • 35. DB2 UDB for iSeries: V5R3 Overview Quiz 1) Check and referential integrity constraints can cause the SQE query optimizer to rewrite an SQL request from an application or end user. True – The SQE query optimizer in V5R3 examines constraint definitions to see if they can be used to improve the efficiencies of queries. False 2) In V5R3, all SQL statements are processed by the SQL Query Engine (SQE). True False – SQE does not yet support all types of SQL requests. For instance, LOB columns and LIKE predicates prevent SQE from being used. 3) Which of the following QAQQINI options can be used to reduce the amount of data collected by the Database Performance Monitor: a) SQL_Stmt_Compress_Max b) Database_Monitor_Threshold – c) Cache_Results Page 32 of 55
  • 36. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities High availability and other enhancements High availability goes hand-in-hand with performance as an enterprise-level concern. In this section, you will learn about journaling enhancements as well as online and parallel reorganize. Page 33 of 55
  • 37. DB2 UDB for iSeries: V5R3 Overview Journal enhancements Enhanced save while active support - SAVACTWAIT(*NOCMTBDY) New CHGJRNOBJ command to adjust journal attributes on the fly New journal sequence maximum - *MAXOPT3 FRCAPPPTH(*YES) and JRNSTATE(*INACTIVE) settings are now ignored RCVJRNE now supports 1024 journal receviers NEW defaults for journal commands and settings CRTJRNRCV: THRESHOLD default changes from *NONE to 1.5 GB CRTJRN: MNGRCV default changes from *USER to *SYSTEM APYJRNCHG/RMVJRNCHG: CMTBDY default changed to *YES AUDIT Journal: Uses RCVSIZOPT(*MAXOPT1) SMAPP(EDTRCYAP): *SYSDFT drops from 90 to 60 minutes New Journal Minimal Data Checksum to increase data integrity of journal apply Journal performance improvements Faster long-running ROLLBACKs Remote Journal Super Bundling RCVJRNE Performance Improved 15-20% Journal enhancements Several journal and system availability enhancements improve the availability of DB2 UDB for iSeries. The Save While Active support has been enhanced with the ability to save a DB2 UDB table and index, even if that object contains changes from an uncommitted transaction. If that save is used to recover a DB2 UDB database, then it is up to the administrator to address the uncommitted transactions after the DB2 UDB object has been restored. The Change Journal Object (CHGJRNOBJ) CL command is one of the tools that an administrator can use to deal with a restored object containing uncommitted changes. The limits and default settings have been changed on several journal-related interfaces to improve the recovery and availability of iSeries systems. To increase data integrity, check summing is now used with the Journal Minimal Data support introduced in V5R1. (The Journal Minimal Data support reduces the amount of space consumed by journal receivers.) V5R3 also includes several journal-related performance improvements as listed on this screen. Page 34 of 55
  • 38. DB2 UDB for iSeries: V5R3 Overview Online and parallel reorganize New reorganize capabilities activated with new parameter ALWCANCEL(*YES) – ALWCANCEL(*YES) requires file to be journaled – New parameter, LOCK, controls the concurrent access – If Exclusive lock not requested, then row order may be different and space may not be reclaimed Parallel capabilities rely on DB2 SMP licensed feature being installed and activated New Index Rebuild parameter RBDACCPTH – RI and Unique indexes always maintained Online and parallel reorganize V5R3 features support online and parallel Reorganize Table operations. The best interface for using this new reorganize support is the iSeries Navigator Reorganize Table Manager interface shown on this screen. It was built to complement enhancements to the Reorganize Physical File Member (RgzPfm) command that enables reorganize operations to be performed in parallel and online. The online reorganize allows the reorganization to be performed at the same time that applications access the file, and enables the reorganize operation to be suspended and restarted. Parallel reorganize is performed whenever the DB2 Symmetric Multiprocessing (DB2 SMP) feature is installed and activated via the QQRYDEGREE system value or the Change Query Attributes (CHGQRYA) command. The online reorganize is controlled with new parameters on the Reorganize Physical File Member (RgzPfm) command. These parameters are ALWCANCEL (Allow Cancel) and LOCK (lock level). To use these new reorganize options, you must journal the table while the reorganize operation is running. Journaling is not required before or after the reorganize operation. • The LOCK option is used to control the type of concurrent operations that can be performed on the table during a reorganize. • The ALWCANCEL option allows a reorganize operation to be suspended. This option is helpful if the reorganize is performed during a nightly batch window, but the table is so large that the reorganize cannot complete in one batch window. The graphical Reorganize Table Manager interface can be used to check the progress and current status of an active reorganize operation. Then, this interface provides the ability to suspend the reorganize operation until the next batch window when it can be restarted. Page 35 of 55
  • 39. DB2 UDB for iSeries: V5R3 Overview Online and parallel reorganize comparison ALWCANCEL(*NO) ALWCANCEL(*YES) KEYFILE KEYFILE KEYFILE KEYFILE KEYFILE (*NONE) (*FILE or keyfile) (*RPLDLTRCD) (*NONE) (*FILE or keyfile) Cancel and restart No No Yes Yes Yes Concurrent Access No No Yes Yes Yes Parallel processing Only index rebuilds Only index rebuilds Data movement and Data movement and Data movement and index rebuilds index rebuilds index rebuilds Non-parallel performance Very fast Fast Very fast Slower Slowest Temporary storage Double data storage Double data storage Journal receiver Journal receiver Journal receiver storage storage storage LIFO KEYFILE index N/A Duplicates reversed N/A N/A Duplicate ordering processing preserved Index processing Synchronous or Synchronous or Maintain indexes or Maintain indexes or Maintain indexes or (non-KEYFILE) asynchronous asynchronous synchronous or synchronous or synchronous or rebuilds rebuilds asynchronous asynchronous asynchronous rebuilds rebuilds rebuilds Final row position exact Yes Yes Only if LOCK(*EXCL) Only if LOCK(*EXCL) Only if LOCK(*EXCL) and not restarted and not restarted and not restarted Amount of CPU and I/O Smallest Next smallest Smallest More Most used Variable length segment Good Good Worse Worse Worse reorganize Allows referential integrity Yes Yes No No No parents and FILE LINK CONTROL DataLinks Allows QTEMP and Yes Yes No No No Database Cross Ref Files HABP replication cost Minimal - one journal Minimal - one journal More - journal entires Most - journal entires Most - journal entires entry entry for all rows moved for all rows moved for all rows moved Online and parallel reorganize comparison The type of reorganize option you decide to use will depend on several factors. For example, is your goal simply to recover space, or is the sequence of the rows critical? Is it important that the reorganize can be canceled (suspended)? Is it necessary to allow concurrent access to the file? Use this table of factors to determine which option is most appropriate. The blue shaded entries highlight the new reorganize capabilities introduced in V5R3. The new reorganize options are not available if: • The table contains DATALINK columns • The table is a parent in a referential constraint • The table is in QTEMP • The database cross-references files Page 36 of 55
  • 40. DB2 UDB for iSeries: V5R3 Overview Agenda Application development enhancements DB2 and SQL enhancements Performance improvements High availability and other enhancements Tools and utilities Tools and utilities In the last section of this course, you will learn about the many enhancements to iSeries Navigator related to DB2 UDB tasks. You will also read about IBM Rational® XDE modeler, DB2 Migration Toolkit, DB2 XML Extenders, and other pertinent enhancements. Page 37 of 55
  • 41. DB2 UDB for iSeries: V5R3 Overview iSeries Navigator enhancements Index evaluator DB2 object type folders Show related (graphical DSPDBR) Constraint management interface (graphical WRKPFCST) Reorganize table manager SQE aware Visual Explain Run SQL enhancements – Font chooser – Integrated support for graphical debugger – Sortable explainable statements – Run and explain support for stored procedure calls New Show command Improved multi-tasking support iSeries Navigator enhancements iSeries Navigator includes several other exciting enhancements in V5R3 in addition to the Reorganize Table Manager. One enhancement, demonstrated here, is the new object type folder. In prior releases, it was sometimes difficult and slow to find a particular DB2 UDB object in a library (or schema) folder that contained a large number of objects. V5R3 addresses this issue by adding object type folders underneath the schema folder. DB2 UDB objects are now categorized by type, which makes finding an object of a particular type much easier. For instance, you can search for a table by viewing a list of tables. Previously, you had to scan a list that also included views and indexes. The object type folders also improve the performance of iSeries Navigator because it no longer retrieves a list of all library objects each time a schema folder is open. And, when a specific object type folder, such as Views, is opened, a much smaller list of items is downloaded from the server. iSeries Navigator also now has an enhanced Visual Explain tool to show a truer picture of SQE query implementations and a font chooser for the SQL Script Center. Page 38 of 55
  • 42. DB2 UDB for iSeries: V5R3 Overview iSeries Navigator: Index evaluator Required PTFs: V5R3 — iSeries Access V5R3 Fixpak #2 and V5R3 server PTFs: SI2938 and SI12873 V5R2 — iSeries Access V5R3 Fixpak #3 and V5R2 server PTF SI16313 iSeries Navigator: Index evaluator When tuning a query, a common task is to review a list of indexes over a table that is available to the query optimizer. Previously, iSeries Navigator provided this ability, but some significant attributes about the indexes were not included and the listing omitted keyed logical files. The new Index Evaluator task, accessed by right-clicking a table object, shows a list of all indexes (including keyed logical files) as well as index attributes not previously available to analysts. These attributes include the logical page size, a count of query uses, a timestamp representing the last time the index was used in a query implementation, and a timestamp representing the last time the optimizer used statistics in the index. This new information makes it easy to determine which indexes are used most often and those that provide little value. This V5R3 Index Evaluator client can be used with both OS/400 V5R2 and i5/OS V5R3 environments as long as the required PTFs (refer to the screen) are applied on the iSeries system. These new index statistics are not maintained until the PTFs are applied. This means that you should take the time to run all of your queries and reports before reviewing the statistics and choosing indexes to delete. Page 39 of 55
  • 43. DB2 UDB for iSeries: V5R3 Overview iSeries Navigator: Show related iSeries Navigator: Show related Before changing a DB2 UDB table by adding or removing a column, it is often helpful to look at the objects related to that table in order to determine the impact of a change. Database Navigator is one function that can be used to do that. This tool demonstrates those relationships by drawing a graphical picture with arrows pointing to all of the dependent objects. However, administrators do not always need fancy pictures, nor do they want to wait for a picture to be drawn. They want a simple listing of the items. That is exactly the role filled by the new Show Related task in V5R3 that provides a simple listing of the related objects, as demonstrated on this screen. This task is accessed by right-clicking a DB2 UDB table. Page 40 of 55
  • 44. DB2 UDB for iSeries: V5R3 Overview iSeries Navigator: Graphical procedure debugger iSeries Navigator: Graphical procedure debugger In addition to the new font customization support, the SQL Script Center has added support to integrate the graphical iSeries Navigator System Debugger. This graphical debugger is installed with the IBM Toolkit for Java in V5R3. This example shows the new Debugger option on the Run pull-down menu. Not only will this new Debugger option start the graphical debugger, it also takes care of the complex task of determining the server job where the stored procedure will be running. It then automatically fills that job information into the debug interface for the user. The debugger can be used to debug both SQL and external stored procedures. (Find more details on using the graphical debugger with stored procedures in the “Additional information” section of this course.) Page 41 of 55
  • 45. DB2 UDB for iSeries: V5R3 Overview iSeries Navigator: Constraint management iSeries Navigator: Constraint management The new Constraint Management interface provides a graphical equivalent for the Work with Check Pending Constraints (WRKPFCST) CL command. This interface makes it easy to determine which rows are violating the database constraint definition and causing the check pending state. This management interface also allows the administrator to edit and correct those rows. Page 42 of 55
  • 46. DB2 UDB for iSeries: V5R3 Overview Rational XDE Modeler Rational XDE modeler The latest version of the IBM Rational Rose XDE developer tools contains new support for DB2 UDB for iSeries databases. The XDE Data Modeler tool gives you the ability to reverse-engineer existing DB2 UDB for iSeries databases to produce a logical model. In addition, as the logical model changes and new models are developed, the Data Modeler tool lets you generate and execute an SQL script to create the equivalent physical database on the iSeries system. The XDE modeling interfaces support tables, views, indexes, triggers, aliases, and stored procedures. The table support includes support for the DB2 UDB FOR COLUMN OF clause that makes it easy to create short column names. These short column names are needed when the SQL table is used by native iSeries programming interfaces. For additional information on IBM Rational, visit the IBM Rational Customer Support online center for software support and a quick reference guide (see the “Additional information” section of this course for a hotlink). Page 43 of 55
  • 47. DB2 UDB for iSeries: V5R3 Overview DB2 MTK enhancements Migration Toolkit enhancements Support for V5R3 enhancements, sequence objects big improvement for Oracle migrations Reengineering of existing SQL Server and Sybase migration tool into the "Oracle" MTK architecture and interface Informix database support Free DB2 MTK download at: ibm.com/servers/enable/site/db2/porting.html DB2 Migration Toolkit enhancements The DB2 Migration Toolkit for Oracle® has been enhanced in V5R3 to take advantage of the latest DB2 UDB for iSeries features, such as sequence objects and generate specific DB2 UDB for iSeries SQL syntax when converting Sybase® and Microsoft SQL Server databases. The IBM DB2 UDB family has also added support for the conversion of Informix databases to the toolkit. Page 44 of 55
  • 48. DB2 UDB for iSeries: V5R3 Overview SWG Utilities for DB2 UDB for iSeries DB2 UDB Extenders for iSeries – Support for XML Schemas and NOT FENCED UDFs – Leverages XML Toolkit for iSeries XML parser – Decomposition of XML now supports non-unique XML elements and attributes – UDFs now support language encoding parameter DB2 QMF for Distributed Edition V8.1 – Follow-on to QMF for Windows with new browser client that is based on WebSphere – Recent general availability (GA) • ibm.com/common/ssi/fcgi-bin/ssialias?subtype=ca&infotype=an&appname= iSource&supplier=897&letternum=ENUS204-028 – Download evaluation version at: ibm.com/qmf DB2 Development Center – Support for Java and external stored procedures WebSphere Information Integrator (formerly DB2 Information Integrator) IBM software utilities for DB2 UDB for iSeries The DB2 UDB Extenders for iSeries product has been enhanced in V5R3 with new support for the DB2 XML Extenders. The XML Extender support now features integrated support for XML Schema validation. The decomposition stored procedures now support the mapping of non-unique XML elements to different DB2 UDB columns. This gives the developer more flexibility in working with different XML document types. This change is also available in the latest V5R2 PTFs. The XML Extender user-defined functions make translation between character sets easier by allowing a language encoding parameter to be specified on function calls. The latest version of DB2 QMF supports DB2 UDB for iSeries with DB2 UDB servers on z/OS®, Linux™, UNIX™, or Windows. It provides new features for the existing Query Management Facility (QMF) product, and introduces a new browser client. This new offering runs on IBM WebSphere Application Server. Users can access existing QMF queries and reports as well as create new ones through a prompting interface. DB2 QMF also has conversion utilities to convert existing green-screen Query/400 and Query Manager reports into QMF format. DB2 Development Center’s support for DB2 UDB will expand by supporting the creation and deployment of Java and external stored procedures. (More details on using DB2 Development Center with DB2 UDB for iSeries can be found at the hotlink listed in the “Additional information” section of this course.) The latest version of DB2 Information Integrator continues to offer iSeries applications easy access to a wide variety of enterprise data sources, including non-DB2 databases such as Oracle and SQL Server. Page 45 of 55
  • 49. DB2 UDB for iSeries: V5R3 Overview Quiz 1) The DB2 object type folders are empty by default and then have to be categorized and populated manually be the user. True False – Once the contents of a schema (or library) are accessed by the user, DB2 will automatically categorize the objects by type and place them in the appropriate folder. 2) The Reorganize Table Manager can only display the current status of a reorganize operation if that graphical interface is connected to the server during the entire reorganize operation. True False – Information on the current status of a reorganize operation is kept on the server. Thus, the reorganize manager does not have to be active during the operation. The reorganize manager can be disconnected multiple times. 3) The Graphical debugger can be used for stored procedure debug from the iSeries Navigator “SQL Script” window without purchasing any additional software. True – The only software that needs to be installed on the client is the iSeries Access for Windows and iSeries Navigator – both of which are no charge features of i5/OS and OS/400. False Page 46 of 55
  • 50. DB2 UDB for iSeries: V5R3 Overview New table types for DB2 UDB Materialized query tables (MQTs) – Creation of MQTs is only supported with V5R3 GA. – PTFs released in April 2005 enable query optimizer awareness of MQTs. • MQTs must be maintained and refreshed by user. • PTFs available at: – ibm.com/iseries/db2/mqt.html • Read white paper – Title: The creation and use of materialized query tables within IBM DB2 UDB for iSeries – ibm.com/servers/enable/site/education/abstracts/438a_abs.html Partitioned tables – Use ONLY when single table limit of 1.7 TB or 4.2 billion rows will be exceeded. – Do not use partition tables to improve performance. • Limited optmizer awareness of partitions, especially CQE query optimizer. • Support for fast delete of rows in a partition is supported – If you will use partitioned tables in V5R3: • Read white paper – Title: Table Partitioning Strategies for DB2 UDB for iSeries – ibm.com/servers/enable/site/education/abstracts/2c52_abs.html • Contact DB2 UDB solutions enablement team (rchudb@us.ibm.com) New table types for DB2 UDB DB2 UDB for iSeries V5R3 contains support for two new table types. These enhancements are materialized query tables (MQTs) and partitioned tables. MQTs are used to store the results of a query and can automatically be used by the optimizer to improve the performance of that same query by other users. The PTFs released in April 2005 are required to enable this optimizer to use MQTs. (Details on these PTFs can be found at the Web site listed on this chart.) If the optimizer finds an MQT matching part, or the entire query, it will simply return the contents of the MQT instead of spending the resources to run the same query again. Optimizer awareness and usage of MQTs will be improved for a future release. The referenced white paper, The creation and use of materialized tables within DB2 UDB for iSeries, must be read to fully understand the capabilities of MQTs. Partitioned tables have a similar story. You can create a partitioned table, but the query optimizer has limited support for leveraging the performance advantages that partitioned tables can offer. For this reason, partitioned tables should only be used in V5R3 if you have a table that approaches the single-size table limit of 4.2 billion rows or 1.7 terabytes of storage. Again, improved partitioned table support will be coming in the future. In some ways, the partitioned table support can be considered a technology preview. Please read the white paper, Table Partitioning Strategies for DB2 UDB for iSeries, to understand the capabilities and limitations of the V5R3 support. It should be noted that partitioned tables can only be used if the DB2 Multisystem product has been purchased and installed. (Links to the Web sites listed on this chart are provided as hotlinks in the “Additional information” section of this course.) Page 47 of 55
  • 51. DB2 UDB for iSeries: V5R3 Overview Education roadmap DB2 UDB for iSeries Fundamentals (S6145) ibm.com/iseries/db2/gettingstarted.html ibm.com/services/learning Accessing DB2 UDB for iSeries w/SQL (S6137) DB2 UDB for iSeries SQL and Query Performance Developing iSeries applications w/SQL Workshop (RCSC) (S6138) ibm.com/servers/eserver/iseries/service/ igs/db2performance.html DB2 UDB for iSeries SQL Advanced Piloting DB2 UDB with iSeries Navigator Programming (S6139) Performance Tuning DB2 UDB with iSeries Navigator and Visual Explain Integrating XML and DB2 UDB for iSeries Self-study iSeries Navigator tutorials ibm.com/servers/enable/site/education/ibo/view.html?oc#db2 All links are provided in the "Additional information" section. Education roadmap Self-study iSeries Navigator tutorials for DB2 UDB for iSeries and Query performance workshops are available at the Web sites shown on this screen. (You can get to these Web sites quickly by using the hotlinks listed in the “Additional information” section of this course.) Page 48 of 55
  • 52. DB2 UDB for iSeries: V5R3 Overview The End Summary Through the years, DB2 UDB for iSeries has improved significantly with each new release of OS/400, constantly sustaining its status as a strong member of the database family that is recognized as an industry standard. This year, the improvements are so radical in the iSeries operating system that they have even inspired its renaming (to i5/OS). This V5R3 release brings new application flexibility and portability with enhanced SQL support and improved DB2 family compatibility. DB2 UDB for iSeries is also a native .NET provider. Server consolidation is made easier with this release because of improved and new database migration tools. Availability and reliability have improved through such features as parallel reorganize, ragged saves, and journal enhancements. It is possible for developers to tweak performance better than ever because of Star join enhancements, constraint awareness, and statistics generation. SQL deletes are faster, as are stored procedure calls. Finally, DB2 UDB for iSeries gets a lift in usability with this release, too. This is because of enhancements to iSeries Navigator such as the Index Evaluator and an enhanced RPG SQL precompiler. There are some valuable additional resources listed in the “Additional information” section of this course. We encourage you to look at these. Page 49 of 55
  • 53. DB2 UDB for iSeries: V5R3 Overview Final Quiz 1) The enhancements made to the RPG SQL Precompiler fix all the restrictions that existed prior to V5R3. True False – IBM has several restrictions such as support for Free Format RPG that need to be added to the precompiler in a future release. 2) Which of the cursor sensitivity settings provides the best performance: a) Asensitive – In general, this setting provides the best performance since it gives DB2 UDB the freedom to choose the most efficient implementation regardless of the sensitivity setting. b) Sensitive c) Insensitive 3) The iSeries .NET provider supports stored procedures and connection pooling True False 4) The IBM Cryptographic coprocessor card must be installed in order to use the DB2 encryption and description scalar functions. True False – The cryptographic hardware cards are not required, the DB2 functions do not use any of the services provided by these cards. 5) Storing encrypted column values in an existing column requires the length of that column to be: a) Shorter b) Longer – The encrypted column value will be longer than the original column value. c) Unchanged 5) The values returned from a sequence object are sometimes out of sequence. True – By default, DB2 UDB allocates a cache of the next 20 sequence values the first time a sequence object is referenced within a job or connection. When multiple jobs are sharing a sequence object the sequence values are not given out in sequence. False 6) Which of the following clauses on the DECLARE CURSOR statement can be used to return a result set back further than just the invoker of the stored procedure: d) RETURN TO CALLER RETURN TO CLIENT e) RETURN TO INVOKER Page 50 of 55
  • 54. DB2 UDB for iSeries: V5R3 Overview 7) Check and RI Constraints can cause the SQE query optimizer to rewrite an SQL request from an application or end user. True – The SQE query optimizer in V5R3 examines constraint definitions to see if they can be used to improve the efficiencies of queries False 8) In V5R3, all SQL statements are processed by the SQL Query Engine True False – SQE does not yet support all types of SQL requests. For instance, LOB columns and LIKE predicates prevent SQE from being used. 9) Which of the following QAQQINI options can be used to reduce the amount of data collected by the Database Performance Monitor: a) SQL_Stmt_Compress_Max b) Database_Monitor_Threshold — c) Cache_Results 10) The DB2 object type folders are empty by default and then have to be categorized and populated manually be the user. True False – Once the contents of a schema (or library) are accessed by the user, DB2 will automatically categorize the objects by type and place them in the appropriate folder. 11) The Reorganize Table Manager can only display the current status of a reorganize operation if that graphical interface is connected to the server during the entire reorganize operation. True False – Information on the current status of a reorganize operation is kept on the server. Thus, the reorganize manager does not have to be active during the operation. The reorganize manager can be disconnected multiple times. 12) The Graphical debugger can be used for Stored Procedure debug from the iSeries Navigator “SQL Script” window without purchasing any additional software. True – The only software that needs to be installed on the client is the iSeries Access for Windows and iSeries Navigator – both of which are no charge features of i5/OS and OS/400. False Page 51 of 55
  • 55. DB2 UDB for iSeries: V5R3 Overview Additional information These hotlinks provide useful Web sites and reference materials to supplement the information in this course. • DB2 UDB for iSeries Web site ibm.com/eserver/iseries/db2 • DB2 Universal Database for iSeries articles and white papers ibm.com/iseries/db2/awp.html • IBM white paper: Column Encryption in IBM DB2 UDB for iSeries ibm.com/servers/enable/site/education/ibo/view.html?oc#db2 • DB2 Universal Database Cursor Sensitivity and Query Optimization information ibm.com/iseries/db2/sqe.html • DB2 UDB Instead Of triggers ibm.com/iseries/db2/iot.html • Indexing and statistics strategies for DB2 UDB for iSeries education offering ibm.com/server/enable/site/education/ibo/record.html?indxng • DB2 Migration Toolkit download ibm.com/servers/enable/site/db2/porting.html • DB2 Query Management Facility Distributed Edition for Multiplatforms V8.1 ibm.com/common/ssi/fcgi-bin/ssialias?subtype=ca&infotype=an& appname=iSource&supplier=897&letternum=ENUS204-028 • DB2 Query Management Facility Web site with available evaluation version ibm.com/qmf • Available MQT support PTFs for DB2 UDB for iSeries V5R3 ibm.com/iseries/db2/mqt.html • DB2 UDB for iSeries Quick-Start ibm.com/iseries/db2/gettingstarted.html • DB2 Information Management training ibm.com/services/learning • Rochester Customer Solution Center (RCSC) ibm.com/servers/eserver/iseries/service/igs/db2performance.html Newsgroups • USENET: comp.sys.ibm.as400.misc, comp.databases.ibm-db2 • iSeries Network SQL and DB2 forum at: www.iseriesnetwork.com/Forums/main.cfm?CFApp=59 Education Resources - Classroom and online • DB2 UDB for iSeries Quick Start ibm.com/eserver/iseries/db2/gettingstarted.html • DB2 UDB Education ibm.com/eserver/iseries/db2/db2educ_m.html • iSeries Developer Roadmap ibm.com/eserver/iseries/roadmap/ • DB2 UDB for iSeries online education offerings ibm.com/servers/enable/site/education/ibo/view.html?oc#db2 • DB2 performance workshops ibm.com/eserver/iseries/service/igs/db2performance.html Page 52 of 55
  • 56. DB2 UDB for iSeries: V5R3 Overview White papers • DB2 UDB for iSeries and Web Services ibm.com/servers/enable/site/education/abstracts/db2web_abs.html • The creation and use of materialized query tables within IBM DB2 UDB for iSeries ibm.com/servers/enable/site/education/abstracts/438a_abs.html • Table Partitioning Strategies for DB2 UDB for iSeries ibm.com/servers/enable/site/education/abstracts/2c52_abs.html • DB2 XML Extender, WORF, and WebSphere Application Developer (Importing and exporting XML data into DB2 with Web services) ibm.com/developerworks/db2/library/techarticle/dm-0409cline/index.html • Graphical Debugger makes Procedural SQL Debug Even Easier ibm.com/servers/enable/site/education/abstracts/sqldebug_abs.html • General DB2 UDB white papers: ibm.com/eserver/iseries/db2/awp.html • Using DB2 Development Center with DB2 UDB for iSeries: ibm.com/servers/enable/site/education/abstracts/db2dev_abs.html Self-study tutorials • Piloting DB2 UDB for iSeries using iSeries Navigator in V5R3 ibm.com/servers/enable/site/education/abstracts/2dc2_abs.html • Master SQL Performance Visual Explain • Integrating XML and DB2 UDB for iSeries ibm.com/servers/enable/site/education/abstracts/intxml_abs.html DB2 UDB for iSeries publications • Online manuals: ibm.com/eserver/iseries/db2/books.htm • Porting help: ibm.com/servers/enable/site/db2/porting.html • DB2 UDB for iSeries Redbooks: ibm.com/redbooks - Stored Procedures, Triggers and User Defined Functions on DB2 Universal Database for iSeries (SG24-6503) - Preparing for and tuning the V5R2 SQL Query Engine on DB2 Universal Database for iSeries (SG24-6598) - Modernizing IBM eServer iSeries Application Data Access – A Roadmap Cornerstone (SG24-6393) - Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET (SG24-6440) • SQL/400 Developer's Guide by Paul Conte and Mike Cravitz (ISBN 0-07-212568-3) DB2 family certifications • IBM Certified Database Associate - DB2 V8.1 Family (Test 700) ibm.com/certify/certs/dbdaudv81.shtml - Education resources: ibm.com/certify/tests/edu700.shtml - DB2 Version 8 Family Fundamentals Preparation online tutorials: www7b.boulder.ibm.com/dmdd/library/tutorials/db2cert/db2cert_V8_tut.html Page 53 of 55
  • 57. DB2 UDB for iSeries: V5R3 Overview • IBM Certified Application Developer - DB2 V8.1 Family (Test 703) ibm.com/certify/certs/dbapudv81.shtml - Education resources: ibm.com/certify/tests/edu703.shtml - Sample tests: Refreshed and updated exams for DB2 UDB for iSeries certify.torolab.ibm.com/ice Page 54 of 55
  • 58. DB2 UDB for iSeries: V5R3 Overview DB2 UDB miscellaneous resources • Details on cursor sensitivity in article, entitled “DB2 UDB for iSeries cursor sensitivity enhancements” at: ibm.com/developerworks/db2/library/techarticle/dm-0403milligan/ • Details on DB2 UDB column encryption can be found in the June 2005 issue of IBM eServer iSeries Magazine at: www.eservercomputing.com/ME2/Default.asp • Details on using the graphical debugger with stored procedures can be found in the white paper: Graphical Debugger makes Procedural SQL Debug Even Easier at: ibm.com/servers/enable/site/education/abstracts/sqldebug_abs.html • For additional information on IBM Rational, visit the IBM Rational support online center for software support and a quick reference guide at: ibm.com/software/rational/support/quick-ref-guide.html • Free DB2 Migration Toolkit download at: ibm.com/servers/enable/site/db2/porting.html • Article in MC Press online: Cut Your Development Effort with DB2 Development Add-in for .NET, by Jarek Misczyk www.mcpressonline.com/mc/.6b21a8f0 Page 55 of 55
  • 59. DB2 UDB for iSeries: V5R3 Overview Trademarks and Disclaimers © IBM Corporation 1994-2005. All rights reserved. References in this document to IBM products or services do not imply that IBM intends to make them available in every country. The following terms are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both: IBM, the IBM logo, OS/400, i5/OS, DB2, DB2 Universal Database, eServer, iSeries, POWER5, DB2 Connect, On Demand Business, z/OS, Informix, WebSphere, Redbook, and ibm.com. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Other company, product or service names may be trademarks or service marks of others. Information is provided "AS IS" without warranty of any kind. Information concerning non-IBM products was obtained from a supplier of these products, published announcement material, or other publicly available sources and does not constitute an endorsement of such products by IBM. Sources for non-IBM list prices and performance numbers are taken from publicly available information, including vendor announcements and vendor worldwide homepages. IBM has not tested these products and cannot confirm the accuracy of performance, capability, or any other claims related to non-IBM products. Questions on the capability of non-IBM products should be addressed to the supplier of those products. All statements regarding IBM future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only. Contact your local IBM office or IBM authorized reseller for the full text of the specific Statement of Direction. Some information addresses anticipated future capabilities. Such information is not intended as a definitive statement of a commitment to specific levels of performance, function or delivery schedules with respect to any future products. Such commitments are only made in IBM product announcements. The information is presented here to communicate IBM's current investment and development activities as a good faith effort to help with our customers' future planning. Page 56 of 55

×