31
Simplify Consolidation with Oracle Database 12c Oracle Multitenant Maris Elsins Co-Authors: Marc Fielding, Alex Gorbachev and Oracle! September 18, 2013

Simplify Consolidation with Oracle Database 12c

Embed Size (px)

DESCRIPTION

My presentation at Oracle Tech Day in Riga, Latvia on September 18th, 2013. Introduction to Oracle 12c Multitenant option.

Citation preview

Page 1: Simplify Consolidation with Oracle Database 12c

Simplify Consolidation with Oracle Database 12cOracle Multitenant

Maris Elsins

Co-Authors: Marc Fielding, Alex Gorbachev and Oracle!

September 18, 2013

Page 2: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian2

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)

Page 3: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian3

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

Page 4: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian4

Agenda• Multitenant Architecture• Use cases and benefits

Page 5: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian5

Multitenant Architecture

Page 6: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian6

Pre-12c Consolidation OptionsShar

e 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

Page 7: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian7

Consolidation options today (12c)Shar

e 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 = Flexible and Efficient

Page 8: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian8

Pre-12c Oracle Database ArchitectureRequires memory, processes and database files

ERPMemory

BackgroundProcesses

DatabaseFiles

CRMMemory

BackgroundProcesses

DatabaseFiles

DWMemory

BackgroundProcesses

DatabaseFiles

Page 9: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian9

12c Multitenant ArchitectureMemory and processes required at Container DB level only

Container Database

PDBs

Root

Adding additional PDBs has only a little memory overhead

Page 10: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian10

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

Page 11: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian11

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

Page 12: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian12

Plug / UnplugUnplug from the old CDB…

Page 13: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian13

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.

Page 14: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian14

Plug / Unplugunplug…SQL> alter pluggable database PDB1 close immediate;

Pluggable database altered.

SQL> alter pluggable database PDB1 unplug into '/tmp/PDB1.xml';

Pluggable database altered.

SQL> create pluggable database PDB2 using '/tmp/PDB1.xml';

Pluggable database created.

…plug

Page 15: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian15

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

Page 16: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian16

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

Page 17: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian17

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

Page 18: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian18

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

Page 19: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian19

Use Cases and Benefits

Page 20: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian20

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.

Page 21: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian21

Patch as one• Install patches once per CDB• Effective in all PDBs

immediately

Multitenant Container Database

DW12.1

CRM

12.1

ERP

12.1

12.X

12.X

12.X

Page 22: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian22

Upgrade as oneThe old version CDB The new version CDB

Original Container Database (12.1) Upgraded Container Database (12.X)

DW

12.X

CRM

12.X

DW12.1

CRM

12.1

ERP

12.1

Page 23: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian23

Simple cloning

LocallySQL> create pluggable database test2 from test1;

Pluggable database created.

Remotely using a DB LinkSQL> 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.

Page 24: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian24

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

Page 25: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian25

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

day night day0

50

100

OLTP

0

50

100

150

200

Pre-12c

day night day0

50

100

150

12c

day night day0

50

100

DWH

Page 26: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian26

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!

0

10

20

Time Taken to Provision New Database (minutes)

Page 27: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian27

Summary

Page 28: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian28

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

Container Database

Page 29: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian29

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

Page 30: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian30

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

Page 31: Simplify Consolidation with Oracle Database 12c

© 2013 Pythian31

?