SlideShare a Scribd company logo
Oracle Database 12c
The Best Oracle Database 12c
Tuning Features for Developers
and DBAs
Presented	by: Alex	Zaballa,	Oracle	DBA
Alex Zaballa
http://alexzaballa.blogspot.com/
@alexzaballa206	and	counting…
https://www.linkedin.com/in/alexzaballa
Worked	for	7 years	in	Brazil as	an	Oracle	Developer.
2000	- 2007
Worked	for	8 years	in	Angola	as	an	Oracle	DBA
for	the	Ministry	of	Finance.
2007	- 2015
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Developers and DBAs
Oracle Database 12c
The Best Oracle Database 12c Tuning Features for
Developers and DBAs
Oracle	Official	Documentation
12.1.0.2
• http://docs.oracle.com/database/121/NEWFT/ch
apter12102.htm
Oracle	Learning	Library	(OLL)
• https://apexapps.oracle.com/pls/apex/f?p=44785
:1:0
Articles	about	12c
• https://oracle-base.com/articles/12c/articles-
12c
“With	more	than	500	new	features,	Oracle	
Database	12c is	designed	to	give	Oracle	
customers	exactly	what	they’ve	told	us	they	
need	for	cloud	computing,	big	data,	security,	
and	availability.”
Oracle	Announces	Beta	Availability	of	Oracle	Database	12c	Release	2 - Oct	26,	
2015
• PLUGGABLE	DATABASES
From	252	to	4096
• HOT	CLONING
Don’t	need	to	put	the	source	in	read-only	for	cloning
• SHARDING
It’s	like	partitioning	in	a	shared	nothing	database
The	data	is	split	into	multiple	databases
• In-Memory
In-Memory	column	Store	on	Active	Data	Guard
Heat	Map	
• APPLICATION	CONTAINER
Pluggable	Databases	will	share	application	objects
• More	isolation,	resource	manager	will	limit	the	memory	in	addition	to	CPU	and	I/O.
• AWR	will	work	on	Active	Data	Guard	Database:	you	can	tune	your	reporting	database
Availability	of	Oracle	Database	12.2
Source:	https://blogs.oracle.com/UPGRADE/entry/oracle_database_12_2_just
Oracle	Database	Release	Status
MOS	Note:742060.1
Multitenant
Source:	Oracle	Documentation
Multitenant
Is it a Tuning Feature?
Source:	Oracle	Documentation
Multitenant
Source:	https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
Multitenant
Source:	https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
Multitenant
Source:	https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
In-Memory
Source:	Oracle	Documentation
In-Memory
SIMD	Vector	Processing
Source:	http://www.oracle.com/technetwork/database/in-memory/overview/twp-
oracle-database-in-memory-2245633.html
In-Memory
Source:	Oracle	Documentation
Is it a Tuning Feature?
“Using Database In-Memory, businesses can instantaneously
run analytics and reports that previously took hours or days.”
In-Memory
In-Memory	Area	– a	static	pool	in	SGA
In-Memory
Source:	OracleBase.com
In-Memory
Alter	table	hr.EMPLOYEES inmemory;
ALTER	TABLE	sales	MODIFY	PARTITION	SALES_Q1_1998	
INMEMORY;
ALTER	TABLE	sales	INMEMORY	NO	INMEMORY(prod_id);
CREATE	TABLESPACE	tbs_test
DATAFILE	'+DG01	SIZE	100M	
DEFAULT	INMEMORY;
In-Memory
Source:	http://www.oracle.com/technetwork/database/in-memory/overview/twp-
oracle-database-in-memory-2245633.html
SQL	Query	Row	Limits	and	Offsets
SQL	Query	Row	Limits	and	Offsets
SQL	Query	Row	Limits	and	Offsets
Top-N	Queries	– Pré 12c
SQL	Query	Row	Limits	and	Offsets
SQL	Query	Row	Limits	and	Offsets
SQL	Query	Row	Limits	and	Offsets
DEMO
Approximate	Count	Distinct
This	function	provides	an	alternative	to	the	COUNT	(DISTINCT	
expr),	with	negligible	deviation	from	the	exact	result.
DEMO
PL/SQL	From	SQL
with
function	Is_Number
(x	in	varchar2)	return	varchar2	is
Plsql_Num_Error exception;
pragma	exception_init(Plsql_Num_Error,	-06502);
begin
if	(To_Number(x)	is	NOT	null)	then
return	'Y';
else
return	'';
end	if;
exception
when	Plsql_Num_Error then
return	'N';
end	Is_Number;
select	rownum,	x,	is_number(x)	is_num from	t;
DEMO
Session	Level	Sequences
Session	level	sequences are	used	to	produce	
unique	values	in	a	session.	Once	the	session	
ends,	the	sequence	is	reset.
Generating	Primary	Keys	for	a	Global	
Temporary	Table	would	be	a	field	where	those	
kinds	of	sequences	could	be	used.
Session	Level	Sequences
CREATE	SEQUENCE	sequence_test
START	WITH			1
INCREMENT	BY	1
SESSION
/
Session	Level	Sequences
ALTER	SEQUENCE	sequence_test
SESSION;
ALTER	SEQUENCE	sequence_test
GLOBAL;
DEMO
Session	private	statistics	for	Global	
Temporary	Tables
Pre	12c,	statistics	gathered	for	global	temporary	
tables	(GTTs)	were	common	to	all	sessions.
Session	private	statistics	for	Global	
Temporary	Tables
On	12c,	by	default	session-private	statistics	are	
enabled
SELECT	DBMS_STATS.get_prefs('GLOBAL_TEMP_TABLE_STATS')	
FROM	dual;
STATS
------------------------------------------------------------------------------
SESSION
Session	private	statistics	for	Global	
Temporary	Tables
How	to	change?
Behavior	pre	12c:
BEGIN
DBMS_STATS.set_global_prefs (
pname =>	'GLOBAL_TEMP_TABLE_STATS',
pvalue =>	'SHARED');
END;
/
Back	to	default	on	12c:
BEGIN
DBMS_STATS.set_global_prefs (
pname =>	'GLOBAL_TEMP_TABLE_STATS',
pvalue =>	'SESSION');
END;
/
Session	private	statistics	for	Global	
Temporary	Tables
How	to	change	for	one	table?
BEGIN
dbms_stats.set_table_prefs('SCOTT','GTT_TEST',
'GLOBAL_TEMP_TABLE_STATS','SHARED');
END;
BEGIN
dbms_stats.set_table_prefs('SCOTT','GTT_TEST',
'GLOBAL_TEMP_TABLE_STATS’,’SESSION');
END;
DEMO
Temporary	Undo
Global	Temporary	Tables	(GTT)	hold	the	data	in	a	
temporary	tablespace.	The	data	in	GTTs	are		either	
deleted	after	commit	or	kept	until	the	session	is	
connected	depending	of	the	definition	of	the	
GTT.(ON	COMMIT	PRESERVE	OR	DELETE	ROWS	).
DMLs	in	a	Global	Temporary	Tables	do	not	generate	
REDO,	but	generate	UNDO and	this	will	result	in	
REDO	generating.
Temporary	Undo
alter	session	set	temp_undo_enabled=true;
alter	system	set	temp_undo_enabled=true;
**you	can	change	for	the	session	or	for	the	database.
*default	true
DEMO
Multiple	Indexes	on	the	same	set	of	
Columns
Pre	12c:
ORA-01408:	such	column	list	already	indexed	
error.
Multiple	Indexes	on	the	same	set	of	
Columns
Is	the	ability	to	create	more	than	one	index	on	
the	same	set	of	columns	in	12c.
**Only	one	of	these	indexes	can	be	visible	at	a	
time
Multiple	Indexes	on	the	same	set	of	
Columns
Why	would	you	want	to	do	that?
• Unique	versus	nonunique
• B-tree	versus	bitmap
• Different	partitioning	strategies
DEMO
Limit	the	PGA
SQL>	show	parameter	pga
NAME																									 TYPE												VALUE
-------------------------- ------------- ----------------------
pga_aggregate_limit big	integer					2G
pga_aggregate_target ****
Limit	the	PGA
PGA_AGGREGATE_LIMIT is	set	to	the	greater	of:
- 2	GB	(default	value)
- 200%	of	PGA_AGGREGATE_TARGET
- 3	MB	times	the	PROCESSES	parameter
Statistics	During	Loads
The	ability	to	gather	statistics	automatically	
during	bulk	loads:
- CREATE	TABLE	AS	SELECT
- INSERT	INTO	...	SELECT	into	an	empty	table	
using	a	direct	path	insert
DEMO
Partial	Indexes	for	Partitioned	Table
• You	can	create	local	and	global	indexes	on	a	
subset of	the	partitions	of	a	table,	enabling	
more	flexibility	in	index	creation.
• This	feature	is	not	supported	for	unique	
indexes,	or	for	indexes	used	for	enforcing	
unique	constraints.
Partial	Indexes	for	Partitioned	Table
DEMO
Full	Database	Caching
Can	be	used	to	cache	the	entire	database	in	
memory.	It	should	be	used	when	the	buffer	
cache	size	of	the	database	instance	is	greater	
than	the	whole	database	size.
Adaptive	Query	Optimization
ê
Adaptive	Plans
ê
Adaptive	Join	Method
Adaptive	Join	Method
Optimizer	can	change	join	from	Nested	Loop	to	
Hash	Join	and	vice	versa.
Why?
Optimizer	mistakes
§ Estimated	Rows	and	Actual	rows	are	different
Before	12c	requires	DBA/Developer	intervention
Adaptive	Join	Method
Source:	Oracle	Documentation
Adaptive	Join	Method
Parameters	that	control	Adaptive	Plans:
Name Type Value
optimizer_adaptive_features boolean TRUE
optimizer_adaptive_reporting_only boolean FALSE
optimizer_features_enable string 12.1.0.1
Explain	Plan	command	shows	the	
default	plan
Source:	Oracle	Documentation
DBMS_XPLAN.DISPLAY_CURSOR	
shows	the	final	plan
Source:	Oracle	Documentation
DEMO
Real-Time	SQL	Monitoring
• Sql Monitoring	requires	both	Diagnostics	and	
Tuning	Pack	licenses
Real-Time	SQL	Monitoring
• MONITOR	Hint
SELECT	/*+	MONITOR	*/
• All	parallel	statements
• After	5	seconds	of	CPU/IO	time	spent	for	serial	
queries
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
Real-Time	SQL	Monitoring
SPOOL	/tmp/report_sql_monitor.htm
SELECT	DBMS_SQLTUNE.report_sql_monitor(
sql_id =>	'5dhu4w0j59yp7',
type									=>	'HTML',
report_level =>	'ALL')	AS	report
FROM	dual;
SPOOL	OFF
Real-Time	SQL	Monitoring
DEMO
SQLcl
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Developers and DBAs
Thank	You
Slides	Available:	http://www.slideshare.net/

More Related Content

PPTX
Moving your Oracle Databases to the Oracle Cloud
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
PDF
Monitor Engineered Systems from a Single Pane of Glass: Oracle Enterprise Man...
PPTX
EBS on Oracle Cloud
PPTX
2019 - OOW - Database Migration Methods from On-Premise to Cloud
PDF
Oracle Enterprise Manager 12c: updates and upgrades.
PPTX
What to Expect From Oracle database 19c
PPTX
The Oracle Autonomous Database
Moving your Oracle Databases to the Oracle Cloud
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
Monitor Engineered Systems from a Single Pane of Glass: Oracle Enterprise Man...
EBS on Oracle Cloud
2019 - OOW - Database Migration Methods from On-Premise to Cloud
Oracle Enterprise Manager 12c: updates and upgrades.
What to Expect From Oracle database 19c
The Oracle Autonomous Database

What's hot (18)

PDF
Oracle Exadata Cloud Services guide from practical experience - OOW19
PPTX
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
PDF
[db tech showcase Tokyo 2018] #dbts2018 #B31 『1,2,3 and Done! 3 easy ways to ...
PPTX
2019 - GUOB Tech Day / Groundbreakers LAD Tour - Database Migration Methods t...
PPTX
Exachk and oem12c - IOUG C15LV
PPTX
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
PDF
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
PDF
Oracle NoSQL Database -- Big Data Bellevue Meetup - 02-18-15
PPTX
Oracle Database in-Memory Overivew
PPTX
Oracle GoldenGate Microservices Overview ( with Demo )
PPTX
Oracle GoldenGate on Docker
PPTX
OOW19 - HOL5221
PDF
Oracle IaaS Overview - AIOUG Hyderabad Chapter
PPTX
Oracle GoldenGate 21c New Features and Best Practices
PPTX
ECO 2022 - OCI and HashiCorp Terraform
PPTX
Database As A Service: OEM + ODA (OOW 15 Presentation)
PDF
Meetup Oracle Database MAD_BCN: 1.1 Servicios de Oracle Database en la nube
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
Oracle Exadata Cloud Services guide from practical experience - OOW19
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
[db tech showcase Tokyo 2018] #dbts2018 #B31 『1,2,3 and Done! 3 easy ways to ...
2019 - GUOB Tech Day / Groundbreakers LAD Tour - Database Migration Methods t...
Exachk and oem12c - IOUG C15LV
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle NoSQL Database -- Big Data Bellevue Meetup - 02-18-15
Oracle Database in-Memory Overivew
Oracle GoldenGate Microservices Overview ( with Demo )
Oracle GoldenGate on Docker
OOW19 - HOL5221
Oracle IaaS Overview - AIOUG Hyderabad Chapter
Oracle GoldenGate 21c New Features and Best Practices
ECO 2022 - OCI and HashiCorp Terraform
Database As A Service: OEM + ODA (OOW 15 Presentation)
Meetup Oracle Database MAD_BCN: 1.1 Servicios de Oracle Database en la nube
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
Ad

Similar to OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Developers and DBAs (20)

PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
PDF
Oracle 12c New Features
PPTX
Oracle Data Redaction - EOUC
PPTX
Oracle database 12c_and_DevOps
PDF
Upgrade/Migrate to Oracle 12c: Live and Uncensored!
PDF
Using XA for Batch – Bad idea? (article)
PDF
Usability - Ignored by Developers and Undervalued by Managers (article)
PPTX
Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
DOC
RahulRanjan_5+yr_AppsDBA
PDF
[db tech showcase Tokyo 2018] #dbts2018 #B33 『DBA 18.0 - Life after 18c』
DOC
Resume of Derek
PPTX
01 Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
PDF
oracle database sql part 1.pdf
PDF
oracle-database-editions-wp-12c-1896124
PDF
plug-into-cloud-wp-12c-1896100
PPTX
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
PDF
MOUG17 Keynote: Oracle OpenWorld Major Announcements
PDF
DOC
Ashokkumar mani's cv
PPTX
A Step by Step Introduction to the MySQL Document Store
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
Oracle 12c New Features
Oracle Data Redaction - EOUC
Oracle database 12c_and_DevOps
Upgrade/Migrate to Oracle 12c: Live and Uncensored!
Using XA for Batch – Bad idea? (article)
Usability - Ignored by Developers and Undervalued by Managers (article)
Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
RahulRanjan_5+yr_AppsDBA
[db tech showcase Tokyo 2018] #dbts2018 #B33 『DBA 18.0 - Life after 18c』
Resume of Derek
01 Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
oracle database sql part 1.pdf
oracle-database-editions-wp-12c-1896124
plug-into-cloud-wp-12c-1896100
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
MOUG17 Keynote: Oracle OpenWorld Major Announcements
Ashokkumar mani's cv
A Step by Step Introduction to the MySQL Document Store
Ad

More from Alex Zaballa (20)

PDF
Migrating Oracle Databases from AWS to OCI
PPTX
Exploring All options to move your Oracle Databases to the Oracle Cloud
PPTX
Moving Your Oracle Databases To The Oracle Cloud
PPTX
SQL TUNING 101
PPTX
SQL TUNING 101
PPTX
DBA Commands and Concepts That Every Developer Should Know - Part 2
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
Oracle Database 12c - New Features for Developers and DBAs
PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PPTX
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
PPTX
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
PPT
Oracle SQL Tuning
PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PPTX
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
Oracle Data Redaction
Migrating Oracle Databases from AWS to OCI
Exploring All options to move your Oracle Databases to the Oracle Cloud
Moving Your Oracle Databases To The Oracle Cloud
SQL TUNING 101
SQL TUNING 101
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
DBA Commands and Concepts That Every Developer Should Know
Oracle Database 12c - New Features for Developers and DBAs
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle SQL Tuning
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
DBA Commands and Concepts That Every Developer Should Know
Oracle Data Redaction

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25-Week II
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf

OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Developers and DBAs