610 likes | 630 Views
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
E N D
Private Database CloudDatabase 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: • 5 Essential Characteristics • On-demand self-service • Resource pooling • Rapid elasticity • Measured service • Broad network access • 4 Deployment Models • Public Cloud • Private Cloud • Community Cloud • Hybrid Cloud • 3 Service Models • SaaS • PaaS • IaaS Source: NIST Definition of Cloud Computing v15
Customers Have a Choice of Clouds Private Cloud Managed Cloud Services Public Cloud Build Managed Subscribe • Own & Operate, Use Managed Services, Subscribe Customer owns, hosts and manages. Customer owns.Service provider manages.Either may host. Customer subscribes.Service provider hosts and manages. Source-Oracle
Customers Have a Choice of Clouds Different Users IT Professional Developer Business End User Customizations Customizations Customizations Consumer • IaaS, PaaS or SaaS Application Application Consumer Platform Service Provider ServiceProvider SaaS Cloud PaaS Cloud IaaS Cloud Source-Oracle
Database Cloud Business Drivers Lower: • CapEx • Servers • Storage • OpEx • Maintenance • Management Reduce: • Configurations • Services Standardize: • OS • DB Versions Enable: • Online changes • Rapid response • Faster Time to market Enhance: • IT service time • Availability • Security Source-Oracle
Private Database Cloud Architectures Common building blocks are shared server and storage pools Infrastructure Cloud Database Cloud Database Cloud DW CRM ERP DW ERP CRM DW ERP CRM DB DB DB DB OS OS OS DB DB DB Hypervisor Hypervisor Platform Platform Platform Platform Database Consolidation Share server pool Real Application Clusters Server Consolidation Deploy in dedicated VMs Server virtualization Schema Consolidation Share database instances Real Application Clusters 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 DW ERP CRM • Reasons for adoption • Consolidation density • Good ROI • Performance • Supports any app • Customer concerns • Requires OS standardization • Database only DB DB DB OS OS Source-Oracle
Private Database CloudDatabase – Provision Schema DW ERP CRM • 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 DB OS OS Source-Oracle
Next Generation ConsolidationPluggable Database - Database/Schema Source-Oracle
Private Database CloudsNew in 12c – Provision a PDB in a Container DB DW CRM ERP PDB PDB PDB CDB • 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
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 CDB First verify that we are truly on 12c Oracle database SQL> 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_name • CON_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 youcanseethat PDB$SEED houses the template tablespaces -> System, Sysaux, and Undo tablespaces • The SEED databaseisused 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 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 / plug unplug into '/u01/app/oracle/oradata/endor.xml' create pluggable database Endor using '/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 CDBROOT CDB$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.