* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download PDB-DeepDive - DBCloudShifu
Survey
Document related concepts
Entity–attribute–value model wikipedia , lookup
Commitment ordering wikipedia , lookup
Global serializability wikipedia , lookup
Microsoft Access wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Serializability wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Functional Database Model wikipedia , lookup
Ingres (database) wikipedia , lookup
Oracle Database wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Relational model wikipedia , lookup
Concurrency control wikipedia , lookup
Database model wikipedia , lookup
Transcript
Private Database Cloud Database Consolidation Deep Dive in PDB Nitin Vengurlekar Viscosity – CTO/Cloud Evangelist Charles Kim Viscosity – CEO/Oracle Architect @dbcloudshifu @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 Source: NIST Definition of Cloud Computing v15 3 Service Models • SaaS • PaaS • IaaS 4 Deployment Models • Public Cloud • Private Cloud • Community Cloud • Hybrid Cloud Customers Have a Choice of Clouds • Own & Operate, Use Managed Services, Subscribe Private Cloud Managed Cloud Services Public Cloud Build Managed 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 • IaaS, PaaS or SaaS Developer Customizations Application Application Business End User Customizations Platform Service Provider SaaS Cloud IaaS Cloud PaaS Cloud Consumer IT Professional Customizations Service Provider Consumer Different Users Source-Oracle Database Cloud Business Drivers Lower: • CapEx • Servers • Storage •OpEx • Maintenance • Management Enable: • Online changes • Rapid response • Faster Time to market Reduce IT Costs Increase Agility Reduce Complexity Reduce: • Configurations • Services Standardize: • OS • DB Versions Increase Quality of Service Enhance: • IT service time • Availability • Security Source-Oracle Private Database Cloud Architectures Common building blocks are shared server and storage pools DB OS Hypervisor ERP CRM DW ERP CRM DB DB OS DW Database Cloud DB ERP DB CRM Database Cloud DB DW DB Infrastructure Cloud OS Hypervisor Platform Platform Server Consolidation Database Consolidation Deploy in dedicated VMs Server virtualization Share server pool Real Application Clusters Platform Platform Schema Consolidation Share database instances Real Application Clusters Source-Oracle Infrastructure Cloud Server - 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 DB CRM DB ERP DW DB – Consolidation density – Good ROI – Performance – Supports any app • Customer concerns – Requires OS standardization – Database only OS OS Source-Oracle Private Database Cloud Database – Provision Schema • Reasons for adoption DW • Customer concerns – App qualification required – Requires OS and DB standardization – Isolation • • • • ERP CRM DB – Most efficient – Extremely fast provisioning – Best ROI – Performance – Efficient memory use OS OS Performance - Resource Management Security Availability Operational - Namespace issues Source-Oracle Next Generation Consolidation Pluggable Database - Database/Schema Source-Oracle Private Database Clouds New in 12c – Provision a PDB in a Container DB • 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 DW CRM ERP PDB PDB PDB CDB 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 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 ---------2 3 NAME -------------------PDB$SEED PDBOBI OPEN_MODE ---------READ ONLY 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 Database A 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. 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.d bf', '+FRA/DAGOBAH/F13F13D3C04050F0E0430B2910AC5929/DATAFILE/system.280.838253631','+PDBDATA/corasant_system.d bf') NOCOPY Fri Jan 31 01:58:04 2014 This 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 open ALTER SYSTEM: Flushing buffer cache inst=2 container=5 local Cloud Architectural Assessment Pick the architecture that best suits your needs Business Value Infrastructure Consolidation Database Consolidation Schema PDB Consolidation 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 High Highest High Low 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 Database Instance Database Instance Database Instance ASM Instance ASM Instance ASM Instance Database Instance Database Instance ASM Instance ASM Instance 1-1 ASM to Server Oracle RAC Servers Shared Disk Groups Database Database Database ASM Cluster Pool of Storage Disk Group B Disk Group A Disk1 Disk 2 File 3 File 4 File 1 File 2 Disk 3 Disk 4 Disk 5 Disk 6 Disk 7 Oracle 12c: Pluggable DBs and Server Pools SALES Service Sales SP Oracle PDB AP Service HR Service AR Service OS Service ERP SP HR SP Oracle PDB Oracle PDB Oracle PDB Oracle PDB Oracle CDB 12cR1 Oracle Clusterware 12cR1 Free SP 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. 63 More detailed information is available at viscosityna.com or by talking to a real person at 469.444.1380 64