Upload
pini-dibask
View
9.407
Download
2
Embed Size (px)
Citation preview
Session ID:
Prepared by:
Best New Features of Oracle Database 12c
1695
@pini_dibask
Pini Dibask,Oracle Domain Expert, Dell Software Group, R&D
2
Pini Dibask, Oracle Domain Expert, Dell Software R&D
Senior Oracle DBA with 10 years of experience
Oracle Certified Professional DBA (OCP)
Blogger: OracleDBPro.BlogSpot.com
Email: [email protected]
LinkedIn: http://Linkedin.com/in/pinidibask
Google+: https://Plus.Google.com/+PiniDibask87
Twitter: @pini_dibask
About Me …
Agenda
Agenda
Oracle 12c introduced more than 500 new features!
This presentation reviews top features (from my perspective …)
Identity Columns
Privilege Analysis
SQL*LoaderExpressMode
UnifiedAuditing
PGA SizeLimit
FlexASM
TemporaryUndo
Online File Move
Operation
Adaptive Execution
Plans
Data Redaction
Information Lifecycle
Management
In-Database Archiving
Enhanced Statistics
InvisibleColumns SQLCL
RMAN EnhancementsAutomatic
DataOptimization
Table Point In-Time
Recovery
Running PL/SQL from
SQL
Partitioning Enhancements
Transaction Guard
Enterprise ManagerExpress
Data Guard Enhancements
Extended Data Types
In Database Archiving
ImprovedSyntax for Top-N
Queries
Improved Defaults
MultipleIndexes on the same column
Multitenant Architecture
OracleDatabase
In-Memory
Multitenant Architecture
6
Database Consolidation - Prior to Oracle 12c
Server Consolidation
Multiple databases reside on a single server
ERPMemory
BackgroundProcesses
DatabaseFiles
CRMMemory
BackgroundProcesses
DatabaseFiles
DWMemory
BackgroundProcesses
DatabaseFiles
7
Database Consolidation - Prior to Oracle 12c
Schema Consolidation
Single database with multiple schemas
8
Schema Consolidation - Challenges
Name Collisions
Same schema name or same public synonym name
Security
DBA can access data of both applications
Upgrades
You cannot patch/upgrade only one schema
Point-In-Time Recovery
Impossible to perform schema level point-in-time recovery
9
Database to Instance Relationship
Version < 12c
1:1 - One Database:One Instance
1:N - One Database:Many Instances
Version = 12c (Multitenant)
N:1 - Many Databases:One Instance
N:N - Many Databases:Many Instances
10
Oracle 12c - Multitenant Architecture
Multitenant Container DatabaseROOT
HCM12.1
DW12.1
CRM12.1
ERP12.1
Pluggable Databases (PDBs)
PDBs
Root
CDB
Pluggable Database
Self-contained Oracle database
Root Container
Oracle-supplied metadata
11
One set of background processes
One SGA
One root container
Multiple Pluggable Databases
Up to 252 PDBs
Oracle 12c - Multitenant Architecture
Multitenant Architecture cont’d
12
Pluggable Databases share the following files:
Undo Tablespace
Redo Logs
Control Files
(S)Pfile
Temporary tablespace
Note: PDBs may create their own temporary tablespaces
Multitenant Advantages - Manage Many as One
13
Data Guard
Multitenant supports Data Guard at CDB-Level
Commands executed when connected to root container
Multitenant Advantages - Manage Many as One
14
Upgrades Upgrade or apply a patch at CDB-Levelhttps://blogs.oracle.com/UPGRADE/entry/upgrade_pdbs_everything_at_once1
Unplug/plug PDB into another container databasehttps://blogs.oracle.com/UPGRADE/entry/upgrade_pdbs_one_at_a
Multitenant Advantages - Unplug/Plug
15
Moving PDB from one container to another is straightforward
s
Multitenant Advantages - Fast Cloning
Clone PDB from another PDB within the same CDB
Requires source PDB to be OPEN READ ONLY
s
16
Clone PDB from another PDB in remote CDB
Requires source PDB to be OPEN READ ONLY
Multitenant Advantages - Fast Cloning
s
17
s
Multitenant Advantages - Manage Many as One
18
RMAN
Backup entire container as one or at PDB level
Recover entire container as one or at PDB level
s
CDB-Level vs. PDB-Level
CDB-Level• Oracle Software
• SGA & Background Processes
• RMAN Scheduled Backups
• Data Guard
• Some Parameters(IsPDB_Modifiable= 'FALSE')
• Control Files, Redo and Undo
• (S)Pfile, Password File
• Flashback Database
PDB-Level• FLUSH SHARED_POOL
• FLUSH BUFFER_CACHE
• Point In-Time Recovery
• RMAN Ad hoc Backups
• Some Parameters(IsPDB_Modifiable= 'TRUE')
19
s
Multitenant Architecture - CDB_* Prefix
20
CDB_* All objects in CDB across all PDBs
DBA_* All objects in specific container
ALL_* Objects accessible by current user
USER_* Objects owned by current user
s
Multitenant Architecture - CON_ID column
21
CON_ID Description
0 Entire CDB/Non-CDB
1 Root container
2 Seed container
3-254 User PDBs
Oracle 12c - Deployment Options
22
DB CDB$ROOT CDB$ROOT
PDB1 PDB1 PDB2 PDB252…
Non-CDB
Same as before 12c
Single Tenant
• No additional license
• One active PDB
Multitenant
• Requires Multitenant License
• Requires Enterprise Edition
• Supports up to 252 PDBs
Oracle 12c - Deployment Options cont’d
23
Why use Single Tenant instead of Non-CDB?
Unplug/Plug
Fast Cloning
And most important …
In-Memory Option(version 12.1.0.2)
Rows vs. Columns
Row format stores all values of data record as one entity
Column format stores each column as separate entity
25
Rows vs. Columns cont’d
Which format provides better performance for the following queries?
ORDER_LINE table has 40M rows
EMPLOYEE_ID column is a Primary Key
26
The Problem
Columnar = high performance for OLAP queries
Row format = high performance for OLTP queries
In Mixed-Workload, both OLAP and OLTP queries are running
Trade-off between columnar format and row format
27
Oracle 12c Solution - In Memory Option
Why not benefit from both approaches?
Solution: Additional column store memory pool in the SGA
Oracle optimizer will automatically decide which option to use
28
In Memory Option - Demo
29
In Memory Option - Demo cont’d
30
In Memory Option - Demo cont’d
31
In Memory Option - Additional Notes
It is possible to enable the feature for the following levels:
Tablespace Table Partition Sub Partition Column
What will be loaded and when?
It depends on the object prioritization:
CRITICAL HIGH MEDIUM NONE (Default)
Populates into the column store only when someone queries the table
32
In Memory Option - Summary
Oracle 12.1.0.2 New Feature
Extra Cost Option
It is not column store Database
It is not In Memory Database
Boost performance for some queries
33
Invisible Columns
35
Invisible Columns
Mark a specific column or set of columns as invisible
Will not be seen by the application
However, they can be explicitly referenced
Make changes without affecting the application!
36
Invisible Columns - Demo
37
Invisible Columns - Demo Cont’d
Improved Defaults
Identity Columns Default value when using a sequence Default value when NULL is inserted
39
Identity Columns
Automatically generates an auto increment value upon row insertions
Uses sequence “behind the scenes”
Identity columns are NOT NULL
Has the following options:
ALWAYS (default)
BY DEFAULT
BY DEFAULT ON NULL
40
Identity Columns - Always
41
Identity Columns - BY DEFAULT
42
Identity Columns - BY DEFAULT ON NULL
43
Identity Columns - Set properties
44
Default value when using sequence
45
Default Value when NULL is inserted
Improved Column Addition
47
Improved Column Addition
Version < 11g
Adding new column with default value = All rows to be updated
Entire table lock, long operation
Version = 11g
Metadata-only when adding NOT NULL column with default value
Allows adding column within milliseconds
Version = 12c
Metadata-only support for nullable column with default value
48
Improved Column Addition - Demo
Version = 11g
Version = 12c
Extended Data Types
50
Extended Data Types
Increased size limit for VARCHAR, NVARCHAR, RAW data types
Can go up to 32K!
Consistent with the VARCHAR data type in PL/SQL
Allows using string functions that can return 32K VARCHAR2 type
Disabled by default
Enabling this feature requires short downtime
51
Extended Data Types - Demo
Version < 12c
Version = 12c
Enhanced Syntax for row-limiting (A.K.A Top-N Queries)
53
Enhanced Syntax for Top-N Queries
Examples:
Query top 2 employees with highest salaries
Query first 3 employees who have joined the company
Version < 12c
Implemented via ROWNUM pseudo column
Not a straightforward way to implement Top-N queries
Version = 12c
New enhanced and straightforward syntax
54
Enhanced Syntax for Top-N Queries - Demo
Pre 12c Syntax 12c Syntax
55
Enhanced Syntax for Top-N Queries - Demo
Pre 12c Syntax 12c Syntax
Query the 2nd block of first 2 employees who have joined the company
56
Enhanced Syntax for Top-N Queries - Demo
Query top 3 employees with highest salaries
Online Data File Move Operation
58
Online Data File Move Operation
Version < 12c
Requires downtime
Pre 12c Common solution
Take tablespace to OFFLINE state
Move data file to new location
Change location of data file in control file
Take tablespace back to ONLINE state
Version = 12c
Online operation
59
Online Data File Move Operation - Demo
Creating Multiple Indexes on the same column or set of columns
61
Multiple indexes on same set of columns
Oracle 11g introduced “Invisible Indexes” feature
Oracle 12c allows creating multiple indexes on same set of columns
Only 1 index is visible
All indexes are different, i.e. B*Tree & Bitmap
Test indexes’ performance without dropping and creating them
62
Multiple Indexes on the same column - Demo
RMAN New Features
64
Table Point In-Time Recovery
Useful when flashback table cannot be used to recover the table
Oracle 12c provides a simple RECOVER TABLE command which
automates the entire process we had to do manually prior to 12c
65
Support for 12c Multitenant Architecture
Back up the whole CDB - Connect to root and execute
Back up several PDBs - Connect to root and execute
Back up a specific PDB
Back up several tablespaces - Connect to root and execute
Back up root container
66
Version < 12c
SYSDBA was used for backup & restore operations
The Problem
The user who runs RMAN can access the user data
Oracle 12c Solution
SYSBACKUP privilege for backup & restore
operations
Separation of Duty - SYSBACKUP Privilege
Additional Features Worth Mentioning
68
Additional Features Worth Mentioning…
• Temporary Undo• Adaptive Execution Plans• Information Lifecycle Management• Enhanced Statistics
Administration &
Performance
• Data Redaction• Unified Auditing• Privilege Analysis
Security
• Calling PL/SQL from SQL• Partitioning EnhancementsDevelopment
69
Stuff on the web …
12c Articles (My Blog)http://OracleDBPro.BlogSpot.com/search/label/12c%20New%20Features
12c Articles (ORACLE-BASE Website)https://oracle-base.com/articles/12c/articles-12c
Top 12 Features of Oracle Database 12c (Video by Tom Kyte)https://youtu.be/ekTTXoHBmWw?list=PLDqEn-pc6UNsYEINEdaO3ni0EBVVmZqGK
70
References
Oracle 12.1.0.1 New Features (Oracle Documentation)https://docs.oracle.com/database/121/NEWFT/chapter12101.htm#NEWFT002
Oracle 12.1.0.2 New Features (Oracle Documentation)http://docs.oracle.com/database/121/NEWFT/chapter12102.htm#NEWFT003
Oracle Database In-Memory (White Paper)www.oracle.com/technetwork/database/in-memory/overview/twp-oracle-database-in-memory-2245633.html
Oracle Multitenant (White Paper)http://www.oracle.com/technetwork/database/multitenant-wp-12c-1949736.pdf
Note: All diagrams and illustrations are used by permission of Oracle
Questions?
You may complete the session evaluation via the mobile app
Thank You.Please complete the session evaluation
We appreciate your feedback and insight