best new features of oracle database 12c

72
Session ID: Prepared by: Best New Features of Oracle Database 12c 169 5 @pini_dibask Pini Dibask, Oracle Domain Expert, Dell Software Group, R&D

Upload: pini-dibask

Post on 16-Apr-2017

9.412 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Best New Features of Oracle Database 12c

Session ID:

Prepared by:

Best New Features of Oracle Database 12c

1695

@pini_dibask

Pini Dibask,Oracle Domain Expert, Dell Software Group, R&D

Page 2: Best New Features of Oracle Database 12c

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 …

Page 3: Best New Features of Oracle Database 12c

Agenda

Page 4: Best New Features of Oracle Database 12c

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

Page 5: Best New Features of Oracle Database 12c

Multitenant Architecture

Page 6: Best New Features of Oracle Database 12c

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

Page 7: Best New Features of Oracle Database 12c

7

Database Consolidation - Prior to Oracle 12c

Schema Consolidation

Single database with multiple schemas

Page 8: Best New Features of Oracle Database 12c

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

Page 9: Best New Features of Oracle Database 12c

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

Page 10: Best New Features of Oracle Database 12c

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

Page 11: Best New Features of Oracle Database 12c

11

One set of background processes

One SGA

One root container

Multiple Pluggable Databases

Up to 252 PDBs

Oracle 12c - Multitenant Architecture

Page 12: Best New Features of Oracle Database 12c

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

Page 13: Best New Features of Oracle Database 12c

Multitenant Advantages - Manage Many as One

13

Data Guard

Multitenant supports Data Guard at CDB-Level

Commands executed when connected to root container

Page 15: Best New Features of Oracle Database 12c

Multitenant Advantages - Unplug/Plug

15

Moving PDB from one container to another is straightforward

s

Page 16: Best New Features of Oracle Database 12c

Multitenant Advantages - Fast Cloning

Clone PDB from another PDB within the same CDB

Requires source PDB to be OPEN READ ONLY

s

16

Page 17: Best New Features of Oracle Database 12c

Clone PDB from another PDB in remote CDB

Requires source PDB to be OPEN READ ONLY

Multitenant Advantages - Fast Cloning

s

17

Page 18: Best New Features of Oracle Database 12c

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

Page 19: Best New Features of Oracle Database 12c

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

Page 20: Best New Features of Oracle Database 12c

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

Page 21: Best New Features of Oracle Database 12c

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

Page 22: Best New Features of Oracle Database 12c

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

Page 23: Best New Features of Oracle Database 12c

Oracle 12c - Deployment Options cont’d

23

Why use Single Tenant instead of Non-CDB?

Unplug/Plug

Fast Cloning

And most important …

Page 24: Best New Features of Oracle Database 12c

In-Memory Option(version 12.1.0.2)

Page 25: Best New Features of Oracle Database 12c

Rows vs. Columns

Row format stores all values of data record as one entity

Column format stores each column as separate entity

25

Page 26: Best New Features of Oracle Database 12c

 

 

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

Page 27: Best New Features of Oracle Database 12c

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

Page 28: Best New Features of Oracle Database 12c

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

Page 29: Best New Features of Oracle Database 12c

 

In Memory Option - Demo

29

Page 30: Best New Features of Oracle Database 12c

 

In Memory Option - Demo cont’d

30

Page 31: Best New Features of Oracle Database 12c

 

In Memory Option - Demo cont’d

31

Page 32: Best New Features of Oracle Database 12c

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

Page 33: Best New Features of Oracle Database 12c

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

Page 34: Best New Features of Oracle Database 12c

Invisible Columns

Page 35: Best New Features of Oracle Database 12c

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!

Page 36: Best New Features of Oracle Database 12c

36

 

Invisible Columns - Demo

Page 37: Best New Features of Oracle Database 12c

37

Invisible Columns - Demo Cont’d

 

Page 38: Best New Features of Oracle Database 12c

Improved Defaults

Identity Columns Default value when using a sequence Default value when NULL is inserted

Page 39: Best New Features of Oracle Database 12c

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

Page 40: Best New Features of Oracle Database 12c

40

Identity Columns - Always

 

Page 41: Best New Features of Oracle Database 12c

41

Identity Columns - BY DEFAULT

 

Page 42: Best New Features of Oracle Database 12c

42

Identity Columns - BY DEFAULT ON NULL

 

Page 43: Best New Features of Oracle Database 12c

43

 

Identity Columns - Set properties

Page 44: Best New Features of Oracle Database 12c

44

 

Default value when using sequence

Page 45: Best New Features of Oracle Database 12c

45

Default Value when NULL is inserted

 

Page 46: Best New Features of Oracle Database 12c

Improved Column Addition

Page 47: Best New Features of Oracle Database 12c

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

Page 48: Best New Features of Oracle Database 12c

48

Improved Column Addition - Demo

 

Version = 11g

Version = 12c

Page 49: Best New Features of Oracle Database 12c

Extended Data Types

Page 50: Best New Features of Oracle Database 12c

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

Page 51: Best New Features of Oracle Database 12c

51

Extended Data Types - Demo

 

Version < 12c

Version = 12c

Page 52: Best New Features of Oracle Database 12c

Enhanced Syntax for row-limiting (A.K.A Top-N Queries)

Page 53: Best New Features of Oracle Database 12c

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

Page 54: Best New Features of Oracle Database 12c

54

 

Enhanced Syntax for Top-N Queries - Demo

Pre 12c Syntax 12c Syntax

Page 55: Best New Features of Oracle Database 12c

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

Page 56: Best New Features of Oracle Database 12c

56

 

Enhanced Syntax for Top-N Queries - Demo

Query top 3 employees with highest salaries

Page 57: Best New Features of Oracle Database 12c

Online Data File Move Operation

Page 58: Best New Features of Oracle Database 12c

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

Page 59: Best New Features of Oracle Database 12c

59

Online Data File Move Operation - Demo

 

Page 60: Best New Features of Oracle Database 12c

Creating Multiple Indexes on the same column or set of columns

Page 61: Best New Features of Oracle Database 12c

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

Page 62: Best New Features of Oracle Database 12c

62

Multiple Indexes on the same column - Demo

 

Page 63: Best New Features of Oracle Database 12c

RMAN New Features

Page 64: Best New Features of Oracle Database 12c

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

Page 65: Best New Features of Oracle Database 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

Page 66: Best New Features of Oracle Database 12c

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

Page 67: Best New Features of Oracle Database 12c

Additional Features Worth Mentioning

Page 68: Best New Features of Oracle Database 12c

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

Page 70: Best New Features of Oracle Database 12c

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

Page 71: Best New Features of Oracle Database 12c

Questions?

Page 72: Best New Features of Oracle Database 12c

You may complete the session evaluation via the mobile app

Thank You.Please complete the session evaluation

We appreciate your feedback and insight