100% found this document useful (1 vote)
91 views

What To Expect in Oracle 19c

The document discusses several new performance features in Oracle 19c including automatic indexing, which automatically creates and manages indexes based on workload changes, hint usage reporting which reports on hints used and not used in SQL statements, and real-time statistics which gather statistics during DML to reduce stale statistics. It also discusses comparing SQL execution plans from different sources using the DBMS_XPLAN package.

Uploaded by

walterpotocki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
91 views

What To Expect in Oracle 19c

The document discusses several new performance features in Oracle 19c including automatic indexing, which automatically creates and manages indexes based on workload changes, hint usage reporting which reports on hints used and not used in SQL statements, and real-time statistics which gather statistics during DML to reduce stale statistics. It also discusses comparing SQL execution plans from different sources using the DBMS_XPLAN package.

Uploaded by

walterpotocki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

What to Expect in Oracle 19c

Performance Related
Enhancements
John Mullins
[email protected]
www.themisinc.com
www.themisinc.com/webinars
Presenter
◼ John Mullins
◼ Themis Inc. ([email protected])
◼ 34+ years of Oracle experience

◼ Oracle Certified Professional DBA

◼ Certified Technical Trainer

◼ Over 375 classes taught


Themis Inc.
◼ More than 27 years in the industry
◼ Courses:
◼ DB2, SQL Server, Oracle, Unix, Linux, Java, Web
Development, .NET, Python, PostgreSQL and many
more
◼ www.themisinc.com
◼ www.themisinc.com/webinars
Related Themis Courses
◼ Oracle 19c New Features for Developers
◼ Oracle 19c New Features for Administrators
◼ Introduction to SQL, Introduction to PL/SQL
◼ Advanced Oracle SQL, Advanced PL/SQL
◼ Oracle SQL Optimization for Developers and
DBAs
◼ Oracle Database Administration
Webinar Objectives
◼ To understand the options and capabilities of
some of the Oracle 19c performance related
new features
Webinar Notes
◼ Some of the following features are for
Enterprise Edition (EE) Exadata systems only.
◼ Also, some may only be available in a cloud
environment running (EE) Exadata.
◼ In a non-Exadata 19c (EE) system the following
steps were issued to test some of the features:
◼ ALTER SYSTEM set
"_exadata_feature_on"=TRUE scope=spfile;
◼ Followed by an instance shutdown/startup
Automatic Indexing
◼ Automatically creates, rebuilds, and drops
indexes in a database based on the changes in
application workload.
◼ Process runs in the background every 15
minutes.
◼ Tables with stale statistics are not considered for
auto indexing.
◼ Exadata Only. Check for availability on other
licenses.
Automatic Indexing
◼ Creates invisible auto indexes for the auto index
candidates.
◼ The invisible auto indexes are validated against
SQL statements.
◼ If the performance of SQL statements is improved
by using these indexes, then the indexes are
configured as visible indexes.
Automatic Indexing
◼ If the performance of SQL statements is not
improved by using these indexes:
◼ The indexes are configured as unusable indexes.
◼ The unusable indexes are later deleted by the
automatic indexing process.
◼ By default, the unused auto indexes are deleted after 373
days.
Configuring Automatic Indexing
◼ DBMS_AUTO_INDEX Package.
◼ CONFIGURE procedure.
◼ Some Settings:
◼ Enable automatic indexing in a database and create
any new auto indexes as visible.
◼ 'AUTO_INDEX_MODE','IMPLEMENT‘
◼ Enable automatic indexing in a database, but create
any new auto indexes as invisible indexes.
◼ 'AUTO_INDEX_MODE','REPORT ONLY‘
Configuring Automatic Indexing
◼ Additional Settings:
◼ Disable automatic indexing in a database.
◼ 'AUTO_INDEX_MODE','OFF'
◼ Add the SCOTT schema to the exclusion list.
◼ 'AUTO_INDEX_SCHEMA', ‘SCOTT', FALSE
◼ Set the retention period for unused auto indexes to
90 days. Default is 373 days.
◼ 'AUTO_INDEX_RETENTION_FOR_AUTO', '90‘
Configuring Automatic Indexing
◼ Additional Settings:
◼ Set the tablespace of TBS_AUTO_INDEX to store
auto indexes.
◼ 'AUTO_INDEX_DEFAULT_TABLESPACE',
'TBS_AUTO_INDEX‘
Automatic Indexing Reports
◼ DBMS_AUTO_INDEX Package
◼ REPORT_ACTIVITY Function
◼ Text or HTML Report
◼ REPORT_LAST_ACTIVITY Function
◼ Text or HTML Report
Automatic Indexing Views
◼ DBA_AUTO_INDEX_CONFIG
◼ DBA_INDEXES (AUTO Column – Yes/No)
◼ ALL_INDEXES (AUTO Column – Yes/No)
◼ USER_INDEXES (AUTO Column – Yes/No)
◼ DBA_AUTO_INDEX_EXECUTIONS
◼ DBA_AUTO_INDEX_STATISTICS
Hint Usage Reporting
◼ Enabled by default.
◼ Reports on hint usage, used and not used (and
why not).
◼ Hint Usage Reminder.

SELECT /*+ FULL(dept) */


dname
FROM dept
WHERE deptno = 10;
Hint Usage Reporting
◼ Getting the report.
◼ The dbms_xplan package.
◼ SELECT * FROM
dbms_xplan.display_cursor('0x7tz96cy3ba0',
format=>'+HINT_REPORT');
◼ +HINT_REPORT_USED to show used hints
◼ +HINT_REPORT_UNUSED to show unresolved and syntax
errors
◼ +HINT_REPORT combines both of them
Hint Usage Reporting
◼ Getting the report.
◼ SELECT * FROM
dbms_xplan.display_cursor(format=>'-cost');
◼ set AUTOTRACE ON
Hint Usage Reporting
◼ Output Example 1:

Hint Report (identified by operation id / Query Block Name /
Object Alias):
Total hints for statement: 1 (U - Unused (1))
---------------------------------------------------------------------------
5 - SEL$1 / D@SEL$1
U - USE_NL(d e)
Hint Usage Reporting
◼ Output Example 2:

Hint Report (identified by operation id / Query Block Name /
Object Alias):
Total hints for statement: 1
---------------------------------------------------------------------------
1 - SEL$1 / DEPT@SEL$1
- FULL(dept)
Hint Usage Reporting
◼ Output Example 3:

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 3 (N - Unresolved (1), E - Syntax error (1))
---------------------------------------------------------------------
1 - SEL$1
N - INDEX(IX1)
E - HINT2

1 - SEL$1 / DUAL@SEL$1
- FULL(EMP)
Hint Usage Reporting
◼ Output Example 4:

Hint Report (identified by operation id / Query Block Name /
Object Alias):
Total hints for statement: 1 (E - Syntax error (1))
---------------------------------------------------------------------------
1 - SEL$1
E - USE_NL
Hint Usage Reporting
◼ Output Example 5:

Hint Report (identified by operation id / Query Block Name /
Object Alias):
Total hints for statement: 1 (E - Syntax error (1))
---------------------------------------------------------------------------
1 - SEL$1
E - HINT1
Hint Usage Reporting
◼ Output Example 6:

Hint Report (identified by operation id / Query Block Name /
Object Alias):
Total hints for statement: 2 (N - Unresolved (2))
---------------------------------------------------------------------------
1 - SEL$1
N - FULL(dept)
N - INDEX(emp emp_deptno_ix)
Real Time Statistics
◼ Automatically gathers real-time statistics during
conventional DML operations.
◼ Reduces the possibility of the optimizer being
misled by stale statistics.
◼ Oracle Database 12c introduced online statistics
gathering for CREATE TABLE AS SELECT
statements (Bulk) and direct-path inserts.
◼ Exadata only. Check for availability on other
licenses.
Real Time Statistics
◼ Real-time statistics augment rather than replace
traditional statistics.
◼ Computes values for the most essential statistics.
◼ Manage and access real-time statistics through
PL/SQL packages, data dictionary views, and
hints.
◼ ALL_TAB_STATISTICS View
◼ NOTES Column -
STATS_ON_CONVENTIONAL_DML value
High Frequency
Statistics Gathering
◼ A task periodically gathers statistics for stale
objects.
◼ The default interval is 15 minutes.
◼ Exadata only. Check for availability on other
licenses.
SQL Execution Plan Comparison
◼ Compare a reference plan with some other
execution plan.
◼ Plan can come from memory, AWR History or a
SQL Tuning Set.
◼ DBMS_XPLAN Package.
◼ COMPARE_PLAN Function.
◼ Report in XML, HTML or Text Format.
SQL Execution Plan Comparison
◼ Usage Example:
◼ SQL Statements are executed.

SELECT /*+ FULL(dept) */


dname
FROM dept
WHERE deptno = 10;

SELECT
dname
FROM dept
WHERE deptno = 10;
SQL Execution Plan Comparison
◼ Get SQL_IDs of statements to compare.
◼ This can come from various sources.
◼ Explain Plan Output.
◼ Memory, Shared Pool. V$SQL for example.
SQL Execution Plan Comparison
◼ Execute COMPARE_PLANS function.
◼ SQL*Plus Example:
VARIABLE v_rep CLOB

BEGIN
:v_rep := DBMS_XPLAN.COMPARE_PLANS(
reference_plan => cursor_cache_object('4nxuq3ffxd5z8', NULL),
compare_plan_list => plan_object_list(cursor_cache_object('adcc8k75cdsxh', NULL)),
type => 'TEXT',
level => 'TYPICAL',
section => 'ALL');
END;
SQL Execution Plan Comparison
◼ View Results.
◼ SQL*Plus Example:

SET PAGESIZE 50000


SET LONG 100000
SET LINESIZE 210
COLUMN report FORMAT a200

SELECT :v_rep REPORT FROM DUAL;


SQL Execution Plan Comparison
◼ Report Output.
REPORT
---------------------------------------

COMPARE PLANS REPORT


---------------------------------------
Current user : STUDENT
Total number of plans : 2
Number of findings : 2
---------------------------------------
SQL Execution Plan Comparison
◼ Report Output (continued).
COMPARISON DETAILS
--------------------------------------------------------------------
Plan Number : 1 (Reference Plan)
Plan Found : Yes
Plan Source : Cursor Cache
SQL ID : 4nxuq3ffxd5z8
Child Number : 0
Plan Database Version : 19.0.0.0
Parsing Schema : "STUDENT"
SQL Text : SELECT dname FROM dept WHERE deptno = 10
SQL Execution Plan Comparison
◼ Report Output (continued).
--------------------------------------------------------------------------
Plan Number : 2
Plan Found : Yes
Plan Source : Cursor Cache
SQL ID : adcc8k75cdsxh
Child Number : 0
Plan Database Version : 19.0.0.0
Parsing Schema : "STUDENT"
SQL Text : SELECT /*+ FULL(dept) */ dname FROM dept
WHERE deptno = 10
SQL Execution Plan Comparison
◼ Both Explain Plan outputs will be displayed
followed by a Comparison Results section.

Comparison Results (2):


-----------------------------
1. Query block SEL$1, Alias "DEPT"@"SEL$1": Some lines (id:
2) in the reference plan are missing in the current plan.
2. Query block SEL$1, Alias "DEPT"@"SEL$1": Some columns
(OPTIONS) do not match between the reference plan (id: 1) and
the current plan (id: 1).
SQL Quarantine
◼ If a particular SQL statement exceeds a
specified resource limit (set via Oracle Resource
Manager), then the Resource Manager
terminates the execution of that statement and
“quarantines” the plan.
◼ DBMS_SQLQ Package.
◼ Exadata Only. Check for availability on other
licenses.
Automatic
SQL Plan Management
◼ Uses SQL Plan Baselines.
◼ Identifies SQL statements that consume
significant system resources.
◼ Identifies the best plans from the alternatives it
discovers and prevents the sub-optimal plans
from being chosen.
◼ Exadata Only. Check for availability on other
licenses.
Automatic
SQL Plan Management
◼ Enabled by setting parameter(s) to AUTO
◼ ALTERNATE_PLAN_BASELINE
◼ Not available on all platforms.
◼ ALTERNATE_PLAN_SOURCE
◼ Available on all platforms.
◼ The parameters above were first introduced in
Oracle Database 12c Release 2. The implementation
for identifying alternative plans was enhanced in
Oracle 18c and Oracle 19c.
Summary
◼ Oracle 19c offers some new features regarding
database performance. Some of the these new
features are initially only available on solutions
such as Exadata. It is still important to be aware
of these new features in the event licensing
should change in future releases or versions.
◼ Check your licensing features
Upcoming Classes
◼ Check www.themisinc.com under the Courses
tab for course outlines and check the current
public schedule under the Schedule tab.
◼ If you do not see a course or topic you need
contact:
◼ John Caccavale
[email protected]
Upcoming Webinars
◼ Mainframe Modernization Overview
◼ Thursday, January 23, 2020
◼ 11:30 AM - 12:30 PM EST
For More Information
◼ Visit the Themis web site www.themisinc.com
◼ John Caccavale
[email protected]
◼ To get a copy of the presentation:
◼ http://www.themisinc.com/webinars
◼ Thank you for attending. Have a good day.

You might also like