Professional Documents
Culture Documents
Oracle Disclaimer: The following is intended to outline Oracle's general product direction. It is intended for information purposes only, and may
not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in
making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at
the sole discretion of Oracle.
(Thanks: Kay Cavender, Michelle Kolbe, Lori Lorusso, Andy Mendelsohn, Debbie Migliore, Maria Colgan, Penny Avril, Deba Chatterjee, Dan Koloski, Jagan Athreya, Werner De Gruyter, Julian Dontcheff, Jacob & Lucas Niemiec)
Monday:
The Best 12c Database Features 10:30 - 11:00 AM Rolta Booth #1701
Enter to Win an iPad Air
Tuesday:
Innovation, Big Data & IOT Brief 3:15 3:35 PM Rolta Booth #1701
Enter to Win an iPad Air
Wednesday:
All Booth Presentations at Rolta Booth # 1701 in Moscone South Vendor Hall
Richs Overview
@richniemiec
Top 250
Partners
Goals
Non-Goals
Overview 12c
Know the Oracle!
Start Me Up Using Memory Target, The Buffer
Cache & The Result Cache
Invisible Columns & Fetch First x Rows(12c) & virtual
columns (11g)
Multiple indexes on the same Column (12c) &
Invisible Indexes (11g)
Change Table Compression at import Time (12c)
10
No Search
Few using the Internet
No Amazon
No Facebook
No Twitter
11
12
Source Database
10.2.0.5 (or higher)
Target Database
12.1.x
12.1.x
12.1.x
In-Direct Upgrade Path
Source Database
Target Database
11.2.x
11.2.x
11.2.x
11.2.x
13
14
15
16
17
12.1.0.2
18
19
20
Databas
e Smart
Flash
Cache
Database Smart Flash Cache (Solaris/Oracle Linux) L2 cache set 2-10x SGA:
DB_FLASH_CACHE_FILE = /dev/sda, /dev/sdb, /dev/sdc
DB_FLASH_CACHE_SIZE = 32G, 32G, 64G
21
Initialization Parameter
None
SHARED_POOL_SIZE
LARGE_POOL_SIZE
JAVA_POOL_SIZE
DB_CACHE_SIZE
STREAMS_POOL_SIZE
22
Initialization Parameter
LOG_BUFFER (pfile only since 10g)
DB_KEEP_CACHE_SIZE
DB_RECYCLE_CACHE_SIZE
DB_nK_CACHE_SIZE
23
24
IM - Initialization Parameters
The Database In-Memory (IM) is not enabled if:
INMEMORY_SIZE is set to zero!
Add space to the SGA_TARGET to accommodate the IM: ALTER
SYSTEM SET SGA_TARGET=200G scope=both (SGA_TARGET
must be large enough for new IM)
ALTER SYSTEM SET INMEMORY_SIZE=100G scope=both
The IM Column Store (IM) creates an area in the SGA called InMemory Area. This is an added memory area in addition to the
buffer cache and other SGA areas.
October 21, 2015
25
In 11g, a procedure for SQL Plan Baselines (well cover these later).
DBMS_XPLAN.DISPLAY_SQL_PLAN_BASELINE (
sql_handle IN VARCHAR2 := NULL,
plan_name IN VARCHAR2 := NULL,
format
IN VARCHAR2 := 'TYPICAL') <BASIC/ALL>
RETURN dbms_xplan_type_table;
October 21, 2015
26
| Operation
Name
| Rows
| Bytes | Cost
| Pstart| Pstop |
-------------------------------------------------------------------------------------|
0 | UPDATE STATEMENT
328 |
2296 |
2 |
1 |
| JOURNAL_LINE
2 |
1 |
4 |
3 |
328 |
2296 |
2 |
1 |
4 |
UPDATE
27
-----------------------------------------------------------------------------| Id
| Operation
| Name
| Rows
-----------------------------------------------------------------------------|
0 | SELECT STATEMENT
1 |
14 |
728 |
(0)| 00:00:01 |
14 |
728 |
(0)| 00:00:01 |
-----------------------------------------------------------------------------Note
-----
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
28
29
30
EMPNO
SAL YEARLY_SAL DEPTNO
------------ ----------- ------------------- ---------------7369
800
9600
20
7499
1600
19200
30
7521
1250
15000
30
7566
2975
35700
20
7654
1250
15000
30
7698
2850
34200
30
...
October 21, 2015
32
Invisible Columns
33
Invisible Columns
The new 12c feature allows you to hide columns
If a user or developer selects ALL columns (or does a DESC) from a table (i.e.
select *) the invisible columns will NOT be displayed.
If a user specifically selects the invisible column (i.e. select salary,) the
column WILL be displayed in the output (you have to know its there).
You can set column(s) to be visible/invisible with an alter table :
SQL> ALTER TABLE EMPLOYEE MODIFY (SSN INVISIBLE);
Table altered.
34
WHERE DEPTNO=30)
AND DEPTNO=10
ORDER BY SAL DESC;
EMPNO ENAME
JOB
MGR HIREDATE
DEPTNO
SAL
COMM
7839 KING
PRESIDENT
17-NOV-81
10
5000
7782 CLARK
MANAGER
7839 09-JUN-81
10
2450
7934 MILLER
CLERK
7782 23-JAN-82
10
1300
35
JOB
MGR HIREDATE
DEPTNO
7839 KING
PRESIDENT
17-NOV-81
10
7782 CLARK
MANAGER
7839 09-JUN-81
10
7934 MILLER
CLERK
7782 23-JAN-82
10
36
SAL JOB
ENAME
DEPTNO
10
2450 MANAGER
CLARK
10
1300 CLERK
MILLER
10
37
Note: This is not for heavy security; there are other ways to achieve that:
You can use column level security using Oracle's VPD (Virtual Private Database) to
create a policy function and apply the policy function to our table, so that it does NOT
display certain rows for a given deptno, BUT ONLY when the salary and/or COMM
columns are selected. So all rows displayed when I DON'T choose SAL and/or
COMM and all rows EXCEPT deptno 10 when I DO choose the SAL and/or COMM
columns.
You could also use TDE (Transparent Data Encryption) to encrypt the data for a given
column. This is part of Oracle's Database Advanced Security Options and has certain
restrictions.
October 21, 2015
38
39
Great to turn off indexes for a while when you think theyre not
being used, but BEFORE you drop them.
Can NOT use INDEX hint (to override invisibility) anymore, but
CAN use NO_INDEX (to turn off visible indexes).
The index IS MAINTAINED during DML
Great for testing!
More in the 12c Tuning Session my next session!
October 21, 2015
40
select count(*) from dept_rich where deptno = 30; (doesnt see the index)
COUNT(*)
-------------512
Execution Plan
---------------------------------------------------------Plan hash value: 3024595593
-------------------------------------------------------------------------------| Id
| Operation
| Name
| Rows
--------------------------------------------------------------------------------
0 | SELECT STATEMENT
1 |
2 |
1 |
1 |
2 |
|*
2 |
SORT AGGREGATE
512 |
(0)| 00:00:01 |
|
1024 |
|
(0)| 0:00:01 |
--------------------------------------------------------------------------------
41
| Name
1|
2|
| 1 | SORT AGGREGATE |
1|
2|
|* 2 |
1 (0)| 00:00:01 |
|
---------------------------------------------------------------------------------------
42
43
44
*
ERROR at line 1:
ORA-01408: such column list already indexed
Make FIRST Index Invisible & can now create SECOND index:
alter index dept_unique1 invisible;
Index altered.
Index created.
45
user_indexes a, user_ind_columns b
where
a.index_name = b.index_name
and
a.table_name = DEPT;
TABLE_NAME INDEX_NAME
COLUMN_NAME
UNIQUENESS
VISIBILITY
DEPT
DEPT_UNIQUE1
DEPTNO
UNIQUE
INVISIBLE
DEPT
DEPT_REVERSE
DEPTNO
NONUNIQUE
INVISIBLE
DEPT
DEPT_NORMAL
DEPTNO
NONUNIQUE
INVISIBLE
DEPT
DEPT_BITMAP
DEPTNO
NONUNIQUE
VISIBLE
46
47
48
from customers2
group by cust_id
fetch first 10 rows only;
Elapsed: 00:00:00.95
------------------------------------------------------------------------------------
| Id | Operation
Bytes | Cost |%CPU|
|
Time
Name
|
| Rows
COUNT(CUST_ID)
-----------------PLAN_TABLE_OUTPUT--------------------------------------------------
--------------
0 | SELECT STATEMENT
|
1300K|
30 |(3) | 00:00:01|
51224|
1 | VIEW
|
1300K|
39 |(3) | 00:00:01|
51224|
2 |
650K|
51224|
3 |
650K|
HASH GROUP BY
|
30 |(3) | 00:00:01|
51224|
3 |
650K|
15
27
10 rows selected.
------------------------------------------------------------------------------------49
Offset x Rows
Fetch FIRST x ROWS Only
select count(cust_id)
from customers2
group by cust_id
offset 10000 rows fetch first
10 rows only;
COUNT(CUST_ID)
--------------
Elapsed: 00:00:00.95
-----------------------------------------------------------------------------------| Id | Operation
Time
|
10 rows selected.
Name
| Rows
| Bytes | Cost
|%CPU|
-----------------PLAN_TABLE_OUTPUT-------------------------------------------------|
0 | SELECT STATEMENT
00:00:01|
51224|
1300K|
30 |(3) |
1 | VIEW
00:00:01|
51224|
1300K|
39 |(3) |
2 |
WINDOW NOSORT STOPKEY|
00:00:01|
51224|
650K|
39 |(3) |
3 |
HASH GROUP BY
00:00:01|
51224|
650K|
30 |(3) |
3 |
INDEX FAST FULL SCAN|CUSTOMER2_IDX1|51224|
00:00:01|
650K|
30 |(0) |
7700238
1409320
50
51
TABLE_COMPRESSION_CLAUSE=COMPRESS BASIC
TABLE_COMPRESSION_CLAUSE=COMPRESS ROW STORE COMPRESS ADVANCED
This is especially helpful for Exadata migrations where more compression options (HCC) are available.
October 21, 2015
52
TRANSFORM=TABLE_COMPRESSION_CLAUSE:compress:table
5.937 KB
4 rows
emp_dept as
. . exported "SCOTT2"."EMP_DEPT"
rows
7.140 KB
14
54
7.140 KB
14
dba_segments
where
segment_name = 'EMP_DEPT';
SEGMENT_NAME
SEGMENT_TYPE
-------------------- -----------------EMP_DEPT
October 21, 2015
TABLE
55
Pluggable Databases
56
57
Pluggable Databases
CDB = Container Database (has Root DB & also has a seed PDB)
PDB = Pluggable Database (plugged into a CDB)
Non-CDB = Original type of Database (neither a CDB or PDB)
Why?: Cant consolidate 100s of database on one machine too many
resources required when you add the SGAs up! Enter PDBs.
58
Pluggable Databases
59
60
Pluggable Databases
In a CDB: Only one CDB$ROOT (Root), only one PDB$SEED (Seed), plus any PDBs (up to 252
more 253 including the seed) that you create or plug in.
CDB Root has schemas, schema objects, data dictionary information about PDBs
Seed database Cant add any objects only to create new PDBs (clone it to create others)
PDB appears to users/applications as if it was a non-CDB. Accessing a PDB is like accessing a
non-CDB
PDBs are how you split applications physically
61
Containers 0 - 254
Entire CDB => Container ID = 0
Root (CDB$ROOT) => Container ID = 1
Seed (PDB$SEED) => Container ID = 2
PDBs => Container ID = 3 to 254
(While in PDB1):
(Connect to ROOT):
CON_ID
CON_ID
------------------------------
------------------------------
CON_NAME
CON_NAME
------------------------------
------------------------------
PDB1
CDB$ROOT
(integer overflow!)
62
63
OPEN_MODE
OPEN_TIME
READ ONLY
PDB1
PDB_SS
23-FEB-13 05.29.19.861 AM
64
Pluggable Databases
PDB is backward compatible with pre-12c database.
Common users like SYS, SYSTEM connect to the CDB and also
across all PDBS in which it has privileges (you can create your own
common users as well). Common users create/plug/unplug PDBs.
Privileged common users can even switch CDBs
USER_DATA TABLESPACE usertbs DATAFILE '/u01/app/oracle/oradata/pdbseed/usertbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;66
67
This PATH_PREFIX clause restricts the location of files and directory object paths
associated with a PDB to the /disk1/oracle/dbs/dwpdb directory.
FILE_NAME_CONVERT = ('/oracle/dbs/', '/oracle/dwpdb/')
This FILE_NAME_CONVERT clause generates file names for the new PDB in the
/oracle/dwpdb directory using file names in the /oracle/dbs directory. This is when
you want to move file location upon creation.
SOURCE_FILE_NAME_CONVERT = ('/disk1/oracle/pdb1/',
'/disk2/oracle/pdb1/'). This SOURCE_FILE_NAME_CONVERT clause uses the
files in the /disk2/oracle/pdb1 directory instead of the /disk1/oracle/pdb1 directory. In
this case, the XML file describing a PDB specifies the /disk1/oracle/pdb1 directory,
but the PDB should use the files in the /disk2/oracle/pdb1 directory. NONE if
location is correct.
October 21, 2015
68
69
Cloning a PDB
CREATE PLUGGABLE DATABASE pdb2 FROM pdb1
PATH_PREFIX = '/disk2/oracle/pdb2'
FILE_NAME_CONVERT = ('/disk1/oracle/pdb1/',
'/disk2/oracle/pdb2/');
CREATE PLUGGABLE DATABASE pdb2 FROM pdb1
FILE_NAME_CONVERT = ('/disk1/oracle/pdb1/',
'/disk2/oracle/pdb2/') STORAGE (MAXSIZE 2G
MAX_SHARED_TEMP_SIZE 100M);
CREATE PLUGGABLE DATABASE pdb2 FROM
pdb1@pdb1_link;
October 21, 2015
70
Cloning a PDB
CREATE PLUGGABLE DATABASE pdb2 FROM pdb1;
*
ERROR at Line 1:
ORA-65016: FILE_NAME_CONVERT must be specified
71
72
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Open the new PDB in read/write mode & Back up the PDB.
73
74
75
76
Pluggable Databases
_common_user_prefix=c##
_common_user_prefix=
77
78
DBA_CONTAINER_DATA
SQL> desc dba_container_data
Name
Null?
Type
VARCHAR2(128)
DEFAULT_ATTR
CHAR(1)
OWNER
VARCHAR2(128)
OBJECT_NAME
VARCHAR2(128)
ALL_CONTAINERS
VARCHAR2(1)
CONTAINER_NAME
VARCHAR2(128)
USERNAME
D OWNER
OBJECT_NAM A CONTAINER_
SYSTEM
DBSNMP
SYS
SYSBACKUP
79
Open/Close PDBs
SQL> ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE OPEN READ WRITE;
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE CLOSE; (shutdown)
Pluggable database altered.
Alter pluggable database open upgrade; (to migrate)
Pluggable database altered.
October 21, 2015
80
Open/Close PDBs
ALTER PLUGGABLE DATABASE PDB_SS, PDB1 CLOSE; (not in
CDB)
ALTER PLUGGABLE DATABASE PDB_SS, PDB1 CLOSE
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database
Session altered.
alter pluggable database ALL open read only; (from CDB)
Pluggable database altered.
ALTER PLUGGABLE DATABASE PDB_SS, PDB1 CLOSE;
October 21, 2015
open_time
v$pdbs;
NAME
OPEN_MODE
OPEN_TIME
PDB$SEED
READ ONLY
11-MAR-13 09.29.18.284 PM
PDB1
MOUNTED
27-MAR-13 01.19.02.666 AM
PDB_SS
MOUNTED
27-MAR-13 01.19.02.985 AM
82
Open/Close PDBs
ALTER PLUGGABLE DATABASE PDB_SS, PDB1 open;
Pluggable database altered.
select name, open_mode,
from
open_time
v$pdbs;
NAME
OPEN_MODE
OPEN_TIME
PDB$SEED
READ ONLY
11-MAR-13 09.29.18.284 PM
PDB1
PDB_SS
Open/Close PDBs
alter pluggable database all except pdb1 close immediate;
Pluggable database altered.
open_time
v$pdbs;
OPEN_MODE
OPEN_TIME
READ ONLY
11-MAR-13 09.29.18.284 PM
PDB1
PDB_SS
MOUNTED
27-MAR-13 01.29.47.225 AM
ERROR at line 1:
ORA-65017: seed pluggable database may not be dropped or altered
84
Startup PDB
Startup pluggable database pdb1
open;(read/write)
Pluggable Database opened.
85
open_time
v$pdbs;
OPEN_MODE
OPEN_TIME
MOUNTED
27-MAR-13 01.50.25.345 AM
86
open_time
v$pdbs;
NAME
---------PDB$SEED
PDB1
PDB_SS
OPEN_MODE
---------READ ONLY
MOUNTED
READ WRITE
OPEN_TIME
------------------------11-MAR-13 09.29.18.284 PM
27-MAR-13 02.00.06.536 AM
27-MAR-13 01.41.58.049 AM
87
NAME
SQL> startup
Fixed Size
Variable Size
Database Buffers
Redo Buffers
626327552 bytes
2276008 bytes
524289368 bytes
92274688 bytes
7487488 bytes
OPEN_MODE
OPEN_TIME
Database mounted.
PDB1
MOUNTED
Database opened.
PDB_SS
MOUNTED
open_time
27-MAR-13
88
89
V$ Views
New views start with CDB_ are CDB only
Dictionary/Performance views (V$) show only
PDB when queried from that PDB (isolation)
Query performance views from root & will show
all PDBs
PDBs have container identifier when you look
at root see all of the ids
V$SESSION & V$INSTANCE have a CON_ID
column for containers (& new V$IO_OUTLIER)
October 21, 2015
90
Where is Everything?
SELECT d.con_ID, p.PDB_NAME, d.FILE_ID, d.TABLESPACE_NAME,
d.FILE_NAME
FROM
CDB_PDBS p, CDB_DATA_FILES d
WHERE
p.PDB_ID(+) = d.CON_ID
order
by d.con_id;
CON_ID PDB
FILE_ID TABLESPACE_NAME
FILE_NAME
USERS
/u01/app/oracle/oradata/cdb1/users01.dbf
UNDOTBS1
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
SYSAUX
/u01/app/oracle/oradata/cdb1/sysaux01.dbf
SYSTEM
/u01/app/oracle/oradata/cdb1/system01.dbf
2 PDB$SEED
SYSTEM
/u01/app/oracle/oradata/cdb1/pdbseed/system01.dbf
2 PDB$SEED
SYSAUX
/u01/app/oracle/oradata/cdb1/pdbseed/sysaux01.dbf
3 PDB1
SYSTEM
/u01/app/oracle/oradata/cdb1/pdb1/system01.dbf
3 PDB1
SYSAUX
/u01/app/oracle/oradata/cdb1/pdb1/sysaux01.dbf
4 PDB_SS
SYSTEM
/u01/app/oracle/oradata/cdb1/pdb_ss/system01.dbf
4 PDB_SS
10
SYSAUX
/u01/app/oracle/oradata/cdb1/pdb_ss/sysaux01.dbf
4 PDB_SS
11
EXAMPLE
/u01/app/oracle/oradata/cdb1/pdb_ss/example.dbf
11 rows selected.
91
CDB_PDBS p, CDB_TABLES t
where
p.PDB_ID = t.CON_ID
AND
T.OWNER ='ORDDATA
ORDER
BY t.TABLE_NAME;
PDB_ID PDB_NAME
OWNER
TABLE_NAME
ORDDATA
ORDDCM_ANON_ACTION_TYPES
3 PDB1
ORDDATA
ORDDCM_ANON_ACTION_TYPES
2 PDB$SEED
ORDDATA
ORDDCM_ANON_ATTRS
3 PDB1
ORDDATA
ORDDCM_ANON_ATTRS
3 PDB1
ORDDATA
ORDDCM_ANON_ATTRS_TMP
2 PDB$SEED
ORDDATA
ORDDCM_ANON_ATTRS_TMP
3 PDB1
ORDDATA
ORDDCM_ANON_ATTRS_WRK
2 PDB$SEED
ORDDATA
ORDDCM_ANON_ATTRS_WRK
92
FROM
CDB_PDB_HISTORY
WHERE
CON_ID > 2
ORDER
BY CON_ID;
Sample output:
DB_NAME
CON_ID PDB_NAME
OPERATION
OP_TIMEST CLONED_FROM_PDB
3 PDB1
CREATE
01-APR-13 PDB$SEED
NEWCDB
4 PDB_SS
CREATE
01-APR-13 PDB$SEED
NEWCDB
5 PDB2
CLONE
02-APR-13 PDB1
93
v$active_services
order
by 1;
NAME
SERVICE_ID CON_NAME
CON_ID
SYS$BACKGROUND
1 CDB$ROOT
SYS$USERS
2 CDB$ROOT
cdb1
6 CDB$ROOT
cdb1XDB
5 CDB$ROOT
pdb1
3 PDB1
pdb_ss
3 PDB_SS
6 rows selected.
94
95
ISPDB_MODIFIABLE
AND
= 'TRUE'
(without condition can set 147 parameters out of 357)
(There were 341 parameters in 11gR2)
NAME
---------------------------------------optimizer_adaptive_reporting_only
optimizer_capture_sql_plan_baselines
optimizer_dynamic_sampling
optimizer_features_enable
optimizer_index_caching
optimizer_index_cost_adj
optimizer_mode
optimizer_use_invisible_indexes
optimizer_use_pending_statistics
optimizer_use_sql_plan_baselines
10 rows selected.
96
97
98
STATUS
-------------------ACTIVE
ACTIVE
COMMENTS
-------------------Default CDB plan
Internal CDB plan
Pluggable
Utilization Parallel
Plan
Database
Shares
Limit
Limit
-------------------------- ------------------------- ------ ----------- -------DEFAULT_CDB_PLAN
ORA$DEFAULT_PDB_DIRECTIVE
1
100
100
DEFAULT_CDB_PLAN
ORA$AUTOTASK
90
100
99
100
This guy and his team working hard to make your life easier!
101
Local
IM alloc
Local
IM alloc
Local
IM alloc
102
103
104
105
106
107
Adaptive query optimization allows optimizer to adjust execution plan at run time when
additional/better information is available.
Adaptive Plans does not pick the final plan until execution time based on statistics collection.
Information learned at execution time is used in future executions. Youll see the plan table
output in the note section:
Note
-------------------------- this is an adaptive plan
The 12c Adaptive Optimizer adapts plans based on not just the original tables stats, but also
additional adaptive statistics
There are three types of Adaptive Statistics:
October 21, 2015
108
109
110
DB Replay Options...
Synchronized Replay
Unsynchronized Replay
112
113
114
diag
rdbms
<database name>
<SID>
alert
October 21, 2015
cdump
incident
trace
(others)
115
116
Security Enhancements
Enhanced security of Audit Data with new AUDIT_ADMIN role
117
1977
2007
118
Move partitions while ONLINE with DML happening / Flex ASM to other storage
Improved query performance against OLAP cubes (especially Exadata)
Automatic extended stats for groups of columns accessed together
DBMS_STATS.GATHER_TABLE_STATS run on a partitioned table when CONCURRENT is
set to TRUE will gather stats using multiple jobs concurrently
Online statistics gathered during a bulk load (similar to rebuild index command)
Flashback Data Archive (FDA) can be fully used on HCC tables on Exadata
Enterprise Manager Database Express 12c ships with every database (NICE!)
Spot ADDM triggered by high CPU or I/O into AWR Reports
Mask Data At Source for testing & Oracle Masking templates for E-Business
Oracle Data Redaction (prevents things like SSN from being displayed)
October 21, 2015
119
120
121
Version
6
7
8.0
8.1
9.0
9.2
10gR1
10gR2
V$ Views
23
72
132
185
227
259
340 (+31%)
396
X$ Tables
? (35)
126
200
271
352
394
543 (+38%)
613
11gR1
484 (+42%)
798 (+46%)
11gR2
12cR1
525 (+33%)
606 (+25%)
945 (+54%)
1062 (+33%)
122
123
10 TB of user data
Requires 10 TB of IO
1 TB
with compression
100 GB
with partition pruning
Sub second
On Database
Machine
20 GB
with Storage Indexes
5 GB
with Smart Scans
124
125
Servers/cores
Servers/disks**
Flash Memory
EF (Extreme Flash)
SAS (High Capacity)
Flash IOPs*
InfiniBand Switches
Full
4T
8/288
14/168
44.8T
179T
672T
4,144,000
2
20T/hr*
Half
2T
4/144
7/84
22.4T
90T
336T
2,072,000
2
10T/hr*
Quarter Eighth
1T
1T
2/72
2/36
3/36
3/18
9.6T
4.8T
38.4T
19.2T
144T
72T
1,036,000 518K
2
2
5T/hr*
2.5T/hr
* Estimate (Reads of 8K blocks Writes are the same for Flash and around for disk
** 4T High Capacity SAS or 1.6T NVMe PCI Flash Drives; X5-2, X4-2, X3-2 has 1/8 Rack, the X2-2 does not!
126
127
128
12.1.0.2
129
12.1.0.2
130
131
132
IM Why so fast?
SIMD (Simple Instruction, Multiple Data)
Concept of SIMD
Performs the same operation on multiple data points simultaneously - Wikipedia (i.e. Scans
multiple data values in the same CPU instruction (instead of one at a time)).
October 21, 2015
133
134
12.1.0.2
135
12.1.0.2
136
137
IM - Initialization Parameters
The Database In-Memory is not enabled if: INMEMORY_SIZE is
set to zero!
Add space to the SGA_TARGET to accommodate the IM: ALTER
SYSTEM SET SGA_TARGET=200G scope=both (SGA_TARGET
must be large enough for new IM)
ALTER SYSTEM SET INMEMORY_SIZE=100G scope=both
The IM Column Store (IM) creates an area in the SGA called InMemory Area (IM Column Store). This is an added memory area
in addition to the buffer cache and other SGA areas.
138
IM Setting INMEMORY
Create EMP and put it into the IM:
SQL> CREATE TABLE emp8
139
Check IM in USER_TABLES
SQL> alter table emp inmemory;
Table altered.
EMP
ENABLED
NONE
140
ORDER BY EMPNO;
EMPNO
---------7839
---------------------------------------------------------------------------| Id | Operation
|Name |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT
| 1 | SORT AGGREGATE
141
142
143
IM Priority Levels
Change the Priority Level: Objects are populated based on priority
or immediately if they are accessed. The priorities that you can set
are:
CRITICAL Populated upon database opening
HIGH Populated after CRITICAL if space exists in IM
MEDIUM After CRITICAL/HIGH if space exists in IM
LOW - After CRITICAL/HIGH/MEDIUM if space exists
NONE (default) Populated only when accessed for the first time
if space exists in IM
October 21, 2015
144
IM Priority Levels
Populate the EMP table upon database startup (when open):
ALTER TABLE emp INMEMORY PRIORITY CRITICAL;
Table altered.
145
Column1
Column1
Column 1
Column1
(Warehouse)
(Archive)
146
IM - Compression
Compression Level when populating the IM :
NO MEMCOMPRESS Populate IM without compressing
MEMCOMPRESS FOR DML Minimal compression for DML
MEMCOMPRESS FOR QUERY LOW Optimized for query (DEFAULT)
MEMCOMPRESS FOR QUERY HIGH Optimized for query but save more
space
MEMCOMPRESS FOR CAPACITY LOW Balanced with bias toward
saving space (+OZIP)
MEMCOMPRESS FOR CAPACITY HIGH Optimized for best space
savings (slowest)
Usually get 2-20x; Ive seen 50x+
October 21, 2015
147
Table created.
October 21, 2015
148
IM - Storage Indexes
IM Storage Indexes:
IM storage indexes are created and maintained on each column
in the IMCUs regardless of the compression.
Automatically created by Oracle (like Exadata).
They are used to prune the data by checking the min/max values
in each IMCU (In Memory Compression Units)
To evaluate WHERE clause: equality/in-list/some range)
In Exadata, ORDERED data in the table matters a lot will it also
matter in IM not sure yet
October 21, 2015
149
| Name |
| 1 | SORT AGGREGATE
|* 2 | HASH JOIN
| 3|
|* 4 |
| 5|
October 21, 2015
|* 6 |
| :BF0000 |
| :BF0000 |
150
IM with CDB/PDB
All PDBs within a CDB share a single IM column store
INMEMORY_SIZE initialization parameter on the CDB
Each PDB also sets an INMEMORY_SIZE and anything put in IM comes from total
CDBs IM setting
All PDBs added together can be higher than CDBs IM size (over-subscribed);
Memory is used on a first come basis by design to ensure this CDB IM is not
wasted
One PDB can take up entire CDB IM & starves others
Each PDB has its own PRIORITY list (which PDB starts first will matter A LOT!).
When out of space - you are out! until PDB shut down or something removed.
October 21, 2015
151
152
12.1.0.
153
154
155
156
Duplicate in-memory
columns on one other
node (DUPLICATE ALL
will duplicate on all nodes)
Enabled per
table/partition
Application
transparent
Downtime eliminated by
using duplicate after failure
RAC
Thanks Oracle: Graphics
157
IM Hints FYI
/*+ INMEMORY(table) */
/*+ NO_INMEMORY(table) */ (or NO INMEMORY??)
/*+ INMEMORY_PRUNING(table) */ (Control the use of the IM Storage Index)
/*+ NO_INMEMORY_PRUNING(table) */ (Control the use of the IM Storage Index)
/*+ PX_JOIN_FILTER(table) */ (force the use of a Bloom Filter for a join if optimizer
doesnt)
/*+ NO_PX_JOIN_FILTER(table) */ (force the NON-use of a Bloom Filter for a join if
optimizer doesnt)
/*+ VECTOR_TRANSFORM */ (force the use of the VECTOR GROUP BY - see
earlier section not in docs!)
October 21, 2015
158
159
160
161
INMEMORY_TRICKLE_REPOPULATE_SERVERS_PERCENT DEFAULT
162
163
Active Data Guard Security has in-memory table of failed login attempts
Heat Map that tracks modifications of rows (block level), table, partition levels
Automate policy-driven data movement and compression using Heat Map
Move partitions while ONLINE with DML happening / Flex ASM to other storage
Improved query performance against OLAP cubes (especially Exadata)
Automatic extended stats for groups of columns accessed together
DBMS_STATS.GATHER_TABLE_STATS run on a partitioned table when CONCURRENT is set to TRUE will gather stats using
multiple jobs concurrently
Online statistics gathered during a bulk load (similar to rebuild index command)
Flashback Data Archive (FDA) can be fully used on HCC tables on Exadata
Enterprise Manager Database Express 12c ships with every database (NICE!)
Spot ADDM triggered by high CPU or I/O into AWR Reports
Mask Data At Source for testing & Oracle Masking templates for E-Business
Oracle Data Redaction (prevents things like SSN from being displayed)
October 21, 2015
164
165
Increase (Result)
1 mph (Windows)
65K mph (Internet)
300T mph (Robotics/3Detc.)
5T*T*B mph
166
How Big?
167
Wednesday
Big Data/IOT / The Future:
1:45 2:30 MS 103
168
169
170
171
Great Sales/Marketing
Great Database
Applications Leader
BI Leader /
Already in the lead
Game Over!
Hardware/Software Engineering!
172
Monday:
The Best 12c Database Features 10:30 - 11:00 AM Rolta Booth #1701
Enter to Win an iPad Air
Rolta Booth #1701
Tuesday:
Innovation, Big Data & IOT Brief 3:15 3:35 PM Rolta Booth #1701
Enter to Win an iPad Air
Rolta Booth #1701
Wednesday:
174
175
176
Database References
Oracle 12c Beta Documentation & Beta Database
Oracle11g Performance Tuning Tips & Techniques; Richard J. Niemiec; Oracle Press
www.tusc.com. www.rolta.com
Database Secure Configuration Initiative: Enhancements with Oracle Database 11g,
www.oracle.com
All Oracle11g Documentation from Oracle Beta Site
Introduction to Oracle Database 11g, Ken Jacobs
Oracle Database 11g New Features, Linda Smith
New Optimizer Features in 11g, Maria Colgan
www.ioug.org, www.oracle.com, en.wikipedia.org & technet.oracle.com
Thanks Dan M., Bob T., Brad, Joe, Heidi, Mike K., Debbie, Maria, Linda
All companies and product names are trademarks or registered trademarks of the respective
owners
October 21, 2015
177
Exadata References
Exadata V2 Sun Oracle DB Machine, Oracle
Oracle Exadata Implementation Workshop, Oracle Corporation, McLean, Virginia - Multiple Exadata
sessions
Oracle11g Performance Tuning Tips & Techniques, Rich Niemiec, Oracle Press McGraw-Hill
Advanced Compression with Oracle Database 11g Release 2, Oracle Corporation, Steven Lu
Tech Crunch
Twilight Zone Series
Rod Serling; Submitted for Your Approval, American Masters
YouTube/oracle Oracle OpenWorld On Demand
178
Oracle9i Tuning (May 2003)
Oracle10g Tuning (June
2007)
Oracle11g Tuning (Jan 2014)
179