Upload
pini-dibask
View
583
Download
4
Embed Size (px)
Citation preview
Session ID:
Prepared by:
Database Consolidation using
Oracle 12c Multitenant Architecture
1116
@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
Introduction to Database Consolidation
Oracle Multitenant Architecture
Ensuring QoS in Multitenant environment
RAC and Multitenant
Performance Monitoring for Multitenant environments
Introduction to Database Consolidation
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
Database Consolidation
Single database with multiple schemas
8
Database 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
Multitenant Architecture
10
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
11
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
12
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
13
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
14
Data Guard
Multitenant supports Data Guard at CDB-Level
Commands executed when connected to root container
Multitenant Advantages - Manage Many as One
15
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
16
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
17
Clone PDB from another PDB in remote CDB
Requires source PDB to be OPEN READ ONLY
Multitenant Advantages - Fast Cloning
s
18
s
Multitenant Advantages - Manage Many as One
19
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')
20
s
Multitenant Architecture - CDB_* Prefix
21
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
s
Multitenant Architecture - CON_ID column
22
CON_ID Description
0 Entire CDB/Non-CDB
1 Root container
2 Seed container
3-254 User PDBs
Multitenant Architecture - Users
23
Common User
Identity known in the root and in all PDBs
C## Prefix (COMMON_USER_PREFIX parameter)
Local User
Identity known only in PDB-scope
CDB$ROOT
PDB1 PDB2ERP CRM ERP HR
C##U1 C##U2
s
Multitenant Architecture - Users
24
PDB with 1 local user
s
Connecting to the CDB/PDB
25
Switch Containers
s
26
PDBs state after startup
PDBs are Mounted by default
(12.1.0.2)
Oracle 12c - Deployment Options
27
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
28
Why use Single Tenant instead of Non-CDB?
Unplug/Plug
Fast Cloning
And most important …
Ensuring QoS in Multitenant Environments
QoS Challenges - Multitenant environments
CDB-Level QoS challenge
Allocation of resources among competing PDBs
Example: One PDB consumes too many resources
PDB-Level QoS challenge
Allocation of resources among competing sessions
Example: One session consumes too many resources
30
The Solution – Oracle Resource Manager
CDB-Level Resource Plan
Specifies how resources are allocated to PDBs
Prioritize resources between competing PDBs
PDB-Level Resource Plan
Specifies how resources are allocated to consumer groups
Prioritize resources between competing sessions
31
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”
32
Oracle Resource Manager - 12c Multitenant
CDB Resource Plan Directive
CPU Shares
CPU Utilization Limit
Parallel Servers Limit
Example #1
33
Pluggable Database
CPU Shares
Guaranteed CPU
CPU Limit Parallel Servers Limit
OLTP 3 3/4 = 75% 100% 100%
ERP 1 1/4 = 25% 60% 100%
Obtain information about default CDB resource plan
Obtain information about default PDB directive
s
s
Oracle Resource Manager - 12c Multitenant
34
CDB-Level Resource Plan Example
Resource Plan“Daytime_CDB_PLAN”
PDB“OLTP”
PDB“DWH”
35
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%
Creating CDB Resource Plan
36
s
Pluggable Database
CPU Shares
Guaranteed CPU
CPU Limit
OLTP 3 3/4 = 75% 100%
DWH 1 1/4 = 25% 60%
Creating CDB Resource Plan cont’d
37
s
Manually enabling resource plan
Manually disabling resource plan
Enabling/Disabling CDB Resource Plan
38
s
s
s
Automatically Enable/Disable CDB Resource Plan
Enabling/Disabling CDB Resource Plan cont’d
39
RAC & Multitenant
s
RAC & Multitenant?
Multitenant fully supports RAC
PDBs can be opened on specific instances
41
Why RAC & Multitenant?
Single Instance & Multitenant - Challenges
Not Scalable = Not a true consolidation solution
Instance Down Downtime for all PDBs
RAC makes Multitenant better
Scalable = True consolidation solution
Instance Down PDBs continue running on other nodes
42
Services
Single SGA perCDB Instance
Node1
CDB Instance 1
Node2
CDB Instance 2
Multitenant Container Database (CDB)
CRMBI HCM ERPDW
RAC & Multitenant
Workload distributed across instances
44
RAC & Multitenant
Services
Single SGA perCDB Instance
Node1
CDB Instance 1
Node2
CDB Instance 2
Node3
CDB Instance 3
Multitenant Container Database (CDB)
CRMBI HCM ERPDW
Workload distributed across instances
s
45
RAC & Multitenant
Preferred Instance Available Instance
s
46
Shutting down the preferred instance
PDB automatically starts in the other instance
RAC & Multitenant
47
RAC & Multitenant
Obtain service configuration …
48
RAC & Multitenant
Relocate PDBs using Service relocation
49
RAC & Multitenant
Additional service for PDBTEST
Running on all RAC nodes
Performance Monitoring for Multitenant Environments
Workload Analysis - Multitenant Environments
51
Workload Analysis - RAC & Multitenant
52
Dimensional Analysis - Multitenant Environments
53
54
Dimensional Analysis - Multitenant Environments
55
Multitenant & AWR
Snapshots are taken at CDB-Level
AWR tables reside in CDB$ROOT container
s
56
Multitenant & AWR cont’d
57
AWR reports are available at CDB & PDB levels
DBA_HIST_* views are visible at PDB level
Unplug PDB does not contain AWR information
Multitenant & AWR cont’d
s
Data available in PDB via object-link to the CDB$ROOT container
58
References
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
Questions?
Thank You !Please complete the session evaluation
We appreciate your feedback and insight
You may complete the session evaluation via the mobile app