Oracle 12c In-memory Database Cache.pdf
-
Upload
sid66792001 -
Category
Documents
-
view
37 -
download
0
Transcript of Oracle 12c In-memory Database Cache.pdf
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
1/44
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
2/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Transform Batch to Real Timewith the Oracle Database
In-Memory 12c Option onOracle Systems
Vince Carbone
Hui DongDavid LutzOracle Performance EngineeringOctober 1, 2014
Oracle ConfidentialInteCopyright 2014, Oracle and/or its affiliates. All rights reserved. |
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
3/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor StatementThe following is intended to outline our general product direction. It is inteinformation purposes only, and may not be incorporated into any contract.commitment to deliver any material, code, or functionality, and should notin making purchasing decisions. The development, release, and timing of afunctionality described for Oracles products remains at the sole discretion
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
4/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
1
2
3
4
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
5/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
1
2
3
4
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
6/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Memory Bandwidth Enables Batch to Real-Time
DISK
PCI FLASH
DRAM
12 GB/sec
~1280 GB/sec
58 GB/sec
In-memory deliver
Over 100x more th
Over 14x more thr
What was batch careal time
Oracle SuperCluster T5-8(Full Rack)
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
7/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Breakthrough: Dual Format Database
BOTHrow and coformats for same
Simultaneously atransactionally co
Analytics & repor
in-memory Colum
OLTP uses proven
Memory Memory
SALES SALES
RowFormat
ColumnFormat
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
8/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
SPARC Systems For Maximum In-Memory PerformLarge Memory/High Memory Bandwidth
IM performs complete womemory
Scale-up on
Scale-out on
T4-1 512GBT5-2 1TB
T5-4 2TB
T5-8 4TB
M6-32 32TB
SuperCluster T5-8 and M6-32
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
9/44Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
System Global Area SGA
Buffer CacheShared Pool Redo Buffer
Large Pool Other shared
Memory Components
In-Memory Area
Configuring : In-Memory Column Store
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
10/44Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Configuring : In-Memory Column Store
Controlled by INMparameter
Minimum size of 100
Must be large enougaccommodate both cmeta-data area
SGA_TARGET musenough to accomm
Implemented usinShared Memory (OS
SELECT * FROM V$SGA;
NAME VALUE------------------ ---------Fixed Size 2927176Variable Size 570426808Database Buffers 4634022912Redo Buffers 13848576
In-Memory Area 1024483648
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
11/44Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Configuring : In-Memory Column StoreOracle Multitenant with Pluggable Databases
ERP IMPDB1 IMPDB2
Container Database
INMEMORY_SIZE=0G
INMEMORY_SIZE=400G
INMEMORY_SIZE=1600G
INMEMORY_S
Example:
SQL> alter session set contaSQL> alter system set inmeSQL> alter session set contaSQL> alter system set inme
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
12/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
ERP IMPDB1 IMPDB2
Container Database
INMEMORY_SIZE=0G
INMEMORY_SIZE=1000GINMEMORY_SIZE=1600G
INM
Over subis po
Configuring : In-Memory Column StoreOracle Multitenant with Pluggable Databases
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
13/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Configuring : In-Memory Column Store
NewINMEMORY AT
Following segmeneligible
Tables
Partitions
Subpartition
Materialized views
Following segmen
eligible
IOTs
Hash clusters
Out of line LOBs
CREATE TABLE customers
PARTITION BY LIST(PARTITION p1 INMEMORY,(PARTITION p2 NO INMEMORY);
ALTER TABLE sales INMEMORY;
ALTER TABLE salesNO INMEMORY;
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
14/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle Compression Advisor And In-Memory
Easy way to deter
memory requirem
Use DBMS_COMPR
Applies MEMCOMP
sample set of data
Returns estimatedcompression ratio
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
15/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
1
4
2
3
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
16/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle In-Memory Columnar Technology
Pure in-memory
Not persistent, a
Quick to change
2x to 20x compr
Enabled at table
level
Brings existingdmemory and foroptimized colum
SALES
Pure In-Memory Columnar
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
17/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Population is highly scalable
Completed by new sbackground processe
ora_wNNN_orcl
Number of processe
INMEMORY_MAX_POColumn Format
MemoryIMCU IMCU
IMCU IMCU
IMCU IMCU
Populating: In-Memory Column Store
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
18/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Each object popu
Column Store is aup of multiple In-Compression Unit
Each IMCU contaientries for a subsethe object
Each column is encompressed indiv
Populating: In-Memory Column Store
Column Format
MemoryIMCU IMCU
IMCU IMCU
IMCU IMCU
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
19/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Populating: In-Memory Column Store
New INMEMORY
Possible to populacertain columns fr
or partition
Order (not speed)
objects are popula
controlled by PRIO
subclause
Critical, high, me
Defaultnone (
first access)
ALTER TABLE sales INMEMORY;
ALTER TABLE salesNO INMEMORY;
ALTER TABLE sales INMEMORYNO INMEMORY (PROD_ID);
CREATE TABLE orders(c1 number,c2 varchar(20),c3 number)
INMEMORY PRIORITY CRITICALNO INMEMORY (c1);
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
20/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Populating: In-Memory Column Store
Objects compress
population Different levels
FOR DML - Use o
partitions with v
activity
FOR QUERY - Demost tables
FOR CAPACITY -
frequently acces
Great for ILM stra
CREATE TABLE ORDERS
PARTITION BY RANGE (PARTITION p1 INMEMORY NOMEMCOMPRESSPARTITION p2
INMEMORYMEMCOMPRESS FOR DML,PARTITION p3
INMEMORYMEMCOMPRESS FOR QUERY,
:PARTITION p200
INMEMORYMEMCOMPRESS FOR CAPACITY);
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
21/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Identifying : Tables With INMEMORY Attribute
NewINMEMORY co
*_TABLES dictionary INMEMORY is a seg
attribute
SELECT table_name, inmemoryFROM USER_TABLES;
TABLE_NAME INMEMORY------------ --------CHANNELS DISABLEDCOSTSCUSTOMERS DISABLED
PRODUCTS ENABLEDSALESTIMES DISABLED
USER_TABLESdoesn
segment attribute
objects Both COSTS & SALES
partitioned => log
INMEMORY attribu
reported in *_TAB_
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
22/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Identifying : Tables With INMEMORY Attribute
New view V$IM_SE
Indicate:
Objects populat
Current populat
Can also be used
compression rat
SELECT segment_name name,population_status status
FROM v$IM_SEGMENTS;
NAME STATUS------------ --------PRODUCTS COMPLETEDSALES STARTED
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
23/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Identifying : Columns Without the INMEMORY Att
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
24/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
DML and the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
1
4
2
3
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
25/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
IMCUJOURNAL
DML and the In-Memory Column Store
A journal is usedcolumn store traconsistent
DML operations row store as the
Corresponding ecolumn store ma
Copy of changedin Transaction J
Memory
ColumnFormat
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
26/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
IMCUJOURNAL
DML and the In-Memory Column Store
In-Memory Columnever out of date
Read consistency merging contentsthe transaction jo
When number of
journal hits internCU is refreshed
This is an online ocolumns store alw
Memory
ColumnFormat
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
27/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
1
2
3
4
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
28/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Scale-Out In-Memory Database to Any Size
Scale-Out across serve
memory and CPUs
In-Memory queries paservers to access local
Scale-out policy is a se(table, partition, sub p
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
29/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Scale-Out In-Memory Database to Any Size
Policy is user-spec
Controlled by DISTsubclause
Distribute by rowid rang
Distribute by partition
Distribute AUTO
Parallel Scan Affin
Requires parallel_degre
ALTER TABLE sales INMEMORYDISTRIBUTE BY PARTITION;
ALTER TABLE COSTS INMEMORYDISTRIBUTE AUTO;
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
30/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle Database In-Memory: Unique Fault Toleran
Similar to stora
Duplicate in-mecolumns on ano
Enabled per
Application t
In-Memory Colremains availabduplicate after f
Only Available on Engineered Systems
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
31/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle Database In-Memory: Unique Fault Toleran
Policy is user-speci
Controlled by DUPL
DUPLICATE
DUPLICATE ALL
ALTER TABLE sales INMEMORYDUPLICATE;
ALTER TABLE COSTS INMEMORYDISTRIBUTE AUTO DUPLICATE ALL;
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
32/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Configuring the In-Memory Column Store
Populating the In-Memory Column Store
Managing the In-Memory Column Store on RAC
Querying the In-Memory Column Store
1
2
3
4
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
33/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Why is an In-Memory scan faster than the buffer c
SELECT COL4 FROM MYTABLE;
XXXX
X
RESULT
Row Format
Buffer Cache
Column For
IM Column
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
34/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle In-Memory Column Store Storage Index
Each column is t
of multiple colu
Min / max valuefor each columnstorage index
Storage index prpartition pruninperformance for
Memory
SALES
ColumnFormat
Min 1
Max 3
Min 4
Max 7
Min 8Max 12
Min 13
Max 15
Example: Find sales from stores with a store_id of 8 or higher
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
35/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Orders of Magnitude Faster Analytic Data Scans
Load
multiplePROMO_IDvalues
Vector
Compareall valuesin 1 cycle
CPU
PROMO_
ID
9999
9999
9999
9999
Example:
Find all salesWith PROMO_ID 9999
VECTO
R
REGIST
ER
Memory
Each CPU core s
memory column
Scans use supervector instructio
Originally de
graphics & sc
Billions of rows/per CPU core
Row format
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
36/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Identifying : INMEMORY Table Scan
Optimizer fully a
Cost model adapconsider INMEM
New access metTABLE ACCESS IN ME
Can be disabledparameter
INMEMORY_QUER
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
37/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Identifying : INMEMORY Table Scan
NEWSession lev
Best way to deteIn-Memory was
Best way to meabenefits of In-M
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
38/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Joining and Combining Data Also Dramatically Fast
Converts joins omultiple tables iscans
Joins tables 10x
Example: Find all orders placed on Christmas eve
LINEORDERDATE_DIM
Da
teKey
Am
ount
Datekey is
24122013
Type=d.d_date='December 24, 2013'
Date
Sum
DateKey
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
39/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
In-memory Joins
Simple twobetween thDATE_DIM LINEORDER
IM columnadvantage Filter to pr
joins very e
SELECT SUM(lo_extendedprice * lo_discount)revenue
FROM lineorder l,
date_dim d
WHERE l.lo_orderdate = d.d_datekey
AND l.lo_discount BETWEEN 2 AND 3
AND d.d_date='December 24, 2013';
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
40/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Creation and Use of Bloom Filter
Bloom filters enable joconverted into fast col
Introduced in Oracle DVery efficiently appliedformat data via SIMD.
Same technique used ton Exadata
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
41/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Summary: Oracle Database In-MemoryPowering the Real-Time Enterprise
Extreme Performance& OLTP
Extreme Scale-Out & S
Extreme Availability
Extreme Simplicity
AGILE
EFFICIENT
DATA-
DRIVEN
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
42/44
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
43/44
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
-
7/17/2019 Oracle 12c In-memory Database Cache.pdf
44/44