Simplify Consolidation with Oracle Database 12c Oracle Multitenant Maris Elsins Co-Authors: Marc Fielding, Alex Gorbachev and Oracle! September 18, 2013
Māris Elsiņš • 8y+ Oracle [Apps] DBA, 3y PL/SQL Developer • Oracle Applications DBA / TTL at Pythian • Oracle Certified Master • Oracle Certified Professional 9i, 10g, 11g, 11i, R12 • Frequent Speaker (15) UKOUG, OUGF, LVOUG, Collaborate, … • Blogger http://www.pythian.com/blog/author/elsins/ • MarisElsins, Maris.Elsins, , • FAN of BAAG (BattleAgainstAnyGuess.com) 2 © 2013 Pythian
Who is Pythian? • 15 Years of Data infrastructure management consulting • 170+ Top brands • 6000+ databases under management • Over 200 DBA’s, in 26 countries • Top 5% of DBA work force, 9 Oracle ACE’s, 2 Microsoft MVP’s • Oracle, Microsoft, MySQL partners, Netezza, Hadoop and MongoDB plus UNIX Sysadmin and Oracle apps © 2013 Pythian3
Agenda • Multitenant Architecture • Use cases and benefits © 2013 Pythian4
© 2013 Pythian5 Multitenant Architecture
Pre-12c Consolidation Options Share nothing • Each Database on it’s own server Share HW • Multiple virtual machines on the same HW Share HW and OS • Multiple databases on the same server Share HW, OS and DB • Multiple schemas in the same DB Flexibility Efficiency © 2013 Pythian6
Consolidation options today (12c) Share nothing • Each Database on it’s own server Share HW • Multiple virtual machines on the same HW Share HW and OS • Multiple databases on the same server Share HW, OS and DB • Multiple pluggable databases • Multiple schemas in the same DB Flexibility Efficiency © 2013 Pythian7 = Flexible and Efficient
Pre-12c Oracle Database Architecture Requires memory, processes and database files © 2013 Pythian8
12c Multitenant Architecture Memory and processes required at Container DB level only © 2013 Pythian9 PDBs Root Adding additional PDBs has only a little memory overhead
Files in the CDB • PDB owns – User TS data files – SYSTEM, SYSAUX – TEMP (optional) • Root owns – SYSTEM, SYSAUX – Redo logs – UNDO – TEMP – Control Files – (s)pfile © 2013 Pythian10
Users and Privileges • Local users – Defined only in one PDB – Connects to one PDB only – Same as user schemas in non-CDB • Common Users – Defined in Root – Present in all PDBs – Connects to PDBs where “create session” is granted – Starts with “C##” or “c##” Authorization is checked in the container where the SQL is attempted considering only the privileges that the user has in that container • Locally granted Privileges – Granted to any user in a PDB (or Root) – Applies to the PDB or Root only • Commonly granted Privileges – Only for common users – Common roles can be created – Applies to all PDBs © 2013 Pythian11
Plug / Unplug Unplug from the old CDB… © 2013 Pythian12
Plug / Unplug …and plug into the new CDB • PDBs are self-contained, only metadata need to be moved. • Upgrading and patching is a simple move from one CDB to another. © 2013 Pythian13
Plug / Unplug unplug… SQL> alter pluggable database PDB1 close immediate; Pluggable database altered. SQL> alter pluggable database PDB1 unplug into '/tmp/PDB1.xml'; Pluggable database altered. © 2013 Pythian14 SQL> create pluggable database PDB2 using '/tmp/PDB1.xml'; Pluggable database created. …plug
How to get to 12c Multitenant? • In-place Upgrade to 12cand plug into CDB • Migrate using Replication: – Create PDB from Seed – Use GG or DP to move data • Use Full Transportable Export / Import (DP) – copy all user data files – Export metadata from source – Import to an empty PDB – Export available in 11.2.0.3 © 2013 Pythian15
CDB is Like a single database • One Instance • One buffer cache and shared pool • One set of background processes • Can be backed up all at once • Can be Data Guard all at once • Supports hundreds of applications in one CDB • Do RMAN, data guard configuration once • Global resource management © 2013 Pythian16
CDB are Like Separate Databases • Isolation of different applications • No application changes required for consolidation • Support for public synonyms without conflicts • PDBs can be backed up individually • startup / shutdown / recover PDBs individually • Internal PDB resource management • A client is unable to tell if it’s a PDB or a non-CDB © 2013 Pythian17
Limitations of a Multitenant Architecture • Same version/patches for all PDBs • Limited ability to manage settings for each PDB – Memory tuning for individual PDBs – Some parameters can’t be set at PDB level. (local_listener, diagnostic_dest) • The same character set for all DBs • Some operations don’t work within the CDB – RMAN DUPLICATE to clone a PDB • Maximum of 252 PDBs (too many?) • Cloning a PDB requires the source to be in read only mode © 2013 Pythian18
© 2013 Pythian19 Use Cases and Benefits
Manage as one • Backups – Backup whole CDB as one – Restore/recover the whole CDB or PDBs individually. • Data Guard – Configure Data guard for the whole CDB at once – Database roles are associated at CDB level. – Switch/Fail-over happens for the whole CDB – Role changes at PDB level are not possible. © 2013 Pythian20
Patch as one • Install patches once per CDB • Effective in all PDBs immediately © 2013 Pythian21
Upgrade as one The old version CDB The new version CDB © 2013 Pythian22
Simple cloning Locally SQL> create pluggable database test2 from test1; Pluggable database created. © 2013 Pythian23 Remotely using a DB Link SQL> create pluggable database test2 from test1@remote; Pluggable database created. • The source PDB has to be in read-only mode Storage snapshot ( on ACFS, ZFS Storage Appliance or NetApp?) SQL> create pluggable database test2 from test1 snapshot copy; Pluggable database created.
Multitenant works with RAC • Same efficiency – one CDB instance per server • RAC = Avoid downtime caused by node failures • Advanced features – Oracle Database Quality of Service Management – Application Continuity • Agility With Changing Workloads and Requirements – No need to plan ahead which nodes the PDB is running on – RAC, DG are features of CDB, plug the same PDB to enable these features © 2013 Pythian24
Mixed Workloads • OLTP peak time is day • DWH peak time is night • Pre-12c DBs – high resource allocation for peak use – Low resource usage during non-peak activity • OLTP + DWH in the same CDB on the same Hardware = efficient use of resources © 2013 Pythian25 0 20 40 60 80 100 day night day OLTP 0 50 100 150 200 Pre-12c 0 50 100 150 day night day 12c 0 20 40 60 80 100 day night day DWH
Perfect for Private Clouds • Creating a DB – Rapid provisioning • From Seed • From pre-created DB • Into the requested configuration – Simplified cloning – Quick cloning with copy-on- write snapshots • Improved and Simplified AaaS • Finally! DBaaS! © 2013 Pythian26 0 5 10 15 20 25 Non CDB PDB Clone PDB using Copy-on-Write File System Time Taken to Provision New Database (minutes)
© 2013 Pythian27 Summary
Benefits • Saving resources • Plug/unplug entire PDB database • Rapid PDB cloning and provisioning • Separation of roles (PDB admin vs CDB admin) • Resource management • Recovery of individual PDBs • Quick starting / stopping of PDBs • Agility © 2013 Pythian28
Feature Availability • Multitenant – Enterprise Edition only – Extra cost option • Singletenant – CDB with one PDB • Useful for upgrades (Full Transportable Exp / Imp) • Ability to use (un)plug feature without consolidation – SE1 / SE / EE – No Extra Cost © 2013 Pythian29
License costs. • List prices (August 16, 2013) per CPU 1. Oracle Multitenant 17,500$ 2. Database Enterprise Edition 47,500$ 3. Real Application Clusters 23,000$ 4. Diagnostic Pack 5,000$ 5. Tuning Pack 5,000$ 6. Partitioning 11,500$ 7. Cloud File System 5,000$ • +37% in addition to EE • +19% in addition to EE + RAC + Part + Diag + Tun © 2013 Pythian30
© 2013 Pythian31

Simplify Consolidation with Oracle Database 12c

  • 1.
    Simplify Consolidation with OracleDatabase 12c Oracle Multitenant Maris Elsins Co-Authors: Marc Fielding, Alex Gorbachev and Oracle! September 18, 2013
  • 2.
    Māris Elsiņš • 8y+Oracle [Apps] DBA, 3y PL/SQL Developer • Oracle Applications DBA / TTL at Pythian • Oracle Certified Master • Oracle Certified Professional 9i, 10g, 11g, 11i, R12 • Frequent Speaker (15) UKOUG, OUGF, LVOUG, Collaborate, … • Blogger http://www.pythian.com/blog/author/elsins/ • MarisElsins, Maris.Elsins, , • FAN of BAAG (BattleAgainstAnyGuess.com) 2 © 2013 Pythian
  • 3.
    Who is Pythian? •15 Years of Data infrastructure management consulting • 170+ Top brands • 6000+ databases under management • Over 200 DBA’s, in 26 countries • Top 5% of DBA work force, 9 Oracle ACE’s, 2 Microsoft MVP’s • Oracle, Microsoft, MySQL partners, Netezza, Hadoop and MongoDB plus UNIX Sysadmin and Oracle apps © 2013 Pythian3
  • 4.
    Agenda • Multitenant Architecture •Use cases and benefits © 2013 Pythian4
  • 5.
  • 6.
    Pre-12c Consolidation Options Share nothing •Each Database on it’s own server Share HW • Multiple virtual machines on the same HW Share HW and OS • Multiple databases on the same server Share HW, OS and DB • Multiple schemas in the same DB Flexibility Efficiency © 2013 Pythian6
  • 7.
    Consolidation options today(12c) Share nothing • Each Database on it’s own server Share HW • Multiple virtual machines on the same HW Share HW and OS • Multiple databases on the same server Share HW, OS and DB • Multiple pluggable databases • Multiple schemas in the same DB Flexibility Efficiency © 2013 Pythian7 = Flexible and Efficient
  • 8.
    Pre-12c Oracle DatabaseArchitecture Requires memory, processes and database files © 2013 Pythian8
  • 9.
    12c Multitenant Architecture Memoryand processes required at Container DB level only © 2013 Pythian9 PDBs Root Adding additional PDBs has only a little memory overhead
  • 10.
    Files in theCDB • PDB owns – User TS data files – SYSTEM, SYSAUX – TEMP (optional) • Root owns – SYSTEM, SYSAUX – Redo logs – UNDO – TEMP – Control Files – (s)pfile © 2013 Pythian10
  • 11.
    Users and Privileges •Local users – Defined only in one PDB – Connects to one PDB only – Same as user schemas in non-CDB • Common Users – Defined in Root – Present in all PDBs – Connects to PDBs where “create session” is granted – Starts with “C##” or “c##” Authorization is checked in the container where the SQL is attempted considering only the privileges that the user has in that container • Locally granted Privileges – Granted to any user in a PDB (or Root) – Applies to the PDB or Root only • Commonly granted Privileges – Only for common users – Common roles can be created – Applies to all PDBs © 2013 Pythian11
  • 12.
    Plug / Unplug Unplugfrom the old CDB… © 2013 Pythian12
  • 13.
    Plug / Unplug …andplug into the new CDB • PDBs are self-contained, only metadata need to be moved. • Upgrading and patching is a simple move from one CDB to another. © 2013 Pythian13
  • 14.
    Plug / Unplug unplug… SQL>alter pluggable database PDB1 close immediate; Pluggable database altered. SQL> alter pluggable database PDB1 unplug into '/tmp/PDB1.xml'; Pluggable database altered. © 2013 Pythian14 SQL> create pluggable database PDB2 using '/tmp/PDB1.xml'; Pluggable database created. …plug
  • 15.
    How to getto 12c Multitenant? • In-place Upgrade to 12cand plug into CDB • Migrate using Replication: – Create PDB from Seed – Use GG or DP to move data • Use Full Transportable Export / Import (DP) – copy all user data files – Export metadata from source – Import to an empty PDB – Export available in 11.2.0.3 © 2013 Pythian15
  • 16.
    CDB is Likea single database • One Instance • One buffer cache and shared pool • One set of background processes • Can be backed up all at once • Can be Data Guard all at once • Supports hundreds of applications in one CDB • Do RMAN, data guard configuration once • Global resource management © 2013 Pythian16
  • 17.
    CDB are LikeSeparate Databases • Isolation of different applications • No application changes required for consolidation • Support for public synonyms without conflicts • PDBs can be backed up individually • startup / shutdown / recover PDBs individually • Internal PDB resource management • A client is unable to tell if it’s a PDB or a non-CDB © 2013 Pythian17
  • 18.
    Limitations of aMultitenant Architecture • Same version/patches for all PDBs • Limited ability to manage settings for each PDB – Memory tuning for individual PDBs – Some parameters can’t be set at PDB level. (local_listener, diagnostic_dest) • The same character set for all DBs • Some operations don’t work within the CDB – RMAN DUPLICATE to clone a PDB • Maximum of 252 PDBs (too many?) • Cloning a PDB requires the source to be in read only mode © 2013 Pythian18
  • 19.
    © 2013 Pythian19 UseCases and Benefits
  • 20.
    Manage as one •Backups – Backup whole CDB as one – Restore/recover the whole CDB or PDBs individually. • Data Guard – Configure Data guard for the whole CDB at once – Database roles are associated at CDB level. – Switch/Fail-over happens for the whole CDB – Role changes at PDB level are not possible. © 2013 Pythian20
  • 21.
    Patch as one •Install patches once per CDB • Effective in all PDBs immediately © 2013 Pythian21
  • 22.
    Upgrade as one Theold version CDB The new version CDB © 2013 Pythian22
  • 23.
    Simple cloning Locally SQL> createpluggable database test2 from test1; Pluggable database created. © 2013 Pythian23 Remotely using a DB Link SQL> create pluggable database test2 from test1@remote; Pluggable database created. • The source PDB has to be in read-only mode Storage snapshot ( on ACFS, ZFS Storage Appliance or NetApp?) SQL> create pluggable database test2 from test1 snapshot copy; Pluggable database created.
  • 24.
    Multitenant works withRAC • Same efficiency – one CDB instance per server • RAC = Avoid downtime caused by node failures • Advanced features – Oracle Database Quality of Service Management – Application Continuity • Agility With Changing Workloads and Requirements – No need to plan ahead which nodes the PDB is running on – RAC, DG are features of CDB, plug the same PDB to enable these features © 2013 Pythian24
  • 25.
    Mixed Workloads • OLTPpeak time is day • DWH peak time is night • Pre-12c DBs – high resource allocation for peak use – Low resource usage during non-peak activity • OLTP + DWH in the same CDB on the same Hardware = efficient use of resources © 2013 Pythian25 0 20 40 60 80 100 day night day OLTP 0 50 100 150 200 Pre-12c 0 50 100 150 day night day 12c 0 20 40 60 80 100 day night day DWH
  • 26.
    Perfect for PrivateClouds • Creating a DB – Rapid provisioning • From Seed • From pre-created DB • Into the requested configuration – Simplified cloning – Quick cloning with copy-on- write snapshots • Improved and Simplified AaaS • Finally! DBaaS! © 2013 Pythian26 0 5 10 15 20 25 Non CDB PDB Clone PDB using Copy-on-Write File System Time Taken to Provision New Database (minutes)
  • 27.
  • 28.
    Benefits • Saving resources •Plug/unplug entire PDB database • Rapid PDB cloning and provisioning • Separation of roles (PDB admin vs CDB admin) • Resource management • Recovery of individual PDBs • Quick starting / stopping of PDBs • Agility © 2013 Pythian28
  • 29.
    Feature Availability • Multitenant –Enterprise Edition only – Extra cost option • Singletenant – CDB with one PDB • Useful for upgrades (Full Transportable Exp / Imp) • Ability to use (un)plug feature without consolidation – SE1 / SE / EE – No Extra Cost © 2013 Pythian29
  • 30.
    License costs. • Listprices (August 16, 2013) per CPU 1. Oracle Multitenant 17,500$ 2. Database Enterprise Edition 47,500$ 3. Real Application Clusters 23,000$ 4. Diagnostic Pack 5,000$ 5. Tuning Pack 5,000$ 6. Partitioning 11,500$ 7. Cloud File System 5,000$ • +37% in addition to EE • +19% in addition to EE + RAC + Part + Diag + Tun © 2013 Pythian30
  • 31.