59
Database Consolidation using the Oracle Multitenant Architecture Pini Dibask, Product Manager, Database Solutions Dell Software Group [UGF6588] Sunday, Sep 18 th 2016

Database Consolidation using the Oracle Multitenant Architecture

Embed Size (px)

Citation preview

Page 1: Database Consolidation using the Oracle Multitenant Architecture

Database Consolidation using the

Oracle Multitenant Architecture

Pini Dibask,Product Manager, Database SolutionsDell Software Group

[UGF6588] Sunday, Sep 18th 2016

Page 2: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group2

About Me …

Pini Dibask, Product Manager, Database Solutions (Dell Software)

Oracle Database Technologist & Architect 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

Page 3: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group3

About Dell Software Database Tools Portfolio

Monitor

ReplicateTeam Collaboration for

productive data professionals

Manage

Protect

Page 4: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group4

Agenda

Introduction to Database Consolidation

Oracle Multitenant Concepts

Ensuring QoS in Multitenant environment

RAC and Multitenant

Performance Monitoring for Multitenant environments

Page 5: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Introduction to Database Consolidation

Page 6: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group6

Database Consolidation - Prior to Oracle 12c

Server Consolidation

Multiple databases reside on a single server

Page 7: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group7

Database Consolidation - Prior to Oracle 12c

7

Database Consolidation

Single database with multiple schemas

Page 8: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group8

Database Consolidation - Challenges8

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: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Multitenant Architecture

Page 10: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group10

Database to Instance Relationship

Pluggable Database

Self-contained Oracle database

Root Container

Oracle-supplied metadata

Pluggable Databases (PDBs)

Page 11: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group11

11

One set of background processes

One SGA

One root container

Multiple Pluggable Databases

Up to 252 PDBs

Oracle 12c - Multitenant Architecture

Page 12: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group12

Multitenant Architecture cont’d

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: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group13

Multitenant Advantages - Manage Many as One

Data Guard

Data Guard operates at CDB-Level

Maintenance at CDB-Level = Reduced DBA efforts

CDB-Level granularity for Switchover/Failover operations

Page 14: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group14

Multitenant Advantages - Manage Many as One

Upgrades

Upgrade or apply a patch at CDB-Level

https://blogs.oracle.com/UPGRADE/entry/upgrade_pdbs_everything_at_once1

Unplug/plug PDB into another container database

https://blogs.oracle.com/UPGRADE/entry/upgrade_pdbs_one_at_a

Page 15: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group15

Multitenant Advantages - Unplug/Plug

Moving PDB from one container to another is straightforward

s

Page 16: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group16

Multitenant Advantages - Fast Cloning

Clone PDB from another PDB within the same CDB

Requires source PDB to be OPEN READ ONLY

Note: “Hot Clone” will be available in 12.2

s

Page 17: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group17

Clone PDB from another PDB in remote CDB

Requires source PDB to be OPEN READ ONLY

Note: “Hot Clone” will be available in 12.2

Multitenant Advantages - Fast Cloning

s

Page 18: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group18

s

Multitenant Advantages - Manage Many as One

RMAN – Granular Backup & Restore Options

Backup entire container as one or at PDB level

Recover entire container as one or at PDB level

s

Page 19: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group19

CDB-Level vs. PDB-Level

CDB-Level

• Oracle Software

• SGA & Background Processes

• Character Set

• 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')

Page 20: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group20

s

Multitenant Architecture - CDB_* Prefix

CDB_* All objects in CDB across all PDBs

DBA_* All objects in specific PDB

ALL_* Objects accessible by current user

USER_* Objects owned by current user

Page 21: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group21

s

Multitenant Architecture - Containers

CON_ID Description

0 Entire CDB/Non-CDB

1 Root container

2 Seed container

3-254 User PDBs

Created by default -Used as a template PDB for cloning

Page 22: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group22

Multitenant Architecture - Users

Local User

Identity known only in PDB-scope

Common User

Identity known in the root and in all PDBs

C## Prefix (COMMON_USER_PREFIX parameter)

CDB$ROOT

PDB1 PDB2ERP CRM DW HR

C##U1 C##U2

Page 23: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group23

Multitenant Architecture – Users cont’d

s

Page 24: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group24

PDBs’ state after instance startup

s

Mounted by default (!)

Only from 12.1.0.2

Page 25: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group25

Oracle 12c - Deployment Options

DB CDB$ROOT CDB$ROOT

PDB1 PDB1 PDB2 PDB252

Non-CDB

Same as before 12c

Single Tenant

• No additional license

• One active PDB

Multitenant

• Extra Cost Option

• Requires Enterprise Edition

• Supports up to 252 active PDBs

Page 26: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group26

Oracle 12c - Deployment Options cont’d

Why use Single Tenant instead of Non-CDB?

Unplug/Plug

Fast Cloning

And most important …

Page 27: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group27

Oracle 12c – DBCA

Non-CDB Single Tenant / Multitenant

Page 28: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Ensuring high level of QoSwith Multitenant environments

Page 29: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group29

QoS Challenges - Multitenant environments

PDB-Level QoS challenge

Allocation of resources among competing sessions

Example: One session consumes too many resources

CDB-Level QoS challenge

Allocation of resources among competing PDBs

Example: One PDB consumes too many resources

Page 30: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group30

The Solution – Oracle Resource Manager

PDB-Level Resource Plan

Specifies how resources are allocated to consumer groups

Prioritize resources between competing sessions

CDB-Level Resource Plan

Specifies how resources are allocated to PDBs

Prioritize resources between competing PDBs

Page 31: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group31

Oracle Resource Manager - The Basics

Resource Manager Elements

Resource Plan

Resource Plan Directive

Consumer Group Resource Plan“WEEKEND”

Directive 170% of CPU

Directive 220% of CPU

Directive 310% of CPU

Consumer Group“WAREHOUSE”

Consumer Group“OLTP”

Consumer Group“OTHERS_GROUPS”

Page 32: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group32

Oracle Resource Manager - 12c Multitenant

CDB Resource Plan Directive

CPU Shares

CPU Utilization Limit

Parallel Servers Limit

Memory Limit (Will be available in 12.2)

Example

Pluggable Database

CPU Shares

Guaranteed CPU

CPU Limit Parallel Servers Limit

OLTP 3 3/4 = 75% 100% 100%

DWH 1 1/4 = 25% 60% 100%

Page 33: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group33

Obtain information about default CDB resource plan

Obtain information about default PDB directive

s

s

Oracle Resource Manager - 12c Multitenant

Page 34: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group34

CDB-Level Resource Plan Example

Resource Plan“Daytime_CDB_PLAN”

PDB

“OLTP”PDB

“DWH”

Directive 2Guaranteed CPU: 25%Maximum CPU: 60%

Directive 1Guaranteed CPU: 75%Maximum CPU: 100%

Pluggable Database

CPU Shares

Guaranteed CPU

CPU Limit Parallel Servers Limit

OLTP 3 3/4 = 75% 100% 100%

DWH 1 1/4 = 25% 60% 100%

Page 35: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group35

Creating CDB Resource Plan

s

Pluggable Database

CPU Shares

Guaranteed CPU

CPU Limit

OLTP 3 3/4 = 75% 100%

DWH 1 1/4 = 25% 60%

Page 36: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group36

Creating CDB Resource Plan cont’d

s

Page 37: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group37

Manually enabling resource plan

Manually disabling resource plan

Enabling/Disabling CDB Resource Plan

s

s

Page 38: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group38

s

Automatically Enable/Disable CDB Resource Plan

Enabling/Disabling CDB Resource Plan cont’d

Resource Plan Name

Page 39: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

RAC & Multitenant

Page 40: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group40

Why RAC & Multitenant?

Single Instance & Multitenant challenges

Not Scalable = Limited Consolidation Solution

Instance Down Downtime for all PDBs

RAC makes Multitenant better

Scalable = True consolidation solution

Available = Instance Down PDBs continue running on other nodes

Page 41: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group41

s

RAC & Multitenant

Multitenant fully supports RAC

PDBs can be opened on specific instances

Page 42: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group42

Services

Single SGA per

CDB Instance

Node1

CDB Instance 1

Node2

CDB Instance 2

Multitenant Container Database (CDB)

RAC & Multitenant

PDBs workload distributed across RAC instances

Page 43: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group43

RAC & Multitenant

Services

Single SGA per

CDB Instance

Node1

CDB Instance 1

Node2

CDB Instance 2

Node3

CDB Instance 3

Multitenant Container Database (CDB)

PDBs workload distributed across RAC instances

Page 44: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group44

s

RAC & Multitenant

Preferred Instance Available Instance

Page 45: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group45

s

Shutting down the preferred instance

PDB automatically starts in the other instance

RAC & Multitenant

PDB opened only in Preferred instance

Page 46: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Performance Monitoring for Multitenant Environments

Page 47: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group47

Workload Analysis - Multitenant Environments

Page 48: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group48

Workload Analysis - RAC & Multitenant

Page 49: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group49

Multi Dimensional Analysis

Page 50: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group50

Multi Dimensional Analysis

Page 51: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group51

Multi Dimensional Analysis

Page 52: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group52

Multitenant & AWR

Snapshots are taken at CDB-Level

AWR tables reside in CDB$ROOT container

Page 53: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group53

Multitenant & AWR cont’d

s

Page 54: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group54

Multitenant & AWR cont’d

AWR reports are available at CDB & PDB levels

DBA_HIST_* views are visible at PDB level

Unplug PDB does not contain AWR information

s

Data available in PDB via object-link to the CDB$ROOT container

Page 55: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Summary

Page 56: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group56

Summary

Multitenant architecture can simplify Database consolidation

Cloud deployments (DBaaS) - Great use case for Multitenant

Non-CDB deprecation -> Faster Multitenant adoption period

Monitor PDBs workload distribution over time

Overcome QoS challenges with Services & DBRM

Page 57: Database Consolidation using the Oracle Multitenant Architecture

Dell Software Group57

References57

Introduction to the Multitenant Architecture (Oracle Documentation)

https://docs.oracle.com/database/121/CNCPT/cdbovrvw.htm#CNCPT89234

Managing Resources with Resource Manager (Oracle Documentation)

https://docs.oracle.com/database/121/ADMIN/dbrm.htm#ADMIN027

DBMS_RESOURCE_MANAGER (Oracle Documentation)

https://docs.oracle.com/database/121/ARPLS/d_resmgr.htm#ARPLS050

Introduction to a Multitenant Environment (Video by Tom Kyte)

https://www.youtube.com/watch?v=2MrouEW9j88

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 58: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Questions?

Page 59: Database Consolidation using the Oracle Multitenant Architecture

Dell - Restricted - Confidential

Thank You!