Download presentation
Presentation is loading. Please wait.
Published byЯна Старжинская Modified over 5 years ago
1
Oracle 12c, 18c, Now 19c! OH MY! What are the Changes?
Welcome Oracle 12c, 18c, Now 19c! OH MY! What are the Changes? Janis Griffin Senior Sales Engineer
2
Who Am I 11/18/2019 Senior Sales Engineer / DBA
Twitter® Current – 30+ Years in Oracle®, DB2®, ASE, SQL Server®, MySQL® DBA and Developer Specialize in Performance Tuning Review Database Performance for Customers Common Question – How do I tune it?
3
Agenda Oracle 12 Release Family – 12c, 18c, & 19c What’s changed?
Overview of releases What’s changed? Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements In-Memory Column Store Option New Partitioning Features Sharding Capabilities
4
Oracle 12 Release Family Releases & Dates 12.1.0.1 12.1.0.2 12.2.0.1
July 2013 July 2014 September 2016 (cloud) March 2017 (on-prem) 18.1.0 February 2018 (cloud) Oracle announces yearly releases – changing version to include year 18.3.0 July 2018 (on-prem) 19c GA in 2019 Q2 Expected to be final release of Oracle 12 family
5
Multitenant Architecture
12.1 Oracle’s first major architectural change since v6 Changed from non-container databases to container database (CDB) Root database which holds Oracle’s metadata Contains multiple pluggable databases (PDB) Up to 253 including the seed database Remote copy of PDB – source PDB had to be read only 12.2 Allowed for 4096 PDBs per CDB Can create hot clone of PDB via command line Requires local undo Undo can now exist in PDB Can create refreshable PDB (for VLDBs) Had to stay in read only mode Can relocate PDBs to different CDBs online Can help maintain SLAs for performance and availability
6
Multitenant Architecture
© 2016 SOLARWINDS WORLDWIDE, LLC. ALL RIGHTS RESERVED.
7
Multitenant Architecture
12.2 – cont. Can set INMEMORY_SIZE at each PDB Can flashback a single PDB FLASHBACK PLUGGABLE DATABASE pdb1 TO TIMESTAMP some_date; Data Guard now supports individual PDB-level failover Can set parameter ENABLED_PDBS_ON_STANDBY on standby database Examples – ‘*’, ‘PDB?’, ‘PDB*’, ‘-PDB1’ 18c – AKA DBCA can clone local PDB (plugged) Silent example: shell>./dbca –silent –createpluggabledatabase –sourcedb cdb1 – shell> createpdbfrom pdb1 –pdbName pdb1_clone –sourcepdb pdb1 Refreshable PDB switchover allows replicas to go from read-only to read-write
8
Refreshable PDB 12.2 18c
9
Multitenant Architecture
18c – cont. Further integration with Data Guard Snapshot Carousel Can maintain 8 point-in-time snapshots CDB Fleet Is a group of CDBs that can be managed from 1 lead CDB Simplifies management
10
18c Snapshot Carousel & CDB Fleet
11
Multitenant Architecture
19c is the Long Term Support version Primary support to 2023, extended to 2026 Future features Main focus is on bug fixes & stability Trying to deprecate non-CDB databases in next (20c) release Should allow for Real Application Testing (RAT) and Automatic Database Diagnostic Monitor (ADDM) at PDB level
12
Agenda Oracle 12 Release Family – 12c, 18c & 19c What’s changed?
Overview of releases What’s changed? Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements In-Memory Column Store Option New Partitioning Features Sharding Capabilities
13
SQL, Dictionary, and Optimizer Enhancements
12.1 FETCH FIRST n ROWS ONLY Retrieves first rows without scanning everything OFFSET n ROWS FETCH FIRST n ROWS ONLY Skip some number of rows
14
New SQL – Cont. 12.2 Approximate Query Processing
Used for approximate ‘count distinct’ values and adds percentile aggregation Allows for faster processing of large data sets Not exact but usually within 95%+ range Three new parameters – alter system/session approx_for_aggregation - Default=FALSE Can be overridden by the next 2 parameters If true, sets approx_for_percentile=ALL approx_for_count_distinct - Default=FALSE Overrides exact COUNT DISTINCT clause approx_for_percentile - Default=NONE Overrides MEDIAN clause (PERCENTILE_CONT) Values can be PERCENTILE_CONT, PERCENTILE_DISC, and ALL Can be used without any changes to existing code
15
New SQL Functions 12c Approximate Query Functions – cont.
APPROX_COUNT_DISTINCT (Introduced in 12.1) APPROX_COUNT_DISTINCT_DETAIL APPROX_COUNT_DISTINCT_AGG TO_APPROX_COUNT_DISTINCT APPROX_MEDIAN APPROX_PERCENTILE APPROX_PERCENTILE_DETAIL APPROX_PERCENTILE_AGG TO_APPROX_PERCENTILE Support for Materialized Views and Query Rewrite VALIDATE_CONVERSION Simplifies coding for input validation
16
12c Approximate SQL Example
95% accurate
17
Using 12c Approximate Without Code Change
Why is it still exact? Need to set both
18
12c Approximate Percentile – No Code Change
99.68% accurate
19
New SQL Functions 18c Approximate Top-n Query Processing APPROX_RANK
Must be used in conjunction with APPROX_SUM or APPROX_COUNT Can’t get bottom-n queries Requires ORDER BY DESC clause APPROX_SUM APPROX_COUNT Complete list - Aggregate Functions New DBMS_SLEEP function suspends session for ‘n’ number of seconds Needs no extra privileges Replaces DBMS_LOCK
20
18c New SQL Functions Examples
Approximate Sum/Rank Actual
21
Dictionary Improvements
Object identifiers have increased from 30 bytes to 128 bytes Such as users, roles, tables, columns, indexes, constraints, etc… May affect your metadata reporting if report not formatted Exceptions: Disk groups, pluggable databases (PDBs), rollback segments, and tablespaces Still 30 bytes Names of databases are still limited to 8 bytes 18c New SHARDS() clause on dictionary tables Can be used to query across all shards Ability to encrypt credential data instead of obfuscate SYS.LINK$ and SYS.SCHEDULER$_CREDENTIAL ALTER DATABASE DICTIONARY 19C More Data Dictionary encryption capabilities SELECT ora_shard_id, count(*) FROM shards(v$sql) GROUP BY ora_shard_id;
22
SQLPLUS Improvements 12c HISTORY SET STATEMENTC[ACHE] {0 | n}
SET HIST[ORY] {ON | OFF | n} SET STATEMENTC[ACHE] {0 | n} SET FEEDBACK ONLY Instead of just [ON | OFF] Sqlplus Sets ARRAYSIZE 100, LOBPREFETCH 16384, PAGESIZE 50000, ROWPREFETCH 2, STATEMENTCACHE 20 Make its run faster Can create CSV format SET MARK CSV ON [DELIMI{TER} character] [QUOTE {ON|OFF}]
23
SQLPLUS Improvements 18c 19c SET LINESIZE WINDOW
SET FEEDBACK ON SQL_ID SET ROWLIMIT n 19c EZConnect Improvements Accepts list of name value pairs sqlplus transport connect_timeout=30&retry_count=4
24
Optimizer Changes 12c – New Adaptive Optimizer
New init.ora parameters (12.2) OPTIMIZER_ADAPTIVE_PLANS (Default = TRUE) OPTIMIZER_ADAPTIVE_STATISTICS (Default = False) Obsolete – OPTMIZER_ADAPTIVE_FEATURES Used in 12.1 New DBMS_STATS preference AUTO_STAT_EXTENTIONS Default is OFF Optimizer_dynamic_sampling New Level 11 (Auto) New optimizer statistics advisor
25
Optimizer Changes 18c – Autonomous Database Oracle’s cloud offering
Specialized by 2 different workloads ADW Data mart Data lake Machine learning Optimizations Columnar format Create data summaries Parallel joins and aggregations Statistics updated in real-time – prevents plan regressions ATP OLTP/Batch Reporting Application development IoT Machine learning Row format Data caching to avoid I/O
26
18c Autonomous Database Benefits
Spend less time Eliminate tedious manual database management tasks Automation reduces errors Spend less $$$ Oracle claims to cut runtime costs up to 90% With pay-per-use and ultra-efficiency Develop new applications faster With instant database provisioning and self-tuning Ensure data safety Continuous online updates to product against cyber-attacks Fault-tolerant solution – including maintenance
27
18c Scalable Sequences & Private Temporary Tables
In order to solve contention in RAC environments Sequences can be scalable by adding extra numbers Extra 6 digits = 3 instance number offset + 3 session number offset Scale = 6 digits + normal sequence number Extend = 6 digit + max value Private temporary tables Stored in memory and only visible to session Dropped after session or transaction Tables must be prefixed with ORA$PTT_ Controlled by parameter PRIVATE_TEMP_TABLE_PREFIX create private temporary table ORA$PTT_tmp_table (id number, desc varchar2(30)) on commit drop definition; OR on commit preserve definition;
28
18c Automatic Fixes For Runaway SQL Statements
Manage runaway sql statements on ATP using the Service Console Controlled by resource manager via rules Select Consumer group: TPURGENT, TP, HIGH, MEDIUM, or LOW Set runaway criteria values Query run time (seconds) Amount of I/O (MB) Can use procedure cs_resource_manager.update_plan_directive If consumer runs more than time or I/O specified SQL statement is killed BEGIN cs_resource_manager.update_plan_directive(consumer_group => 'HIGH', io_megabytes_limit => 1000, elapsed_time_limit => 120); END; /
29
Optimizer Changes 19c Automatic Indexing
Implements indexes based expert index tuning knowledge Without DBA involvement Except for DBA can set preferences View report of indexes and their impact on the application Works incrementally So needs to be iterative and continuous Automatic indexes are validated Then adapt to changes in schema, data and application
30
19c Automatic Indexing High Level Steps
No DBA interaction All tuning activities Auditable via reporting Verify Identify Decide Capture Monitor Online Validation
31
19c Automatic Indexing – How It Works
Capture Captures the application SQL history into a SQL repository Includes SQL, plans, bind values, execution statistics, etc. Identify Candidate Indexes That may help the newly captured SQL statements Creates indexes as unusable invisible indexes Metadata only Drops indexes obsoleted by newly created indexes (logical merge) Verify Ask optimizer if index candidates will be used for captured SQL statements Materialize indexes and run SQL to validate that performance improved All verification is done outside application workflow Verify Identify Decide Capture Monitor Online Validation
32
19c Automatic Indexing – How It Works
Decide If performance is better for all statements, indexes are marked visible If performance worse for all statements, indexes remain invisible If performance worse for some statements Indexes are marked visible except for SQL statements that regressed Online Validation Validation of new indexes continues for other statements online Only one of the sessions executing a SQL statement is allowed to use the new indexes Monitor Index usage is continuously monitored Automatically created indexes will be dropped if not used in a long time Verify Identify Decide Capture Monitor Online Validation
33
19c Automatic Indexing Benefits
Great for OLTP, OLAP, mixed workloads but critical for OLTP Applies to tuned and un-tuned applications If tuned Existing secondary indexes may be outdated Important indexes are missing Some secondary indexes can be dropped and auto indexes can be added If un-tuned Existing indexes support primary and unique key constraints Can be used in all stages of application lifecycle Support single and concatenated indexes Function-based indexes Compression advanced low Verify Identify Decide Capture Monitor Online Validation
34
19c Automatic Indexing Automatic indexing defaults to run in same database as application Indexing task consumes CPU, memory and storage Resource manager plan limits task to 1 CPU DBA can control Which temp tablespace is used to build indexes Which tablespace and how much space can be used by auto indexing Production Database CPU Task Memory Build Storage Store
35
19c DBMS_AUTO_INDEX Controls Auto Indexing
Automatic indexing parameters AUTO_INDEX_EXCLUDE_SCHEMA Holds schema names(s) to be exclude from auto indexing Default is all tables in all user created schemas AUTO_INDEX_RETENTION_FOR_AUTO Number of days (default 373) auto indexes retained after last used date AUTO_INDEX_RETENTION_FOR_MANUAL Number of days (default NULL) manual indexes retained after last used date AUTO_INDEX_DEFAULT_TABLESPACE Tablespace name where auto indexes will be stored (user default tablespace) AUTO_INDEX_MODE Put automatic indexing into reporting mode (default=implement) Indexes are created, tested, and a report shows the impact without affecting the app
36
19c Automatic Indexing Views
DBA_AUTO_INDEX_EXECUTIONS Shows history of automatic indexing tasks executions DBA_AUTO_INDEX_STATISTICS Shows statistics related to automatic indexes DBA_AUTO_INDEX_IND_ACTIONS Shows actions performed on automatic indexes DBA_AUTO_INDEX_SQL_ACTIONS Shows actions performed on SQL to verify automatic indexes DBA_AUTO_INDEX_CONFIG Shows history of configuration settings related to automatic indexes
37
19c Automatic Indexing Reporting & Hints
Each auto index task generates a report Reports can be generated via DBMS_AUTO_INDEX.REPORT_ACTIVITY function Date/Time range Format (XML, HTML, Text) Level (basic, typical, all) Section Summary, Index Details, Verification Details, Errors, All Test_Drive_Auto_Index_Creation Use hints to control auto indexes /*+ USE_AUTO_INDEXES */ /*+ NO_USE_AUTO_INDEXES */
38
19c Statistics Management & DBMS_XPLAN
Historically, statistics gathering could cause issues If performed daily, they could become too stale If dynamic, they may cause too much parsing (CPU) activity High frequency automatic statistics task Some gathering is done during the day when system is idle Controlled by Resource Manager Real-time statistics Some statistics such as high/low values are maintained during DML DBMS_XPLAN Reports hint usage (18c) Per operation and alias name Shows hints that were not used and why Improved compare plans (19c)
39
Agenda Oracle 12 Release Family – 12c, 18,c & 19c What’s changed?
Overview of releases What’s changed? Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements In-Memory Column Store Option New Partitioning Features Sharding Capabilities
40
12c In-Memory Option Transactions in Buffer Cache
Analytics in In-Memory Column Store
41
IM – Why Use it? Access only the column data needed
Can prioritize when IM is populated Partially load some columns at startup Load other columns when accessed ALTER TABLE customers INMEMORY PRIORITY CRITICAL; In compressed format Saves space Can scan or filter compressed data Only decompressed when used in the result set CREATE TABLE test (c1 NUMBER, c2 NUMBER, c3 CLOB) INMEMORY MEMCOMPRESS FOR QUERY NO INMEMORY(c3), INMEMORY MEMCOMPRESS FOR CAPACITY HIGH (c2); DBMS_COMPRESSION (advisor) Now supports IM compression
42
IM – Why So Fast IM is made up of multiple In-Memory Compression Units (IMCUs) Background worker processes allocate their own IMCUs Works with the IMCO (In-Memory Coordinator) background process Uses SIMD Vector processing Definition: Single Instruction processing Multiple Data values Allows a set of column values to be evaluated simultaneously in one CPU instruction Look at V$STATNAME ‘IM scan CUs columns accessed’, 'IM scan segments minmax eligible', 'IM scan CUs pruned'); New in 12.2 – IM FastStart Allows for checkpoint of IMCUs to FastStart area on disk Takes up storage space but less CPU intensive on startup Best for queries that scan large amounts of data or compute values on the fly BEGIN dbms_inmemory_admin.faststart_enable('FS_TBS'); END;
43
*IM – Why So Fast IM Storage Indexes
Automatically created and maintained on each column in the column store Allows pruning to occur based on filter predicates in the query Keeps track of min/max values for each column in an IMCU Helps to avoid scans of IM column store New in In-Memory Expressions Materialize commonly used expressions Prevents re-computation for every row Are derived values that take advantage of IM Expression Statistics Store(ESS) automatically stores top 20 popular expressions Manage with DBMS_INMEMORY_ADMIN package Set with INMEMORY_EXPRESSIONS_USAGE parameter In-Memory Virtual Columns Needs INMEMORY_VIRTUAL_COLUMNS parameter set to ENABLED or MANUAL
44
IM - How To Use It IM column store is disabled by default (requires restart) Set INMEMORY_SIZE parameter to enable Needs to be set to 100mb or higher New in Can increase on the fly at 128mb or higher Part of SGA - may need to increase SGA_TARGET / MEMORY_TARGET
45
IM – How To Use It Objects must have the INMEMORY attribute to use the IM column store Can be tablespace, table, (sub)partition or materialized view To view objects in column store – see V$IM_SEGMENTS, V$IM_COLUMN_LEVEL, any V$IM% views
46
IM Performance No IM
47
*IM Virtual Columns Example – New 12.2 Feature
alter system set inmemory_virtual_columns = ENABLE;
48
*IM Joins In-Memory Joins Bloom Filters (10g)
Transforms join into a filter if there are filtering predicates Can be used in column format via SIMD vector processing New in 12.2 – Join Groups Can be used when there are no filtering predicates Allow join columns from multiple tables to share a single compression dictionary Hash joins don’t have to decompress the data first View join groups in USER_JOINGROUPS View shared dictionary in v$IM_SEGDICT CREATE INMEMORY JOIN GROUP jgroup_name(order_item(ol_i_id),item(i_id));
49
*IM Join Group Example – Cont.
SELECT ol_o_id,ol_number, ol_delivery_d, i_name, i_price FROM order_item, item WHERE ol_i_id = i_id and i_price < 2.00; Join Groups share the same compression dictionary This allows for joins to occur on compressed values Doesn’t need to decompress and hash the data Join columns above are order_item.ol_i_id and item.i_id Tables need to be reloaded after the Join Group creation To create the common compression dictionary, called Global Dictionary Ensure the Global Dictionary exists by checking V$IM_SEGDICT_GD SELECT o.object_name table_name, c.column_name column_name, gd.head_address "GD Address" FROM user_objects o, user_tab_columns c, v$im_segdict gd WHERE gd.objn = o.object_id AND o.object_name = c.table_name AND gd.column_number = c.column_id;
50
*IM Join Group Example – New 12.2 Feature
Using Bloom Filter / Join Group? No IM
51
*IM Join Group Example Finding join group usage
Need to use SQL_MONITOR - dbms_sqltune.report_sql_monitor_xml or OEM Query needs ‘SELECT /*+ MONITOR */’ hint Columnar encodings leveraged = 1 Columnar Encodings Leveraged
52
18c IM New Features Dynamic capture window for IM expressions
Prior releases could specify last 24 hours or since database creation Now can specify flexible / dynamic intervals Allows change for different workloads Automatic IM management New parameter: inmemory_automatic_level Uses heat map data, column stats and other stats to manage IM objects Evicts inactive segments if frequently accessed segments would benefit Prior releases: difficult to know which segment would benefit While Memory Advisor is helpful, actual usage is best
53
18c IM New Features IM Support for external tables (100x faster)
Great feature for analytical queries on external data stores. Avoids unnecessary access to external storage LOBs can now be used with IM Increases LOB performance IM optimized arithmetic New IM format for numbers (40x faster) IM dynamic scans (2x faster) Enable dynamic parallel execution of IM table scans Prior releases used traditional parallel execution Now dynamic scans adjust according to CPU utilization Parallelize operations with and across IMCUs
54
18c IM New Features Memoptimized rowstore 19c IM Features
Fast lookup for tables queried often by primary key Internet of Things (IoT) New area in SGA = MEMOPTIMIZE_POOL_SIZE Create or alter table with ‘memoptimize for read’ clause Requires NOT DEFERRABLE PRIMARY KEY constraint 19c IM Features Faster ingest support for IoT To stream data continuously to database Inserts buffered in memory Written asynchronously with bulk inserts Database_In_Memory-P.pdf
55
Agenda Oracle 12 Release Family – 12c, 18,c & 19c What’s changed?
Overview of releases What’s changed? Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements In-Memory Column Store Option New Partitioning Features Sharding Capabilities
56
12.2 Partitioning Features
Read-only partitions Useful for old partitions Use READ ONLY READ WRITE (default) Can use CTAS or ALTER Alter table move partition Online Alter table split partition
57
12.2 Partitioning Features
Convert Non-partitioned table To a partitioned table ONLINE UPDATE INDEXES clause is optional. Indexes with SYS names will be generated if not used.
58
12.2 Partitioning Features
Automatic List Partitions Requires creation of first partition No default partitions Multi-column List Partitions Can have only one default partition
59
18c Partitioning Features
Online merging of partitions / subpartitions More online modify partition features 19c Partitioned hybrid tables Can have different partiton types – Heap or External Roadmap-Praesentation.pdf
60
Agenda Oracle 12 Release Family – 12c, 18,c & 19c What’s changed?
Overview of releases What’s changed? Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements In-Memory Column Store Option New Partitioning Features Sharding Capabilities
61
12.2 Sharding Feature Sharding horizontally partitions data across independent databases A ‘share nothing’ architecture – CPU, memory, disk Each database is known as a shard All shards together make up a logical database Called sharded database (SDB) System-managed or composite sharding methods Intended for custom OLTP applications that: Have a well-defined data model Have a data distribution strategy (consistent hash, range, list, or composite) Primarily access data using a sharding key e.g., customer_id, account_no, or country_id
62
12.2 Sharding Feature Benefits of Sharding Companies Examples
Linear scalability for performance and capacity Eliminates single points of failure Nothing is shared Geographical distribution of data Data is closer to consumers (e.g. Facebook) Satisfies regulatory requirements Simplifies Cloud Deployment Easy to do rolling upgrades Companies Examples Online payment systems Regulatory requirements Airline ticketing systems Social media companies
63
SDB Components Shard Catalog Shard Directors Global service
An Oracle database that centralizes management of a SDB Supports automated shard deployment Handles multi-shard queries Holds master copy of duplicated table Shard Directors Network listeners which route connections based on a sharding key Connection pools can act as shard directors for pooled connections Global service An extension of database services for the SDB Management Interfaces GDSCTL (command-line utility) and OEM
64
SDB Architecture To install, download Oracle Database 18c (18.3) for Linux(18.3) for Linux: linux.x64_180000_db_home.zip Oracle Database 18c Global Service Manager (GSM/GDS) : linuxx64_12201_gsm.zip
65
18c Sharding Features User-defined Sharding RAC Sharding
Allows partitioning by RANGE or LIST User can explicitly map data to specific shards Has full control on moving data between shards RAC Sharding Logically enables affinitized table partitions to RAC instances Reduces block pings across instances Yields better cache affinity Gives the performance and scalability of a sharded database To enable Alter system enable affinity <tablename>; No changes to database schema are required No need to deploy sharding infrastructure
66
18c Sharding Features Midtier Sharding
oraclesharding-whitepaper pdf Midtier Sharding Ability to affinitize midtiers with shards Eliminates requirement of each connection pool Having to connecting to all shards 18c has ‘swim lanes’ Application tier and web tier are sharded as well Oracle provides a topology server with REST API Provides better fault tolerance, scalability and reduce connections
67
19c Sharding Features Support multiple PDB-Shards in same CDB
Can co-exist with other non-sharded PDBs Benefits are consolidation of shards, manage many as one, upgrades, etc. Scale-out multi-shard query coordinators Can configure shard catalog's ADG standbys To act as multi-shard query coordinators Great for analytic workloads that need to query multiple shards Multiple Table Families Allows sharded database to support multiple table families, Each can be sharded with a different sharding key Generation of globally unique sequence numbers across shards For non -primary key columns (e.g. order_id)
68
How to Test 19c Oracle Live SQL Livesql.oracle.com
Can save scripts and share Available code library Available sample schemas
69
Summary Oracle 12c family – first major architectural release since Oracle 6 Many new changes to 12c, 18c – now 19c New Multitenant Architecture SQL, Dictionary, and Optimizer Enhancements Adaptable optimizer Automatic indexing In-Memory Column Store Option Must faster for analytical queries New Partitioning Features Many robust online features Sharding Capabilities The global database that’s highly available and scalable
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.