25
Advantages of migrating to IBM DB2® v11.1 Rajesh Pandhare. Tieto India Pvt. Limited.

Advantages of migrating to db2 v11.1

Embed Size (px)

Citation preview

Advantages of migrating to IBM DB2® v11.1

Rajesh Pandhare.

Tieto India Pvt. Limited.

Agenda

• PART I – IBM DB2 v 11.1 Upgrade Essentials.

• PART II – IBM DB2 v 11.1 Enhancements and Advantages.

Below snapshot is taken from The DB2Night Show™ #189

End of Service and Marketing DB2 9.7 and DB2 10.1 announced

• DB2 10.5 end of marketing, on September 30th, 2016• End of marketing means that customers will not be able to purchase DB2 10.5 after the end of September

2016.

• Customers are still able to get copies of DB2 10.5 if required.

• Customers continue to get service and support for DB2 10.5 since end of service is not being announced now.

• DB2 9.7 and DB2 10.1 end of service, on September 30th, 2017• For those customers running either DB2 9.7 or DB2 10.1, they will need to begin planning on upgrading to

either DB2 10.5 or DB2 11.1.

• Extended support contracts available (up to September 30, 2020)

• BLU Acceleration Business Value Offerings (BVO)

• Encryption Offering and Business Application Continuity Offering

IBM DB2 11.1 Upgrade Options

• Upgrade directly from 9.7 instead of having to go through another version, such as 10.1 or 10.5.

DB2 v 9.7

DB2 v 10.1

DB2 v 10.5DB2 v 11.1

IBM DB2 11.1 Upgrade Options

• If you are upgrading from IBM DB2 10.5 Fix Pack 7 (Single Partition DB2 or

DB2 pureScale) or later then,

• Upgrade is now recoverable operation

• Recovery procedure involving roll-forward through database upgrade now exists.

• No longer mandatory to take offline backup image during upgrade procedure

• HADR can now be upgraded without need to re-initialize standby database after perform upgrade on primary database.

• Eliminate cost of sending backup image to standby site for re-initialization.

• Re-initialization of standby is still an option if the user wishes, but not recommended option.

• Both primary and standby databases should be at minimum DB2 10.5 Fix Pack 7 level.

Product packaging for IBM DB2 11.1

• DB2 Express-C • Free, entry-level edition of DB2 data server for developer and partner community.

• Includes self-management features and embodies all of core capabilities.

• Can be used for development and deployment at no charge and can be distributed with third-party solutions without any royalties to IBM.

• Refreshed at major release milestones. Comes with online community-based assistance.

• No DB2 add-on offerings can be added.

• No DB2 Express Server Edition in DB2 11.1

• DB2 Developer Edition • Includes all DB2 server editions, DB2 Connect Enterprise Edition, allowing you to build solutions that use

latest data server technologies. • Cannot be used for production systems. Must acquire separate user license for each Authorized User of

this product. • DB2 Performance Management Offering included

Product packaging for IBM DB2 11.1

• DB2 Workgroup Server Edition • Places limits on processor and memory.

• Includes Data Server Manager Base, which requires separate installation.

• DB2 Performance Management Offering can be added by activating license.

• DB2 Enterprise Server Edition • No processor, memory, or database size limits.

• Includes all functions found in DB2 WSE plus materialized query tables.

• includes Data Server Manager Base which requires separate installation

• DB2 Performance Management Offering can be added by activating license.

Product packaging for IBM DB2 11.1

• DB2 Advanced Enterprise Server Edition • No processor, memory, or database size limits.

• Includes all functions found in DB2 Enterprise Server Edition plus column organized tables, in-memory database, data compression, workload management, replication, and distributed partitioning capability.

• Includes full complement of warehouse tools and Data Server Manager Enterprise. Included tools must be installed separately.

• Functionality provided by DB2 Performance Management Offering.

• DB2 Advanced Workgroup Server Edition • Similar to DB2 Advanced ESE, except places limits on processor and memory.

Basics of IBM DB2 v11.1 Upgrade

• Refer IBM DB2 11.1 Knowledge center for details of installation and upgrade process.

• Test upgrade process on non-production server first.• Set up DB2 11.1 test server and create test databases. • Determine what issues are and how to resolve, Use this information to adjust upgrade plan.

• Learn how to upgrade each component of your DB2 environment and create your upgrade plan.• Environment has several components such as DB2 servers, DB2 clients, database applications, scripts,

routines and tools. • Determine the order in which you are going to upgrade each component.

• Create and follow below checklists,• Upgrade prerequisites• Pre-upgrade tasks• Upgrade tasks• Post-upgrade tasks

DB2 INSTALLATION METHODS

• Linux • ./db2setup -I /temp/db2setup.Iog -t /tmp/db2setup.trc • ./db2setup -r responsefile directory/response file

• Windows • setup -l c:\temp\db2setup.log -t c:\tmp\db2setup.trc • setup -u c:\responsefile_directory\response_file

• DB2 Setup Wizard• Must have X window software on Linux capable of rendering GUI.• To update existing DB2 copy and update all instances running on this DB2 copy, select Work

with Existing in Install a Product panel. Then select DB2 copy want to update with update action.• To install new DB2 copy and selectively update instances running on existing DB2 copy to newcopy after installation, select Install New in Install a Product panel.

• db2 install is deprecated and might be removed in future release

Advantages to DB2 Express-C users

• How can I change or limit the amount of memory used by a DB2 data server?• You can use the instance_memory database manager configuration parameter to specifythe maximum amount of memory that the database manager is allowed to allocate from itsprivate and shared memory heaps.

• There is memory usage limit for DB2 Express-C Edition• DB2 Express-C v9.7 (no charge, non-warranted)

• Up to two processor cores• No more than 4 GB of memory divided between your instances

• DB2 Express-C v11.1 (no charge, non-warranted)• RAM: 16GB, CPU: 1 sockets, 2 cores, Database size: 15 TB!

• To Compare :• Oracle 11g Express, RAM: 1GB, CPU: 1 sockets, 1 core (1 CPU in specs), Database size: max 11 GB

(Refer: http://www.oracle.com/technetwork/articles/sql/11g-xe-quicktour-498681.html)

• Microsoft SQL Server 2012 Express, RAM: 1 GB, CPU: 1 socket, 4 cores, Database size: max 10 GB(Refer: https://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx)

Performance Improvement for high concurrent workload

• Run a number of performance tests before upgrading your DB2 server.• The db2batch benchmark tool helps you to collect elapsed and CPU times for running queries. You can use this tool to develop performance tests.

• Also, keep a record of the db2exfmt command output for each test query. Compare the results before and after upgrade. This practice can help to identify and correct any performance degradationthat might occur.

• For our test environments we used below db2batch command to collect before and after

performance test results,• db2batch —d DBNAME —f PerfTestLoad.sql —r AfterUpOut.fil —i complete —o e yes —isol CS

• Before Environment – DB2 v 9.7 FP5• After Environment – DB2 v 11.1

• Overall timing improvement, we got is around is 48% just by upgrading to DB2 v 11.1• Workload we tested is typical OLTP Payment processing highly concurrent queries.

Database Manager CFG Parameter Changes

• MON_HEAP_SZ• Range of MON_HEAP_SZ extended on 64-bit instances from 0-2,147,483,647.

• INSTANCE_ MEMORY• Can now specify INSTANCE_MEMORY limit by calculating percentage of available

RAM divided by number of local partitions, or specify memory limit as number of 4KB pages.

• AUTOMATIC (Default) Computed value ranges between 75 percent and 95 percent of system memory.

• 1 - 100: Specifies instance memory limit by calculating percentage of available RAM divided by number of local partitions. In-memory value is updated at member startup time to reflect calculated number of 4KB pages. Used to set DB2's percentage consumption of total RAM on machine in DB2 instances with heterogeneous machine hardware configurations.

• 101 - system memory capacity. Specifies memory limit as number of 4KB pages. Also represents tuning target if STMM is enabled.

Database CFG Parameter Changes

• APPLHEAPSZ • Range of APPLHEAPSZ extended on 64-bit instances from 16 - 2,147,483,647. It also changed fromUint16 type to Uint64 type.

• CATALOGCACHE_SZ• Range of CATALOGCACHE_SZ extended on 64-bit instances from 8 - 2,147,483,647.

• DBHEAP• Range of DBHEAP extended on both 32-bit and 64-bit instances from 32 - 2,147,483,647.

• STAT_HEAP_SZ• Range of STAT_HEAP_SZ extended on 64-bit instances from 1 ,096 - 2,147,483,647.

• STMTHEAP• Range of STMTHEAP extended on 64 bit instances from 128 - 2,147,483,647.

Administration Improvements

• DB2 11.1 includes a number of administrative enhancements that

DBAs will find useful. Four of them that are highlighted here include:

• Range Partition Table Reorganization

• A single partition of a range partitioned table can now be reorganized with the

INPLACE option if:

• Table has no global index (i.e. non-partitioned indexes)

• ON DATA PARTITION is specified

• The reorganization can only occur on one data partition at a time, and the table must

be at least three pages in size.

• ADMIN_MOVE_TABLE improvements

• Two new options in the ADMIN_MOVE_TABLE command:

• REPORT

• TERM

Administration Improvements

• DB2 History File Backup• The DB2 history file contains information about log file archive location, log file chain, etc.

• If you use snapshot backups you want to have current information about log file location to

perform point in time recovery (RECOVER command). RECOVER needs a current version of the

history file to be available.

• db2 "BACKUP DB <alias> NO TABLESPACE to /histbkup"

• db2 "RESTORE DB <alias> FROM /histbkup HISTORY FILE"

• Remote Storage• DB2 11.1 delivers more flexibility and options for acquiring, sharing and storing data files and

backup images, by allows customers to use remote storage for several DB2 utilities:

• INGEST, LOAD, BACKUP, and RESTORE

• DB2 supports remote storage using storage aliases for:

• IBM® SoftLayer® Object Storage

• Amazon Simple Storage Service (S3)

• LOAD FROM <remotefilename>

CREATE TABLE Extensions

• CREATE TABLE can now use SELECT clause to generate table definition and populate

table with data • CREATE TABLE TABTEMP AS (SELECT FROM TABLE1) WITH DATA ;• CREATE TABLE AS_EMP AS (SELECT EMPNO, SALARY+BONUS FROM EMPLOYEE)

DEFINITION ONLY;• SQL0153N The statement does not include a required column list. SQLSTATE=42908

• CREATE TABLE AS_EMP AS (SELECT EMPNO, SALARY+BONUS AS PAY FROM EMPLOYEE) DEFINITION ONLY;

• Allow you to override column names or select specific columns• CREATE TABLE TABTEMP (ZIP) AS

(SELECT ZIP_CODE FROM TABLE1) DEFINITION ONLY;

• Can populate data directly into new table but beware of logging! • CREATE TABLE TABTEMP (ZIP, STATE) AS

( SELECT ZIP CODE, STATE CODE FROM TABLE1 WHERE DIVISION =19

) WITH DATA ;

SQL Extensions

• OFFSET Extension in FETCH FIRST Clause• SELECT LASTNAME FROM EMPLOYEE OFFSET 5 ROWS FETCH FIRST 5 ROWS ONLY;

• CREATE TABLE AS_EMP (DEPARTMENT, LASTNAME) AS

(SELECT WORKDEPT, LASTNAME FROM EMPLOYEE

OFFSET 5 ROWS FETCH FIRST 10 ROWS ONLY ) WITH DATA;

• You can also limit the number of rows that are used in a subselect.

• The FETCH FIRST n ROWS ONLY and OFFSET clause can also be specified using a simpler LIMIT/OFFSET syntax.

• LIMIT x OFFSET y = OFFSET y ROWS FETCH FIRST x ROWS ONLY

• SELECT LASTNAME FROM EMPLOYEE LIMIT 5 OFFSET 5;

Regular Expressions

• DB2 11.1 introduced support for regular expressions.

• Regular expressions allow you to do very complex pattern matching in character strings.• REGEXP_FUNCTION(source, pattern, flags, start_pos, codeunits)

• SELECT STATION FROM CENTRAL_LINE WHERE REGEXP_LIKE(STATION,‘Chennai');

• Symbol ‘^’ can be used to force the match to occur at the beginning of a string

• Symbol ‘$’ can be used to force the match to occur at the end of a string

• match more than one pattern

• SELECT STATION FROM CENTRAL_LINE WHERE REGEXP_LIKE(STATION,'way|ing');

• Result = (Ealing Broadway, Notting Hill Gate, Queensway, Barkingside)

• Match pattern zero or more times,

• SELECT STATION FROM CENTRAL_LINE WHERE REGEXP_LIKE(STATION,'(ing)*.(way)');

• Result = (Ealing Broadway, Queensway)

• The following example checks for station names that begin with the letter P-R

• SELECT STATION FROM CENTRAL_LINE WHERE REGEXP_LIKE(STATION,'^[P-R]');

• Result = (Ruislip Gardens, Perivale, Redbridge)

BLU Sort Processing Enhancements

• DB2 11.1 includes sort innovations, PARADIS, from the IBM TJ Watson Research division.

• PARADIS is an efficient parallel algorithm for in-place Radix sort.• parallel sort

• able to sort compressed and encoded data

• More efficient and improved performance as processing is performed within the BLU engine.

• The access plans will show what part of the processing is done in the row engine vs the BLU engine.

• All parts below the "CTQ” evaluator are done in the BLU engine.

• More details on PARADIS can be found in the IBM Research Paper:

• http://www.vldb.org/pvldb/vol8/p1518-cho.pdf

Compatibility Features with Other Database Vendors

• Outer Join Operator• In DB2 11.1, the outer join operator is available by default and does not require the DBA to turn on Oracle

compatibility.

• Oracle keyword: "(+)“appears in the WHERE clause and refers to a column of the inner table in a left outer join.

• SELECT DEPTNAME, LASTNAME FROM DEPARTMENT D, EMPLOYEE E

WHERE D.DEPTNO = E.WORKDEPT (+);

In DB2 11.1 limit of CHAR has been increased to 255 from 254.

DB2 11.1 introduces two new binary data types: BINARY and VARBINARY.

• INT2, INT4, INT8, FLOAT4, FLOAT8 these datatypes can be used while table creation, but If you describe the contents of a table, you will see the DB2 types displayed, not these synonym types.

DSMTOP

• DSMTOP is replacement of DB2TOP

• dsmtop -d sample -n localhost -r 50000 -u payusr• Very lightweight, low overhead, text only.

• Monitoring accomplished by using mon_get table functions not old snapshots so lightweight

• Can monitor DB2 10.1 and above, even if u not on 11.1 u cam download it and use.

• Now includes metrics for

• BLU

• PURESCALE

• Workload management

• REORG is covered now

• Win Platform is supported

• Also additional easy menus for fresh DBA’s

• Provides Sessions, Running SQL, Top Consumers, Time spent. All these are very useful for debugging perf bottlenecks.

DB2 11.1 eBook and Resources

• URL for all DB2 Resources including the eBook

– https://ibm.ent.box.com/v/DB2v11eBook

• IBM® DB2® 11.1 for Linux, UNIX and Windows Knowledge Center

• The DB2Night Show™ #177: Part 1: What's New in DB2 LUW V11

• The DB2Night Show™ #178: Part 2: DB2 LUW V11.1 Deep Dive on BLU and Analytics

• The DB2Night Show™ #179: Part 3: DB2 LUW V11.1 Deep Dive on OLTP and pureScale

• The DB2Night Show™ #182: DB2 LUW V11.1 Upgrade Best Practices and Tips!

Advantages of migrating to IBM DB2® v11.1

Rajesh Pandhare.

Tieto India Pvt. Limited.