database consolidation using the oracle multitenant architecture
TRANSCRIPT
Database Consolidation using the
Oracle Multitenant Architecture
Pini Dibask,Product Manager, Database SolutionsDell Software Group
[UGF6588] Sunday, Sep 18th 2016
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
Dell Software Group3
About Dell Software Database Tools Portfolio
Monitor
ReplicateTeam Collaboration for
productive data professionals
Manage
Protect
Dell Software Group4
Agenda
Introduction to Database Consolidation
Oracle Multitenant Concepts
Ensuring QoS in Multitenant environment
RAC and Multitenant
Performance Monitoring for Multitenant environments
Dell - Restricted - Confidential
Introduction to Database Consolidation
Dell Software Group6
Database Consolidation - Prior to Oracle 12c
Server Consolidation
Multiple databases reside on a single server
Dell Software Group7
Database Consolidation - Prior to Oracle 12c
7
Database Consolidation
Single database with multiple schemas
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
Dell - Restricted - Confidential
Multitenant Architecture
Dell Software Group10
Database to Instance Relationship
Pluggable Database
Self-contained Oracle database
Root Container
Oracle-supplied metadata
Pluggable Databases (PDBs)
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
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
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
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
Dell Software Group15
Multitenant Advantages - Unplug/Plug
Moving PDB from one container to another is straightforward
s
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
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
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
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')
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
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
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
Dell Software Group23
Multitenant Architecture – Users cont’d
s
Dell Software Group24
PDBs’ state after instance startup
s
Mounted by default (!)
Only from 12.1.0.2
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
…
Dell Software Group26
Oracle 12c - Deployment Options cont’d
Why use Single Tenant instead of Non-CDB?
Unplug/Plug
Fast Cloning
And most important …
Dell Software Group27
Oracle 12c – DBCA
Non-CDB Single Tenant / Multitenant
Dell - Restricted - Confidential
Ensuring high level of QoSwith Multitenant environments
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
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
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”
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%
Dell Software Group33
Obtain information about default CDB resource plan
Obtain information about default PDB directive
s
s
Oracle Resource Manager - 12c Multitenant
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%
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%
Dell Software Group36
Creating CDB Resource Plan cont’d
s
Dell Software Group37
Manually enabling resource plan
Manually disabling resource plan
Enabling/Disabling CDB Resource Plan
s
s
Dell Software Group38
s
Automatically Enable/Disable CDB Resource Plan
Enabling/Disabling CDB Resource Plan cont’d
Resource Plan Name
Dell - Restricted - Confidential
RAC & Multitenant
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
Dell Software Group41
s
RAC & Multitenant
Multitenant fully supports RAC
PDBs can be opened on specific instances
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
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
Dell Software Group44
s
RAC & Multitenant
Preferred Instance Available Instance
Dell Software Group45
s
Shutting down the preferred instance
PDB automatically starts in the other instance
RAC & Multitenant
PDB opened only in Preferred instance
Dell - Restricted - Confidential
Performance Monitoring for Multitenant Environments
Dell Software Group47
Workload Analysis - Multitenant Environments
Dell Software Group48
Workload Analysis - RAC & Multitenant
Dell Software Group49
Multi Dimensional Analysis
Dell Software Group50
Multi Dimensional Analysis
Dell Software Group51
Multi Dimensional Analysis
Dell Software Group52
Multitenant & AWR
Snapshots are taken at CDB-Level
AWR tables reside in CDB$ROOT container
Dell Software Group53
Multitenant & AWR cont’d
s
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
Dell - Restricted - Confidential
Summary
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
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
Dell - Restricted - Confidential
Questions?
Dell - Restricted - Confidential
Thank You!