Upload
jonathan-owen
View
224
Download
0
Tags:
Embed Size (px)
Citation preview
Private Database Cloud
Database Consolidation
Deep Dive in PDB
Nitin Vengurlekar Viscosity – CTO/Cloud Evangelist @dbcloudshifu
Charles Kim Viscosity – CEO/Oracle Architect @racdba
Who am I and Why am even speaking
• 18 Years with Oracle
• 13 Years in RAC/ASM development and Product Management
• Self Proclaimed “Private Database Cloud” Evangelist
• Follow me on Twitter - @dbcloudshifu
Program Agenda
• What is Private Database Cloud
• Why Database Cloud Consolidation
• Private Database Cloud deployment models
• Pluggable Database Deep Dive
• PDB and RAC – A Perfect Deployment Model
NIST Definition of Cloud Computing
• Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.
• This cloud model promotes availability and is composed of:
Source: NIST Definition of Cloud Computing v15
3 Service Models
• SaaS• PaaS• IaaS
4 Deployment Models
• Public Cloud• Private Cloud• Community Cloud• Hybrid Cloud
5 Essential Characteristics
• On-demand self-service• Resource pooling• Rapid elasticity• Measured service• Broad network access
Customers Have a Choice of Clouds• Own & Operate, Use Managed Services, Subscribe
ManagedBuild Subscribe
Customer owns.Service provider manages.
Either may host.
Customer owns, hosts and manages.
Customer subscribes.Service provider hosts
and manages.
Managed Cloud ServicesPrivate Cloud Public Cloud
Source-Oracle
Customers Have a Choice of Clouds
• IaaS, PaaS or SaaS
ApplicationApplication
PlatformPlatform
CustomizationsCustomizations
ApplicationApplication
CustomizationsCustomizations CustomizationsCustomizations
Con
sum
er
Con
sum
er
Serv
ice
Pro
vid
er
Serv
ice P
rovid
er
IaaS Cloud
SaaS Cloud
PaaS Cloud
IT Professional Developer Business End User
Different Users
Source-Oracle
Database Cloud Business Drivers
Lower: • CapEx
• Servers• Storage
•OpEx• Maintenance• Management
Reduce:• Configurations• Services
Standardize:• OS• DB Versions
Enhance:• IT service time• Availability• Security
Enable:• Online changes • Rapid response • Faster Time to market
Source-Oracle
Private Database Cloud Architectures Common building blocks are shared server and storage pools
PlatformPlatform
ERPERPDWDW CRMCRM
PlatformPlatform
Database CloudDatabase Cloud
Database ConsolidationShare server pool
Real Application Clusters
PlatformPlatform
ERPERPDWDW CRMCRM
PlatformPlatform
Database CloudDatabase Cloud
Schema ConsolidationShare database instancesReal Application Clusters
Infrastructure CloudInfrastructure Cloud
Server ConsolidationDeploy in dedicated VMs
Server virtualization
HypervisorHypervisor
CRMCRMDWDW ERPERP
OSOS OSOSOSOS
HypervisorHypervisor
Source-Oracle
Infrastructure CloudServer - Provision a Database in a VM
• Reasons for adoption– Simple to implement– Excellent isolation– Mixed workloads– As-is consolidation– Legacy support
• Customer concerns– Lower consolidation density– Lower ROI– Performance (latency)– Managing sprawl
Source-Oracle
Database Cloud Database Consolidation – Provision Database
• Reasons for adoption– Consolidation density– Good ROI– Performance– Supports any app
• Customer concerns– Requires OS standardization– Database only
OSOS
ERPERPDWDW CRMCRM
OSOS
Source-Oracle
Private Database CloudDatabase – Provision Schema
• Reasons for adoption– Most efficient– Extremely fast provisioning– Best ROI– Performance– Efficient memory use
• Customer concerns– App qualification required– Requires OS and DB standardization– Isolation
• Performance - Resource Management• Security - • Availability • Operational - Namespace issues
OSOS
ERPERPDWDW CRMCRM
OSOS
Source-Oracle
Next Generation Consolidation Pluggable Database - Database/Schema
Source-Oracle
• Reasons for Adoption– No application validation required
– Fast Provisioning• Fast creation of empty PDB• Fast clone of a PDB for testing• Fast plug PDB for migrations & upgrades
– High Level of Consolidation
– Excellent Performance : Resource ratio
• Customer Concerns– Available with 12.1
– New technology to adopt
CRMCRMDWDW ERPERP
CDBCDB
PDBPDB PDBPDB PDBPDB
Private Database CloudsNew in 12c – Provision a PDB in a Container DB
Private Database Cloud – Pluggable Database Concepts
• CDB– The name you give it will be name of the instance (SID). – The CDB database owns the SGA and running processes. – Can contain upto 252 PDBs– Can have many CDBs on the same database server (each with its own PDBs).
• Root CDB (cdb$root) contains the data dictionary
• The seed PDB (PDB$SEED) is a Oracle supplied system template that the CDB can use to create new PDBs. The seed PDB is named PDB$SEED. One cannot add or modify objects in PDB$SEED.
Private Database Cloud – Pluggable Database Concepts• PDB (Pluggable Database)
– Also referred to Containers– The PDB are sub-containers (databases) serviced by CDB resources– PDB has mobility - unplug and plug 12c databases into and out of CDBs. – Can “create like” new PDBs from existing PDB, like full snapshots.– Can be created or managed using DBCA , OEM, or command line– SQL statement execution is scoped to the container (PDB)
• Con Id (Container ID – con_id)– Scope is defined by the container id– Container ID is established and tagged at session creation/connection– Defines level of isolation– Permeates across all aspects of Data Dictionary and Oracle code layers
Private Database Cloud – Pluggable Database Concepts• Non-CDB
– Like traditional database that is not capable of housing PDB– Still has GUID like a CDB– If it is 12c database (or after upgraded) it can be plugged-in to a CDB
Private Database Cloud – Pluggable Database Concepts – Who Owns What… Says the CDB
•Scope is key in understanding and managing PDB– Where is data stored or referenced; eg, at root or PDB– How can PDB access its data; scope of access– Can data be portable – moved with unplug/plug operations
Private Database Cloud – Pluggable Database Concepts – Who Owns What… Says the CDB
•Management and Operation– Job scheduling -> container specific; e.g., root jobs scoped within CDB, jobs scoped in
container – ASH data is stored within PDB and is mobile
– PDBs inherit init.ora parameters from CDB, some parameters can be set at PDB, but no mobility
– Features vary content placement (container) at specific level and have of scope of access• AWR is stored in root, PDB can access its own PDB AWR content• ASH • SQL Tuning Advisor data is stored in root and not mobile
Private Database Cloud – Pluggable Database Concepts – Who Owns What… Says the CDB
•Instance stuff– CDB owns all instance level real estate – semaphore, shm segments– Memory - CDB only manages and maintains the memory
• When consolidating, all PDB memory requirements will rollup into CDB ..plan accordingly
– One alert.log, ADR – One ORACLE_HOME– One SPFile though PDB can have PDB level settings
• See parameters with IsPDB_Modifiable = ‘TRUE’
Private Database Cloud – Pluggable Database Concepts – Who Owns What… Says the CDB
•Database Stuff– CDB has its own set of System and SYSAUX– CDB owns the controlfiles, online/archive redo logs, undo and default Temp– PDB can have its own Temp– DataGuard at CDB level– Oracle-supplied objects such as views, PL/SQL, etc., are shared across all PDBs
using object “stubs”
Private Database Cloud – Pluggable Database Concepts – Who Owns What… Says the CDB
•Tablespace and DataFiles– Root has its own set of tablespaces & datafiles– PDB has its own System and SYSAUX, as well as optional TEMP– PDB has its own set of tablespaces & datafiles– Each PDB has its own TDE master key – can also be managed by CDB using
“Administer Key Management “ capability– DataVault employed at the PDB level
Private Database Cloud – Pluggable Database Creation
• Two methods to create a container database– The usual “ Create Database” script
• Use starting point init.ora parameter with ENABLE_PLUGGABLE_DATABASE parameter set
– OUI (DBCA) method
• Both methods build a CDB capable database with Data Dictionary to support it
Private Database Cloud – Pluggable Database OUI Workflow
Private Database Cloud – Pluggable Database OUI Workflow
Private Database Cloud – Pluggable Database OUI Workflow
Private Database Cloud – Pluggable Database CDB
First verify that we are truly on 12c Oracle databaseSQL> select instance_name, version, status, con_id from v$instance;
INSTANCE_NAME VERSION STATUS CON_ID---------------- ----------------- ------------ ----------yoda 12.1.0.1.0 OPEN 0
The v$database view tells us that we are dealing with a CDB based database CDB$ROOT@YODA> select cdb, con_id from v$database;
CDB CON_ID--- ----------YES 0
Or a more elegant way:CDB$ROOT@YODA> select NAME, DECODE(CDB, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option ?" , OPEN_MODE, CON_ID from V$DATABASE;
NAME Multitenant Option ? OPEN_MODE CON_ID--------- -------------------------- -------------------- ----------YODA Multitenant Option enabled READ ONLY 0
Private Database Cloud – Pluggable Database CDB
• There are alot of new views, tables, and commands to support PDB/CDB. • v$PDBS, v$CONTAINERS, DBA_PLUGGABLE_DATABASE, and CDB_PDBS views
• The SQLPlus command con_name (container name) shows the container and the con_id we are connected to:
CDB$ROOT@YODA> show con_nameCON_NAME------------------------------CDB$ROOT
CDB$ROOT@YODA> show con_id
CON_ID------------------------------1
Private Database Cloud – Pluggable Database CDB
Let's see what PDBs that are created in this CDB and their current state:
CDB$ROOT@YODA> select CON_ID,DBID,NAME,TOTAL_SIZE from v$pdbs;
CON_ID DBID NAME TOTAL_SIZE---------- ---------- ------------------------------ ---------- 2 4066465523 PDB$SEED 283115520 3 483260478 PDBOBI 0
CDB$ROOT@YODA> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE---------- -------------------- ---------- 2 PDB$SEED READ ONLY 3 PDBOBI MOUNTED
Recall from OUI that we created a PDB (pdbobi) when we specified the Pluggable Database Feature on install. Also, a PDB$SEED got created as part of that Install process
Now lets's connect to the two different PDBs and see what they got!! You really shouldn't ever connect to PDB$SEED, since its just used as a template, but we're just curious :-)
Private Database Cloud – Pluggable Database CDB
• Now lets's connect to the two different PDBs and see what they got!! You really shouldn't ever connect to PDB$SEED, since its just used as a template, but we're just curious :-)
CDB$ROOT@YODA> alter session set container=PDB$SEED;Session altered.
CDB$ROOT@YODA> select name from v$datafile;
NAME--------------------------------------------------------------------------------+PDBDATA/YODA/DATAFILE/undotbs1.260.823892155+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.271.823892297+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.270.823892297
• As you can see that PDB$SEED houses the template tablespaces -> System, Sysaux, and Undo tablespaces• The SEED database is used for Cloning for new PDBs
Private Database Cloud – Pluggable Database CDB
If we connect back to the root-CDB, we see that it houses essentially the traditional database tablespaces (like in pre-12c days).
CDB$ROOT@YODA> alter session set container=cdb$root;Session altered.
CDB$ROOT@YODA> select name from v$datafile;
NAME--------------------------------------------------------------------------------+PDBDATA/YODA/DATAFILE/system.258.823892109+PDBDATA/YODA/DATAFILE/sysaux.257.823892063+PDBDATA/YODA/DATAFILE/undotbs1.260.823892155+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.271.823892297+PDBDATA/YODA/DATAFILE/users.259.823892155+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.270.823892297+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/system.276.823892813+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/sysaux.274.823892813+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/users.277.823892813+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/example.275.823892813
Private Database Cloud – Pluggable Database DBCA Workflow
Private Database Cloud – Pluggable Database DBCA Workflow
Private Database Cloud – Pluggable Database DBCA Workflow
Private Database Cloud – Pluggable Database DBCA Workflow
Private Database Cloud – Pluggable DatabaseA Peek at PDB
• Note, that when you create the PDB, it is initially in mounted mode with a status of NEW. • View the OPEN MODE status of a PDB by querying the OPEN_MODE column in the
V$PDBS view or view the status of a PDB by querying the STATUS column of the CDB_PDBS or DBA_PDBS view
• Let's connect to our user PDB (pdbobi) and see what we can see :-)CDB$ROOT@YODA> alter session set container=pdbobi;Session altered.
CDB$ROOT@YODA> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE---------- ----------------- ----------- 3 PDBOBI MOUNTED
Place PDBOBI in Read Write mode.
CDB$ROOT@YODA> alter pluggable database pdbobi open;
Pluggable database altered.
• All PDBs can be opened at once using
CDB$ROOT@YODA> alter pluggable database all open;
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA – Create a Fileset Workflow
Private Database Cloud – Pluggable Database DBCA – Create a Fileset Workflow
Private Database Cloud – Pluggable Database DBCA – Create a Fileset Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database DBCA Manage PDB Workflow
Private Database Cloud – Pluggable Database Migrating, Cloning PDBs
• Options to migrate non-CDB into PDB-CDB • Logical
• pre-create a PDB using Clone • DataPump out of non-CDB into CDB
• Physical (requires that source is 12.1 database)• Migrate using manifest file
• Create a manifest file of source
Private Database Cloud – Pluggable Database Unplug/Plug PDBs
Unplug / plugunplug into '/u01/app/oracle/oradata/endor.xml'
create pluggable database Endorusing '/u01/app/oracle/oradata/endor.xml'
Private Database Cloud – Pluggable Database CDB
Let's create a new clone from an existing PDB, but with a new path
CDB$ROOT@YODA> create pluggable database PDBvader from PDBOBI FILE_NAME_CONVERT=('+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE','+PDBDATA');create pluggable database PDBvader from PDBOBI FILE_NAME_CONVERT=('+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE','+PDBDATA')*ERROR at line 1:ORA-65040: operation not allowed from within a pluggable database
Hmm…..remember we were still connected to PDBOBI. You can only create PDBs from root (and not even from pdb$seed). So connect to CDBROOTCDB$ROOT@YODA> show con_name
CON_NAME------------------------------PDBOBI
CDB$ROOT@YODA> create pluggable database PDBvader from PDBOBI FILE_NAME_CONVERT=('+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE','+PDBDATA');
Pluggable database created.
Private Database Cloud – Pluggable Database CDB
create pluggable database corasant as clone using '/u02/app/oracle/product/12.1.0/db/assistants/dbca/templates/Dagobah_ENDOR.xml' source_file_name_convert = ('+FRA/DAGOBAH/F13F13D3C04050F0E0430B2910AC5929/TEMPFILE/temp.281.838253631','+PDBDATA/corasant_temp01.dbf','+FRA/DAGOBAH/F13F13D3C04050F0E0430B2910AC5929/DATAFILE/users.282.838253665','+PDBDATA/corasant_users.dbf','+FRA/DAGOBAH/F13F13D3C04050F0E0430B2910AC5929/DATAFILE/sysaux.279.838253631','+PDBDATA/corasant_sysaux.dbf','+FRA/DAGOBAH/F13F13D3C04050F0E0430B2910AC5929/DATAFILE/system.280.838253631','+PDBDATA/corasant_system.dbf') NOCOPYFri Jan 31 01:58:04 2014This instance was first to open pluggable database CORASANT (container=5)This instance was first to open pluggable database CORASANT (container=5)Deleting old file#8 from file$Deleting old file#9 from file$Deleting old file#10 from file$Adding new file#17 to file$(old file#8)Adding new file#18 to file$(old file#9)Adding new file#19 to file$(old file#10)Successfully created internal service corasant at openALTER SYSTEM: Flushing buffer cache inst=2 container=5 local
Cloud Architectural AssessmentPick the architecture that best suits your needs
Business ValueInfrastructureConsolidation
DatabaseConsolidation
SchemaConsolidation
PDB Consolidation
Implementation Easy Easy Difficult* Easy
Application Suitability Some All Some Most
Isolation Highest High Limited High
Availability High Highest Highest Highest
Scalability Limited Excellent Excellent Excellent
Consolidation Density Low High Highest High
ROI Low High Highest High
RAC and PDB
Private Database Cloud – Pluggable Database RAC and Pluggable Databases• RAC Overview
• Clusterware Overview
• Server Pool Overview
Private Database Cloud – Pluggable Database RAC and PDB• Core Components
• RAC – provides scalability, availability and workload distribution
• Policy Managed Databases – logical separation of Servers and Databases
• Services• Each PDB has its default Service. Create additional Services to map workload and client access
• Services can be uniform or singleton
PDB-RAC Configuration
Disk1 Disk 2 Disk 3 Disk 4 Disk 5 Disk 6 Disk 7
Disk Group A Disk Group B
Database Database Database
File 1 File 2
File 3 File 4
ASM Cluster Pool of Storage
OracleRACServers
ASM Instance
ASM Instance
ASM Instance
ASM Instance
ASM Instance
Database Instance
Database Instance
Database Instance
Database Instance
Database Instance
1-1 ASM to Server
Shared Disk Groups
Oracle 12c: Pluggable DBs and Server Pools
Oracle Clusterware 12cR1Oracle Clusterware 12cR1
AR ServiceAR Service
AP ServiceAP Service
ERP SP
SALES ServiceSALES Service
Sales SP HR SP Free SP
Oracle PDBOracle PDBOracle PDBOracle PDB
OS ServiceOS Service
HR ServiceHR Service
Oracle CDB 12cR1Oracle CDB 12cR1
Oracle PDBOracle PDB
Oracle PDBOracle PDB
Oracle PDBOracle PDB
Private Database Cloud – Pluggable Database CDB • PDB most pragmatic in RAC configuration
• A PDB is essentially a RAC Service• RAC Services can be managed with Oracle Clusterware
WLM/QoS• PDBs can be RAC One Node or Multi-node RAC
• Policy Managed Configuration always greater multiple CDB
• Easily convert a single instance (12.1) database to RAC by simply plugging in SI db into CDB
• Oracle Clusterware Server Pools allow greater HA management and workload isolation• Allocate and map CDBs or Services to server pools
Viscosity is a group of experts
specializing in cloud architecture and
managed services.
Viscosity is a group of experts
specializing in cloud architecture and
managed services.
63
More detailed information is available at
viscosityna.com or by talking to a real
person at 469.444.1380
More detailed information is available at
viscosityna.com or by talking to a real
person at 469.444.1380
64