Upload
donga
View
276
Download
3
Embed Size (px)
Citation preview
Oracle MultitenantWhat’s new in Oracle Database 12c Release 12.1.0.2?
Saurabh K. Gupta
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Saurabh K. GuptaPrincipal Technologist, Database Product Management
Who am I?
• Principal Technologist, Database Product Management at Oracle
• Author of Packt’s “Oracle Advanced PL/SQL Developer Professional
Guide”, Technical Reviewer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
• Blog: www.sbhoracle.wordpress.com
• Social: @SAURABHKG
• Email: [email protected]
3
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
A new architecture for consolidating databases and simplifying operations
Oracle Multitenant
GL OE
APSelf-contained PDB for each application
• Applications run unchanged
• Rapid provisioning (via clones)
• Portability (via pluggability)PDBs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Common operations performed at CDB level
• Manage many as one
(upgrade, HA, backup)
• Granular control when appropriate
Shared memory and background processes
• More applications per serverComplementary to VMs
Root
CDB
Why Consolidate?Key is to maximize productive use of resources
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Unconsolidated
• Overheads replicated for each workload
• Competing workloads interfere with each other
• Net throughput is limited and gridlock is possible
Consolidated
• Single, shared set of overheads
• Greatly reduced competition between workloads
• Improved throughput and good response time
Multitenant New Features in 12.1.0.2
• Subset by tablespace
• Metadata-only clone
• Remote clone (including snapshots)
• File system-agnostic cloning via dNFS (clonedb = true)
• New SQL clause to aggregate data across PDBs
select ENAME from containers(scott.EMP)where CON_ID in (45, 49);
Cloning
SQL
Cross PDB Queries
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
dNFS (clonedb = true)
• New “standbys” clause (all | none)
• Nologging clause at PDB level
• Flashback data archive
• Temporal SQL Support
• Maintains state of PDBs between CDB restarts
• Compatible with DB In-Memory
Cloning Cross PDB Queries
Standby & Logging
PRIMARY STANDBY
AdditionalFeatures
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
Multitenant for ProvisioningFast cloning of PDBs
GL-2GL-1 AP-1 AP-2 PO-1
• PDBs can be cloned from
remote CDBs
• PDBs can be cloned from
within the same CDB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
GL OE AP PO
remote CDBs
• Thinly provision snapshot
clones in seconds
• PDBs can be cloned from
non-CDBs
Subset Conversion : USER_TABLESPACE clauseNew Features in 12.1.0.2
• Convert cumbersome schema based consolidations to
• create pluggable database USER_TABLESPACE= NONE | ALL |
• Allows a user to specify which tablespaces need to be available in the
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
consolidations to much more agile and efficient PDBs
Why ?
= NONE | ALL | (‘tbs1’, ‘tbs2’)
How ?
be available in the new PDB
What ?
Subset Conversion : USER_TABLESPACE clause
SQL> create pluggable database PDB_TBS1 from PDB1 file_name_convert=('pdb1','pdb_tbs1') user_tablespaces=('tbs1');
Pluggable database created.
SQL> alter pluggable database PDB_TBS1 open;
Demonstration
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Pluggable database altered.
SQL> conn scott/tiger@db12cvm1:1521/pdb_tbs1Connected.
SQL> select tablespace_name, status from user_tablespaces;
TABLESPACE_NAME STATUS------------------------- ---------USERS OFFLINETBS1 ONLINETBS2 OFFLINE
Post clean-up operations are required for database consistency
Subset Conversion : Metadata only cloneNew Features in 12.1.0.2
• Facilitate rapid provisioning of development environments
• create pdbX from pdbY no data;
• Create a clone of a PDB with only the data model but no data
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
environments
Why ? How ?
data
What ?
Subset Conversion : Metadata only clone
SQL> create pluggable database PDB_NODATA from PDB1 file_name_convert=('pdb1','pdb_nodata') no data;
Demonstration
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Pluggable database created.
Remote Clone a Non-CDB as a PDB
New Features in 12.1.0.2
• Remote cloning is fully supported in 12.1.0.2.
• Create PDB from NON$CDB@dblink
• Adopt non-CDB as PDB by cloning over database link
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Why ? How ?What ?
Remote Clone a Non-CDB as a PDB
SQL> create pluggable database PDB_ORCL from NON$CDB@orclfile_name_convert=(‘orcl',’pdb_orcl');
Pluggable database created.
Non-Container Database
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Pluggable database created.
SQL> alter session set container = pdb_orcl;
Session altered.
SQL>$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
Manage Many Databases as One with MultitenantOne standby database covers all pluggable databases
GL OE AP GL OE AP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Production Container Database
GL OE AP GL OE
Standby Container Database
AP
STANSBYS clause
• New STANDBYS=NONE clause in 12.1.0.2
• Allows you to plug in a PDB at the primaryand defer the work at the standbys
–New PDB at standby is created with offline data files
Plugging in a PDB - 12.1.0.2
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
–New PDB at standby is created with offline data files
– Redo apply keeps running, new PDB redo is ignored
– You sort out the data files at the standbywhen ready to ENABLE RECOVERY
– Has no impact on Role Transitions
• Full instructions and procedures can be found at:–Making Use of the STANDBYS=NONE Feature (Doc ID 1916648.1)
20
STANDBYS clause
SQL> create pluggable database PDB_DMY from PDB_FIN tempfile reuseSTANDBYS=NONE;
Plugging in a PDB – 12.1.0.2
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB_FIN READ ONLY NO
4 PDB_DMY MOUNTED
STANDBY
STANDBYS clause
SQL> select name, recovery_status from v$pdbs;
NAME RECOVERY
------------------------------ --------
PDB$SEED ENABLED
PDB_FIN ENABLED
How the PDB appears on the STANDBY?
STANDBY
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
PDB_FIN ENABLED
PDB_DMY DISABLED
SQL> select name, status from v$datafile;
NAME STATUS
----------------------------------------------------------------- -------
/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/UNNAMED00004 SYSOFF
/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/UNNAMED00005 RECOVER
/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/UNNAMED00006 RECOVER
STANDBYS clause
• Restore the PDB datafiles from primary to standby– RMAN preferred as it will rename the datafiles in the standby control file.
• Enable recovery on PDB– Restart standby database in mount mode and disable the redo apply in broker
PDB plug in at the STANDBY (Doc ID 1916648.1)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
– Restart standby database in mount mode and disable the redo apply in broker
– ALTER PLUGGABLE DATABASE ENABLE RECOVERY
– Enable the redo apply of physical standby in Data Guard broker
SQL> select name, status from v$datafile;
NAME STATUS
------------------------------------------------------------------------------------- -------
+DATA/YODASTBY/0063D458AAACA633E0537A28890A6CD1/DATAFILE/system.296.855397779 SYSTEM+DATA/YODASTBY/0063D458AAACA633E0537A28890A6CD1/DATAFILE/sysaux.365.855397781 RECOVER
+DATA/YODASTBY/0063D458AAACA633E0537A28890A6CD1/DATAFILE/users.293.855397807 RECOVER
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
CONTAINERS ClauseNew Features in 12.1.0.2
• Provide a way to aggregate user created data from multiple PDBs in the same container
• select ENAME from containers(scott.EMP) Where CON_ID in (45, 49);
• With the containers clause data can be aggregated from identical tables/views across many PDBs from
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
container
Why ? How ?
across many PDBs from the root container
What ?
Data WarehouseMultitenant architecture approach
Co
un
try
1
DW
H /
LD
S Analytical Layer Countries
access PDBs
Reg 1 Reg 2 Reg 3 Reg 4 Reg N
Co
un
try
2
DW
H /
LD
S
Co
un
try
3
DW
H /
LD
S…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Analytical Layer
Group
access PDBs through CDB without DB linksGroup Level DWH - GDS
Reg 1 Reg 2 Reg 3 Reg 4 Reg N
common data modelcommon data model
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
Faster PDB StartupsNew Features in 12.1.0.2
• Reduce Application Downtime in planned or Unplanned Outages
• alter pluggable database pdb1 save|discard state
• New clause to preserve PDBs’ open mode across CDB restarts
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Unplanned Outages
Why ? How ?
CDB restarts
What ?
Faster PDB StartupsSQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO4 PDB_NODATA READ WRITE NO
SQL> ALTER PLUGGABLE DATABASE pdb_nodata SAVE STATE;SQL> shutdown
SQL> startup
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
SQL> startup
SQL> SELECT con_name, instance_name, state FROM dba_pdb_saved_states;
CON_NAME INSTANCE_NAME STATE
-------------------- -------------------- --------------
PDB_NODATA cdb1 OPEN
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO4 PDB_NODATA MOUNTED NO
PDB File placement in OMFNew Features in 12.1.0.2
• Allow faster unplug / plug of PDBs across containers
• CREATE_FILE_DESTallows administrators to set a default
• PDB data file structure independent of the container database
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Why ?
set a default location for data files in the PDB
How ?
container database file destination
What ?
• Consolidation with Multitenant frees up
– Memory
– CPU Cycles
• Oracle Database In-Memory wants
– Memory
– CPU Cycles
Database In-Memory Works (Better) with Multitenant
AP
Multitenant consolidation “gives back” resources that DB In-Memory needs
DB In-Memory
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
GL OE
AP
Column Format
Order Fact
DB In-Memory
In-Memory and Multitenant
GL OE AP
INMEMORY_SIZE
= 16GB
INMEMORY_SIZE
= 4GB
INMEMORY_SIZE
= 0GB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
INMEMORY_SIZE
= 20GB
Agenda
Multitenant Architecture Overview
Enhancements to Cloning
Standbys
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Standbys
Cross-Container Aggregation
Additional Features
Use Cases
3
4
5
6
Multitenant for Development and TestingFast, flexible copy and snapshot of pluggable databases
GL OE APGL
MasterGL
(Dev2)
GL (Dev1)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Development Container DatabaseProduction Container Database
GL OE AP Master (Dev2)(Dev1)
GOLD✔
Oracle Multitenant for Database as a ServicePick from standard sizes and service levels
RAC, Data Guard
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
✔8
✔
SILVER
BRONZE✔
RAC
Backupssmall
large
medium
✔
8
Consolidation of Disparate ApplicationsSimplify, standardize, reduce risk, lower costs and upgrade SLAs with Multitenant
Scalability and High Availability Limited
11g
9i
11g
10g
11g
10g
MySQL SQL Server
Oracle Conversion Utilities
“Deferred” Maintenance:
12c
12c
12c
12c
12c
12c
DatabasesTo Manage
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Available Capacity
SIL
VE
R
Oracle Database 12c – Multitenant Container Database – Silver SLA
“Deferred” Maintenance:• Behind on Patches• Seldom Backed Up
Multitenancy implemented by the Database, not the Application
Oracle Multitenant for Software as a Service
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Customer 1 Customer 2 Customer 3 Customer 4 Customer 5 Customer 6 Customer 7
Multitenant. Perfect for ISVsPackaged apps and reference data are easily distributed
OE AP
Jolt!
v8.2
Jolt!
v8.2
Jolt!
V7.3
Jolt!
V6.1
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Jolt! Applications CorporationDevelopment Container Database
OE AP
Customer Container Database
GL APJolt!
v7.3Jolt!
v8.2
Plug Into the Cloud with Oracle MultitenantA pluggable database is a portable database – easy to migrate to the cloud
GL OE APGL
MasterGL
(Dev2)
GL (Dev1)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Cloud-Based Container DatabaseOn-Premises Container Database
GL OE AP Master (Dev2)(Dev1)
Analytics Sandbox ProvisioningProvision in an instant; analyze at the speed of thought
DW
ProductDimension
Order Region
IndustryDimension
Order
ProductDimension
Order Region
IndustryDimension
OrderRegion
IndustryDimension
Order
DB In-Memory
Production Data Warehouse Read-Writeable Analytics Sandbox
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
OrderItem Fact
Partitions QuarterDimension
RegionDimension
OrderFact
OrderItem Fact
Partitions QuarterDimension
RegionDimension
OrderFact
QuarterDimension
RegionDimension
OrderFact
Column Format
Order Fact
Thinly-Provisioned Sandbox• Either full data set• Or subset by Partition
and/or Table
Multitenant New Features in 12.1.0.2
• Subset by tablespace
• Metadata-only clone
• Remote clone (including snapshots)
• File system-agnostic cloning via dNFS (clonedb = true)
• New SQL clause to aggregate data across PDBs
select ENAME from containers(scott.EMP)where CON_ID in (45, 49);
Cloning
SQL
Cross PDB Queries
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
dNFS (clonedb = true)
• New “standbys” clause (all | none)
• Nologging clause at PDB level
• Flashback data archive
• Temporal SQL Support
• Maintains state of PDBs between CDB restarts
• Compatible with DB In-MemoryStandby & Logging
PRIMARY STANDBY
AdditionalFeatures
Key Benefits
Benefit Capability Enabled
Minimize CapEx • More applications per server
Minimize OpEx• Manage many as one (reduced patching!)
• Standardized procedures & service levels
• Enable self-service provisioning
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
• Enable self-service provisioning
Maximize Agility• Snapshot cloning for development and testing
• Portability through “pluggability”
• Scalability with RAC
Easy• To Adopt: Applications run unchanged
• To Use: Interface is SQL
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |