Escolar Documentos
Profissional Documentos
Cultura Documentos
Distributed Database
SQL/MP provides local autonomy within and across the network nodes and at the application programming level. As such, programs operate as if all the data were local. Therefore, programmers do not need to specify the location of the data. This also allows database administrators to add extra partitions at the remote systems without changing any applications. SQL/MP has a subsystem NonStop Transaction Manager/ Massively Parallel (TM/MP) to ensure the transaction integrity across the system boundaries by a two-phase commit protocol, which commits the changes to the database when the system components complete their portion of the transaction (see Figure 1, next page).
Ensuring complete business coverage with well-understood and implemented overlapping functionality. Deploying more current technologies, such as HP NonStop Cobol or IBM z/OS Cobol, upon which most business-critical applications rely. Adding modern databases such as HP NonStop SQL/MP or IBM z/OS DB2, which are critical to surviving in the big data era.
Modernizing databases offers many advantages, including cost reduction, stability and efciency,
Table 1
Table 1
Table 1
Figure 1
DB2 also supports distributed database schemas through its Distributed Relational Database Architecture (DRDA) offering. SQL objects can be spread across interconnected systems, with each system having a DB2 manager to communicate and cooperate in such a way that the application programs can access data across various systems. In simple terms, any DB2 server other than the local system is called as the remote DB2 server and the operation is considered distributed. Each DB2 manager uses the location name to determine the local or remote system; a maximum of eight location names can be dened for a DB2 system. DB2 also acts as a transaction manager to enable the databases two-way commit process and guarantees that the units of work are consistently committed or rolled back (see Figure 2).
Parallel Processing
SQL/MP achieves parallel processing through:
Parallel
query processing: This is achieved by spreading the database across multiple partitions. SQL/MP uses multiple I/O processes for each partition during query execution. join operations: This is achieved by the SQL executor during query processing to increase performance. by different disk processes so that multiple indexes will not have any impact on the performance.
Parallel
Parallel
index loading: This is achieved by different process loading of all partitions of the index at the same time.
Application/User System A
DB2 Manager A
System B
DB2 Manager B
System N
DB2 Manager N
Table 1
Table 1
Table 1
Figure 2
Parallel
sorting: This is achieved by the FastSort product that SQL/MP uses for sort operations and this has multiple sub-sort processes for parallel sort operations.
allowing or managing multiple I/O for a single query to improve I/O performance. It will be used as a last option to increase the performance if other methods are not signicant for a particular query execution. large query into multiple small queries and each query will be executed simultaneously on multiple processors accessing data in parallel. It is further enabled in the latest versions and called Sysplex query parallelism where the large query is split across different DB2 components in a data sharing group.
PARTONLY operations) and index loads (using the CREATE INDEX or LOAD command with PARALLEL EXECUTION ON) to reduce the time required to load the object. tion, which eliminates the need to terminate program execution when changes in database structure or the environment make rebinding necessary. to defer name resolution in SQL statements until execution time.
Ability
On the other hand, DB2 can achieve high availability but unplanned outages are difcult to avoid entirely. It doesnt have specic built-in mechanisms but a well-conceived and tested backup, recovery and restart strategy can make a signicant difference.
Static and dynamic queries. Local or remote data access. Query using single table scans and multi-table
joins.
Some restart processing can occur concurrently with new work. Also, the organization can make a choice to postpone some processing.
During
a restart, DB2 applies data changes from the log. This technique ensures that data changes are not lost, even if some data was not saved at the time of the failure. Some of the processes of applying log changes can run in parallel. to the Automatic Restart Manager of z/OS. This facility automatically restarts DB2 if it goes down as a result of a failure. one DB2 subsystem in a group is stopped.
Online
Table Showing Key Concepts to Achieve High Availability in NonStop SQL/MP and IBM DB2
NonStop SQL/MP
Online dumps Online database reorganization Parallel table/index loading
Figure 3
IBM DB2
Concurrent restart Backup data logs Automatic restart manager
a data breach, data must have value and thus is no longer just information but an asset. In general, there are three main mechanisms that allow a DBA to implement a database security plan:
Recovery
Both SQL/MP and DB2 offer data recovery features. Both databases offer:
Authentication: Authorization:
This is the rst security feature youll encounter when you attempt to access a database. This involves determining the operations that users and/or groups can perform, and the data objects that they can access. These are a bit more granular than authorization and can be assigned to users and/or groups. Privileges help dene the objects that a user can create or drop.
Privileges:
These three mechanisms are available in both SQL/MP and DB2. Authorization to operate on SQL tables, views, indexes, collations and SQL programs that run in the Guardian environment are maintained by the Guardian security subsystem. Whereas in DB2, whether a process can gain access to a specic DB2 subsystem can be controlled outside of DB2. The procedure to grant access is performed through RACF or a similar security system.
Node Super ID
SQL Objects Group Manager 1 Guardian Users SQL Objects
SQL Objects
Guardian Environment
Node Super ID
SQL Objects Group Manager 1 Guardian Users SQL Objects SQL Objects Group Manager 1 Guardian Users
Node Super ID
SQL Objects Group Manager 1 Guardian Users SQL Objects
SQL Objects
Node Super ID
Group Manager 1 Guardian Users SQL Objects
SQL Objects
Figure 4
Character Set
SQL/MP supports the following character sets:
ISO 8859/1 through ISO 8859/9: >> Single byte character set. >> Standard set of nine single-byte
sets dened by ISO. acters.
character
conditions, locking is required to maintain data integrity by avoiding two processes contending for the same data at the same time. In other words, application processes require a feature that allows control over the granularity of locking. A generic lock can be held by a process on a subset of the rows in a table and lock granularity is the size of a lockable unit. Generic locking provides:
>> All nine ISO 8859 sets contain ASCII char>> ISO 8859/1 is HPs default character set and
others are used in various geographical regions. object collation.
Improved
performance, because the application acquires fewer locks while performing operations. single lock without acquiring a table lock.
>> Collating sequence can be dened using SQL Kanji: >> Double-byte character set. >> Widely used for DOS and
frames. on the binary values.
Japanese main-
Both SQL/MP and DB2 offers these features but with conceptual differences. The following are key access options available at a high level in SQL/MP to achieve locking:
>> Collation not possible and sequence depends KSC5601 (Korean industrial standard character
set):
>> Double-byte character set. >> Mandated for Korean government and banking sector systems.
the data without any lock and it could be inconsistent data. This provides minimum consistency and maximum concurrency. access: Application process can lock the data but releases locks on unmodied rows without waiting for the end of the unit of work. lock the data but release locks only at the end of the unit of work, irrespective of whether the data was modied or not.
Stable
Extended
>> Single-byte or double-byte character set. >> Double-byte character set is used for storing
complex characters such as Chinese, Japanese, etc.
DB2 offers this feature with a different mechanism and terminology. Called isolation levels, they include:
Uncommitted
>> Collating sequence can be dened. UTF-8 universal character set: >> Native language characters can be saved to
database.
read: This is equivalent to browse access in SQL/MP and allows the application process to read data at the risk of being inconsistent/uncommitted. stability: This is equivalent to stable access in SQL/MP and allows the application to lock only on its uncommitted changes and on the current row of each of its cursors. access (shared) in SQL/MP and it allows the application process to read rows more than once and prevents access to the qualied rows by other processes but allows row changes that do not qualify.
Cursor
Table Showing Locking Mechanisms Supported by NonStop SQL/MP and IBM DB2
NonStop SQL/MP
Key Access Options Browse access Stable access Repeatable access-shared Repeatable access-exclusive
Figure 5
IBM DB2
Isolation Levels Uncommitted read Cursor stability Read stability Repeatable access
able read (exclusive) in SQL/MP and allows the application process to read rows more than once and prevents access to the other processes even to rows that do not qualify.
Unique index: >> The column or group of columns dened as >> In SQL/MP a unique index cant be created
on a column that allows NULL values.
unique index cant be the same for two or more rows in a base table.
Partitioned index: >> These indexes can be physically partitioned. >> In SQL/MP, the indexes refer to the base tables always rather than the table partitions.
Clustering index: >> The index dened as a clustering index determines the physical ordering of the table.
during run time. This can be manipulated in SQL/MP at a program level by using CONTROL statements but in DB2 this can be achieved by specifying the table denitions at the creation time.
ing and, if not specied, then DB2 considers the rst index on the table as the clustering index.
Index
Critical applications where performance matters require a key database feature called indexing. An index is a column or group of columns dened on a base table that can be used for speedy data retrieval in a situation where data is looked up in a sequence other than a non-primary sequence. Both SQL/MP and DB2 support indexes to achieve better performances in critical applications and store the index in a separate physical le. In general the different types of indexes available are specied below.
can be used for efcient evaluation of Xpath expressions to improve performance during queries on XML documents.
In general:
Both
databases support the compression of indexes to reduce the amount of space that an index occupies. cation program by using control statements and bypass the SQL optimizers choice of index. Whereas in DB2 the choice of index that needs to be chosen is always decided by the SQL optimizer. of
DB2 supports the padding/non-padding variable length indexes but not SQL/MP.
Null values will be displayed for the missing values of a particular column in a table. In general:
NonStop SQL/MP
IBM DB2
SQL/MP
>> Nested join. >> Sort merge join. >> Key-sequenced merge join. >> Hash join. Whereas DB2 achieve joins by: >> Nested loop join. >> Merge scan join. >> Hybrid join. Using CONTROL statements, SQL/MP
The access path that will be chosen by the optimizer can be easily viewed in SQL/MP by referring to EXPLAIN output but in DB2 one has to refer to the group of tables (e.g., explain plan table) under CATALOG through utilities.
allows the application program to specify the type of algorithm used for join operation and also to specify the sequence of joins within SELECT statements. allows the merging of data from both columns into a single column, eliminating the null values, by using the COALESCE function.
Joins
When an application requires data for processing from multiple tables, then the widely used database concept is JOINS. A join allows an application programmer to join columns from multiple tables into an intermediary result table. Both SQL/MP and DB2 supports the joins but the way the SQL optimizer achieves this conceptually is totally different. In general, the different types of joins are specied below.
DB2
Database Utilities
SQL/MP has a command interface utility called SQLCI (SQLCI2) SQL Conversational Interface to manage the application database. Through this interface, an application programmer can:
Enter queries or generate formatted reports. Run database utility programs for database
Table Showing Join Types Available in NonStop SQL/MP and IBM DB2
Join Types
Inner Join Left Outer Join Right Outer Join Full Outer Join
Figure 7
the condition specied in the WHERE clause. The output intermediary result table contains all the rows from the multiple tables that satisfy the condition. the rows of inner joins plus missing rows depending on the type of join described below. cluding all the rows in the left table even if there are no matching records in the other tables. SQL/MP and DB2 support left outer joins.
Outer joins: This joins multiple tables, including >> Left outer join: This joins multiple tables in-
NonStop SQL/MP
IBM DB2
including all the rows in the right table even if there is no matching record in the other tables. cluding all the rows in tables that are joined.
Table 1
Table 2
Table 1
Table 2
Table 1
Table 2
Table 1
Table 2
Figure 8
Enter
special commands that manage concurrent access to the database and maintain the latest statistics about the database. constraints (rules that are applicable to data values that are being added to the database). physical database design extensions such as distributed databases, tables audited by Transaction Management Facility (TMF) and non-audited tables.
Create Create
Fundamentally, it supports:
is the set of SQL statements and directives that control parallel processing, name resolution and performance-related considerations such as access paths, join methods and locks and cursors. statements: DDL is the set of SQL statements to create or alter database objects. For example, creating a table or altering a table or dropping a table, etc. statements: This is used to select, update, insert and delete rows in one or more tables. statements: This retrieves status information about the version of the database. Intrinsic functions are supported by SQL/MP to manipulate the table data. For example, AVG returns the average of a set of numbers, COUNT counts the distinct values in a column, etc. cognizant 20-20 insights
System
DEFINEs: A System DEFINE is a DEFINE used in Tandem software to identify system defaults or conguration information.
DDL
There is a wide range of products available to manage DB2 applications. Mainframe business users choose these products based on their application or GUI requirements. For example:
DML DSL
DB2I
Functions:
(Database 2 Interactive) or SPUFI (SQL Processing Using File Input): DB2I is a TSO-based DB2 application for the OS/390 environment and a default product provided by IBM for database management. This doesnt support a GUI and allows all SQL statements through a command interface. Sharing Option (TSO) command processor that runs in the TSO foreground or under TSO in a JES-initiated batch. It uses the TSO attachment
facility to access DB2. The DSN command processor provides an alternative method for running programs that access DB2 in a TSO environment.
>> The
File Manager data copy facility to include DB2 data as both source and target.
Among all products, the BMC tool is used primarily for DB2 access. It is user-friendly and available with multiple tools for each database function.
Conclusion
Our comparison of SQL/MP and DB2 informs the following conclusions:
DB2/PE: DB2 Performance Expert (PE) for Multiplatform V2.2 is a workstation-based performance analysis and tuning tool for managing a heterogeneous mix of DB2 systems with a single end-user interface. DB2 PE simplies DB2 performance management by providing the ability to monitor applications, system statistics and system parameters using a single tool. OPTIM: IBMs InfoSphere Optim z/OS solution
provides a unique and powerful capacity to browse, edit, move, compare and archive relationally intact sets of DB2 data and MOVE legacy data. File Manager (FM) is a powerful set of utility functions for editing, browsing, printing, copying and maintaining data in les on any supported device. It provides powerful functions in one product for use by application programmers and system programmers. IBM File Manager/DB2 (FM/DB2) extends this functionality to the DB2 environment by extending:
Both
can achieve the key database concepts such as high availability, high scalability, high performance and high security in different ways. support key database features such as security, data integrity, distributed database, concurrency, locking, recovery, etc. cations in domains such as banking, telecom, stock exchanges, etc.
Both suit the needs of business-critical appliBut when it comes to database modernization (be it moving from a legacy system to a new system, or migrating from one legacy system to another), it is critical to understand or study the business requirements of business-critical applications specic to the key database features assessed in this white paper. Last but not least, organizations should also consider other key parameters such as:
FM/DB2:
>> The ISPF object list utility to apply to DB2 >> The File Manager data create facility to DB2
References
About Cognizant
Cognizant (NASDAQ: CTSH) is a leading provider of information technology, consulting, and business process outsourcing services, dedicated to helping the worlds leading companies build stronger businesses. Headquartered in Teaneck, New Jersey (U.S.), Cognizant combines a passion for client satisfaction, technology innovation, deep industry and business process expertise, and a global, collaborative workforce that embodies the future of work. With over 50 delivery centers worldwide and approximately 164,300 employees as of June 30, 2013, Cognizant is a member of the NASDAQ-100, the S&P 500, the Forbes Global 2000, and the Fortune 500 and is ranked among the top performing and fastest growing companies in the world. Visit us online at www.cognizant.com or follow us on Twitter: Cognizant.
World Headquarters
500 Frank W. Burr Blvd. Teaneck, NJ 07666 USA Phone: +1 201 801 0233 Fax: +1 201 801 0243 Toll Free: +1 888 937 3277 Email: inquiry@cognizant.com
European Headquarters
1 Kingdom Street Paddington Central London W2 6BD Phone: +44 (0) 20 7297 7600 Fax: +44 (0) 20 7121 0102 Email: infouk@cognizant.com
Copyright 2013, Cognizant. All rights reserved. No part of this document may be reproduced, stored in a retrieval system, transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise, without the express written permission from Cognizant. The information contained herein is subject to change without notice. All other trademarks mentioned herein are the property of their respective owners.