oracle vs. db2 shootout

Transcription

oracle vs. db2 shootout
DOAG 2015
ORACLE VS. DB2 SHOOTOUT
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
1
INTRODUCTION
 Why do we compare ?
 Who are we ?
Today in the blue corner:
 Robert Barić





Oracle KnowHow since 9i/10g
DB2 KnowHow since 9.1
Development Know How
6 years with ITGAIN
Specialized in
Performance Tuning and
Backup/Recovery
Anytime in the red corner:
 Gerret Bachmann





Oracle KnowHow since 8i
Had learned COBOL long ago
PL/SQL and ABAP/4 Know How
4 years with ITGAIN
Specialized in
Performance Tuning
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
2
A RICH SET OF SIMILAR FEATURES
Cluster Database
Column Organized Tables
Compression
Programming language
RDBMS
Online Backup
Online Reorg
Partioning
ACID
„Remote“ DB access
XML / JSON
CBO / statistics
Trigger
Parallel Processing
Standby Database
.. And many more
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
3
SHARED HISTORY
8i (CBO, Java VM, Unicode, LOBs)
Research study by
Edgar F. Codd
by order of IBM:
DB-Prototype System R
9i (Flashback, SPFile)
10g (ASM, ADDM)
11g (Adv. Comp.)
V2 (1st Version)
12c
V4 (Read Consistency)
1970
1975
1980
1985
1990
First Installation
1995
2000
2005
2010
2015
V10 (Opt. Parallel.)
DB2 for MVS
Announcement DB2 für OS/2
OS/2 Database
DB2 for Windows
V9.7 (Cursor Stability)
V8 (Partitioning)
V7 (Unicode, SQL/PL)
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
4
DB2: DATA PARTITIONING FEATURE (DPF )
SELECT dept, SUM(sal)
FROM emp
GROUP BY dept
Coordinator
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
5
DPF: TABLESPACE AND TABLE CREATION
 CREATE DATABASE PARTITION GROUP D1PG
ON DBPARTITIONNUMS (1, 2, 3, 4, 5, 6, 7);
 CREATE LARGE TABLESPACE DPF_TBSP1
IN DATABASE PARTITION GROUP D1PG
PAGESIZE 16384
MANAGED BY DATABASE;
 CREATE TABLE EMPLOYEE (
EMP_ID
VARCHAR(50)
EMP_FIRST_NAME
VARCHAR(50)
EMP_LAST_NAME
VARCHAR(50)
ROW_INSERT_TMSTMP
TIMESTAMP)
DISTRIBUTE BY HASH (EMP_ID)
IN DPF_TBSP1
INDEX IN DPF_TBSP1_IX;
NOT NULL,
NOT NULL,
SMALLINT,
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
6
DATAGUARD VS HADR (STANDBY)
Oracle
DB2
 On Standby Consistent Reads
 Backup on Standby
 Max. 30 Standby databases
Clients
 On Standby only Dirty Reads
 No Backup on Standby
 Max. 3 Standby databases
Primary Site
StandbySite
Clients
Data Changes
Primary
Database
Standby
Database
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
7
DB2: ISOLATION LEVEL „UNCOMMITTED READ“
T1
SELECT NAME
FROM CUST
WHERE ID = 1337;
UPDATE CUST
SET NAME = 'Tom'
WHERE ID = 1337;
Thinks about
COMMIT or
ROLLBACK…
SELECT
FROM
WHERE
WITH
T2
NAME
CUST
ID = 1337
UR;
CUST
CUST
CUST
ID
= 1337
NAME = 'Thomas'
ID
= 1337
NAME = 'Tom'
ID
= 1337
NAME = 'Tom'
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
8
RAC VS. PURESCALE: ARCHITECTURE
Members with integrated CF
Member
Primary CF
CF
CF
CF
CF
Secondary CF
Cluster-Caching facilities (CF)
Global Locking + Page Cache
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
9
ORACLE LOCKING
 ITL-slots on block level per session
 Number of slots grows with table
UPDATE … WHERE ROW=1;
Session 1
UPDATE … WHERE ROW=2;
Session 2
UPDATE … WHERE ROW=3;
UPDATE … WHERE ROW=4;
UPDATE … WHERE ROW=5;
ALTER TABLE…
INITRANS=10
Header
Session 3
Session 4
ITL waits
ITL Slot 1
ITL Slot 2
ITL Slot 3
ITL Slot 4
Row 5
Row 4
Row 3
Row 2
Row 1
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
11
DB2 NIGHTMARE: „LOCK ESCALATION“
Lock Manager
Table
1 SHOOTOUT
2
3
UPDATE … WHERE ROW=1;
UPDATE … WHERE ROW=2;
UPDATE … WHERE ROW=3;
UPDATE … WHERE ROW=4;
UPDATE … WHERE ROW=8;
Lock Manager
4
8
Table SHOOTOUT
5
1
9
6
2
10
7
11
3
8
4
12
UPDATE … WHERE ROW=9;
DML Wait
UPDATE … WHERE ROW=12;
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
12
TABLE COMPRESSION
Uncompressed
DB2
Oracle
Robert
Bachmann
1
Bachmann
1
chmann
Robert
Baric
1
Baric
1
ric
Nick
King
2
2
Nick
King
2
2
Norbert
Barman
Norbert
Barman
Nor
3
man
Dilbert
Barfriend
Dilbert
Barfriend
Dil
3
friend
1
Robert
2
Nick King
1
2
Robert Ba
Nick King
3
Bert Bar
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
13
TABLE / BLOCK DICTIONARY
Block 1
Norbert
Table Dictionary
1
Norbert
Block 2
Block 3
Norbert
Norbert
Page2
Page3
Page 1
1
1
Oracle
DB2
1
Titel des Foliensatzes
Copyright © 2015 ITGAIN GmbH
14
INDEX COMPRESSION DB2
 Variable Slot Directory
 Prefix Compression (from beginning byte-values)
 RID (RowID) Compression
Page (Block)
Page (Block)
Var. Slot Dir
~1=Tom, T Symbols
Fixed Slot Dir
Index Keys RID
Tom, Tall
102030
Compress
Index Keys RID
~1all
102030
2
102032
Tom, Thin
102035
~1hin
102035
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
15
RIDDLE: WHAT HAPPENS?
 CREATE TABLE RIDDLE(
ID
INTEGER,
TEXT CHAR (20));
 INSERT INTO RIDDLE VALUES (1, 'Now what?');
 ROLLBACK;
 SELECT * FROM RIDDLE;
ORACLE:
DB2:
 0 rows found
 Table not found
 DDL can be rolled back!
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
16
DB2: REORG PENDING STATE

Change last month
 ALTER TABLE RIDDLE
ALTER COLUMN TEXT SET DATA TYPE VARCHAR(30); COMMIT;

Change last week
 ALTER TABLE RIDDLE
ALTER COLUMN TEXT SET DATA TYPE VARCHAR(40); COMMIT;

Change today
 ALTER TABLE RIDDLE
ALTER COLUMN TEXT SET DATA TYPE VARCHAR(50); COMMIT;
„3 STRIKES“:
 Table switches to „reorg pending state“
 Cannot be used until reorg is done
 Can take a while…
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
17
ORACLE COMPATIBILITY MODE
Oracle SQL syntax supported
PL/SQL support with oracle data type
Similiar behivour adjustable
$> DB2SET DB2_COMPATIBILITY_VECTOR = ORA
$> DB2SET DB2_DEFERRED_PREPARE_SEMANTICS = YES
$> db2stop; db2start
$> db2 "create database testdb PAGESIZE 32 K"
$> db2 connect to testdb;
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
18
ORACLE COMPATIBILITY MODE („98% COMPATIBLE“)
Oracle
DB2
 SQL> INSERT INTO
<table> AS
SELECT LEVEL FROM DUAL
CONNECT BY LEVEL <
10000;
 10.000 rows inserted
 $> db2 INSERT INTO
<TABLE> AS
SELECT LEVEL FROM DUAL
CONNECT BY LEVEL <
10000;
 ERROR: (Max recursion 64)
 SYS.DBMS_ Packages: 554
 SYS.UTL_ Packages: 21
 V$ Views: 768




SYS.DBMS_ Packages: 8
SYS.UTL_ Packages: 4
V$ Views: ?
No Oracle Tools (DP, sqlldr)
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
19
GENERATION OF CSV-FILES
Oracle
DB2
 SQL*Plus
 $> db2 "select *
from cust where … " |
grep … > records.txt






SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SET PAGESIZE 0
SET LINESIZE 1000
SET COLSEP ','
SPOOL export.csv
SELECT * FROM …
SPOOL OFF
 SQL Developer
 SELECT /*csv*/ *
FROM <table>;
 SET SQLFORMAT csv
 Run as script
 $> db2 EXPORT TO
export.csv of DEL
SELECT * FROM CUST
1, "Tom", "Barfrau"
2, "Tim", "Bersarker"
3, "Norbert", "Barmann"
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
20
PEFORMANCE: STUDY OF JCSCR
 Independant stdy
 Tested several RDBMS on identical ardware:
 Intel Xeon E5649, 6x2 Cores 2.53GHz, 32GB RAM
 MS Windows Server 2008, 64-bit.
 Simulates ERP ( 1 Mio. records per table)
 10 SQL (SELECT, Joins, UPDATE, DELETE)
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
21
PEFORMANCE: STUDY OF JCSCR
 Runtime of 10 SQL-statements of different complexity:
25
140
140
120
120
100
100
15
80
10
20
5
500
1000
400
800
80
300
600
60
60
200
400
40
40
20
20
100
200
0
0
Oracle
DB2
0
Oracle
3000
700
2500
600
0
DB2
Oracle
DB2
10000
120
8000
100
500
2000
1500
1000
400
6000
300
4000
0
Oracle
DB2
DB2
100
50
20
0
Oracle
0
Oracle
DB2
DB2
150
40
2000
Oracle
200
60
100
0
DB2
80
200
500
0
Oracle
0
Oracle
DB2
Oracle
DB2
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
22
PERFORMANCE: CONCLUSION
According to this study:
 For long running queries DB2 is faster
 For short running queries Oracle is faster
3000
120
2500
100
2000
80
1500
60
Smaller is
better
1000
500
40
20
0
0
Oracle
DB2
Worst case for Oracle
Oracle
DB2
Best case for Oracle
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
23
SUPPORTED OS
DB2
Oracle
 DB2 LUW





 Linux
 Unix (HP/UX Itanium, AIX)
 Windows
 DB2 for z/OS
 DB2 for i
Windows
Linux
HP/UX Itanium
AIX
Solaris
 Version 7 Release 1 (aka
DB2/400)
 DB2 Server for VSE & VM
 Version 7.4
 (Different code base)
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
24
LICENSE MODELS
DB2
Oracle
 Processor Value Unit (PVU)
 Authorized User Single Install
License (AUSI or AU)
 Processor
 Named User Plus (NUP)
 Terabyte Pricing (TB)
 Pay per whole TB
 Limited Use Socket (LUS)
 Licensing by sockets
 Fixed Term Licence (FTL)
 License for one year
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
25
EDITIONS
DB2
Oracle






 Express (11g)
DB2 Express-C
DB2 Express Server Edition
DB2 Developer Edition
DB2 Workgroup Server Edition
DB2 Enterprise Server Edition
DB2 Advanced Workgroup Server
Edition
 DB2 Advanced Enterprise Server
Edition
 Personal Edition
 Standard Edition (SE)
 Standard Edition 2 (SE2)
 Enterprise Edition (EE)
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
26
DB2: LIMITS & LICENSES
Memory
CPU
(Cores)
Data
Express-C
(Free)
Express
Server
Workgroup
Server
Enterprise
Server
Advanced
Workgroup
Advanced
Enterprise
16 GB
64 GB
128 GB
Unlimited
128 GB
Unlimited
Throttled
for 2 cores
Throttled
for 8 cores
4 sockets,
16 cores
Unlimited
16 Cores
Unlimited
15 TB
15 TB
15 TB
Unlimited
15 TB
Unlimited
N/A
Min. 5 AU
200 PVUs
Min. 5 AU
25 AU per
100 PVU
25 AU per
100 PVU
None
FTL, LUV,
PVU, AU
LUS, PVU, AU
PVU, AU
PVU, AU, TB
PVU, AU, TB
-
-
-
●
●
License
Limits
License
Options
„All in“
-
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
27
DB2 „OPTIONS AND PACKS“
High Value Capability
Express
Edition
Workgroup
Server
Edition
Included
Separate BVO
Enterprise
Server
Edition
Advanced
Workgroup
Edition
Advanced
Enterprise
Edition
Comments
Performance Management





Native Encryption





BLU Acceleration feature




DB2 pureScale feature




Database Partitioning (MPP)


Table and Index Compression


Optim Tools,
Data Server Manager


Rest of Optim tools
Optim tools available
separately

Federation Server is
available separately
Heterogeneous Data
Virtualization
Advanced Recovery Feature





Optim Workload Replay





OPM, WLM, OQWT,
Data Server Manager
pureScale member
limitations in WSE
and ESE
Titel des Foliensatzes
Copyright © 2015 ITGAIN GmbH
28
COMPARISON OF CONFIGURATIONS: SINGLE INSTANCE, SE2
DB2 Workgroup Edition
Oracle SE2
 1 AU = 428,20 $
 1 NUP = 350 $ + 77 $ = 427 $
 5 Users Minimum
 10 Users Minimum
 1 CPU = 21.410 $
 1 CPU = 21.350 $
 Max. 4 sockets /16 cores
 128 GB RAM
 Max. 2 sockets
 50 Users ~ 1 CPU
 50 Users ~ 1 CPU
 2 CPU / 100 User
 2 CPU / 100 User
 42.820 $
 42.700 $
2 CPU / 100 User
128 GB RAM
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
29
COMPARISON OF CONFIGURATIONS: 4-NODE CLUSTER (4*4 CPUS)
DB2 Enterprise Advanced
Oracle EE + Partitioning + AC
 DB Enterprise Advanced
 Enterprise Edition
 4*4*68.400$= 1.094.400$
 PureScale
 Real Application Clusters
 included
0$
 Partitioning
0$
 Adaptive Compression
 Total:
 4*4*
5.060$=
80.960$
 Partitioning
 included
 included
 4*4* 57.950$= 927.200$
 4*4* 14.030$= 224.480$
 Advanced Compression
0$
1.094.400 $
 4*4* 14.030$= 224.480$
 Total:
1.376.160 $
 + 2 CF Server
4 * 4 CPU / 256 GB RAM
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
30
ROUNDUP
Oracle
DB2
 No DB2 mode necessary 
 Complicated license model
 Oracle compatibility-mode
 More flexible and more
complicated license model
 Supports dirty reads
 Lock escalation possible
 DDL Rollback
 3 Strikes Table DDL
 Standby: Dirty Reads only
 More Advanced compression for
Tables and Indexes
 Massively Parallel Processing
(MPP)
 …






Always consistent
No Lock escalation
DDL auto commit
No Strikes for Table DDL
Standby: Backup, Consistent Read
Column Compression bound to
Exadata-Storage
 No Shared Nothing MPP solution
 …
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
31
Q&A
Oracle vs. DB2 Shootout
Copyright © 2015 ITGAIN GmbH
32

Similar documents

tda dota

tda dota R= CU}R \}Lt w |a}@] `@=vt |=yVRQ= w C}ty= 'xaUwD p=LQO |=yQwWm R= C=_Lqt x@ xHwD uwO@ =yxSwQB u}= R= |Q=}U@ w CU= xOw@ u=yvB u=Q}os}tYD x=oO}O |D=t=Ok= u}vJ |=yOt=}B w pY=L "Ov=xOW |Q=OQ@xQy@ w |L...

More information

- The Bombay Art Society

- The Bombay Art Society capacities with social responsibility as the President of The Bombay Art Society, former President of The Art Society of India, Vice Chairman of the Artists' Center; Trustee of The Jehangir Art Gal...

More information