08448380779 Call Girls In Civil Lines Women Seeking Men
TechEvent 18c Multitenant New Features
1. BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA
HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH
Oracle 18c – Multitenant New Features
Markus Flechtner
2. About me .. Markus Flechtner
Principal Consultant, Trivadis, Duesseldorf/Germany, since April 2008
Discipline Manager Infrastructure Database @Trivadis
Working with Oracle since the 1990’s
– Development (Forms, Reports, PL/SQL)
– Support
– Database Administration
Focus
– Oracle Real Application Clusters
– Database Upgrade and Migration Projects
Teacher
– O-RAC – Oracle Real Application Clusters
– O-NF12CDBA – Oracle 12c New Features for the DBA
– O-MT – Oracle Multitenant
Blog:
https://markusdba.net/
@markusdba
26.09.2018 Oracle 18c – Multitenant New Features5
3. 26.09.2018 Oracle 18c – Multitenant New Features6
Technology on its own won't help you.
You need to know how to use it properly.
4. Remember …
Oracle 18c – Multitenant New Features7 26.09.2018
Oracle 18c = Patchset Oracle 12.2.0.2
Do not expect too many new features!
5. Agenda
Oracle 18c – Multitenant New Features8 26.09.2018
1. Overview: Oracle Multitenant (for those who still don't know it)
2. Backup (RMAN) related features
3. Security
4. Exadata & Oracle Cloud only features
5. DataGuard
6. Miscellaneous
7. Summary
7. Proven architecture with pre 12c functionality – deprecated since Oracle 12.1.0.2
User and system metadata mixed in one SYSTEM tablespace
Time to transport user tablespaces depends on the amount of objects
Limitations for database consolidation:
– User/tablespace/role names, public synonyms/grants, database directories,…
PMON SMON LGWR DBW0 DIAG …
SYSTEM SYSAUX DATA IDX
System Metadata
OBJ$ COL$
UNDO
TAB$
User Metadata
EMP DEPT HR
SH
Non-Container 12c Database (Non-CDB) Architecture
Oracle 18c – Multitenant New Features10 26.09.201826.09.2018 Oracle 18c – Multitenant New Features
8. Container Database Architecture (“Multitenant Architecture”)
PMON SMON LGWR DBW0 ARC0 DIAG …
SYSTEM SYSAUX REDO CTLUNDO
CDB$ROOT
[RW]
TEMP
SYSTEM SYSAUX TEMP
PDB$SEED [RO]
CRM01 [RW]
SYSTEM SYSAUX TEMP
UNDO
FA01 [RW]
CRM DBA
CDBDBA
FA DBA APP DBA
Application Tablespaces Application Tablespaces
SYSTEM SYSAUX TEMP
UNDO
Oracle 18c – Multitenant New Features11 26.09.201826.09.2018 Oracle 18c – Multitenant New Features
9. The new Container Database Architecture (“multitenant architecture”) enables an Oracle database to
work as a container database (CDB)
A CDB consists of:
– The root container CDB$ROOT – stores system metadata and common users/roles
– The seed container PDB$SEED – default template used for cloning (cannot be modified)
– Up to 252 user created Pluggable Databases (PDB) (from 12.2 on up to 4096 on Exadata and
Oracle Cloud)
A new database architecture designed for:
– consolidation/database virtualization
– fast and easy provisioning
– separation of administrative duties
– rapid movement of user data (unplug/plug)
Pluggable databases are compatible with traditional non-CDB (same behaviour from the application
point of view)
Container Database Architecture (“Multitenant Architecture”)
Oracle 18c – Multitenant New Features12 26.09.201826.09.2018 Oracle 18c – Multitenant New Features
10. Overview – Available database architectures
Non-CDB Architecture
SE2, EE
Single-tenant
SE2, EE
Multitenant
EE + Multitenant Option
Instance Instance Instance
Database CDB$ROOT CDB$ROOT
PDB
PDB
001
PDB
252
...
Deprecated! Future default! Extra licence!
Oracle 18c – Multitenant New Features13 26.09.2018
May be unavailable
after Oracle 19c
26.09.2018 Oracle 18c – Multitenant New Features13
11. Oracle 18c – Multitenant New Features14 26.09.2018
Backup (RMAN) related features
12. Clone a Pluggable Database using RMAN
Oracle 18c – Multitenant New Features15 26.09.2018
RMAN> CONNECT TARGET sys/manager@cdb144a.markusdba.local
RMAN> CONNECT AUXILIARY sys/manager@cdb145a.markusdba.local
RMAN> DUPLICATE PLUGGABLE DATABASE DEMO
2> AS EXAMPLE
3> TO CDB145A
4> DB_FILE_NAME_CONVERT('CDB144A/DEMO','CDB145A/EXAMPLE')
4> FROM ACTIVE DATABASE;
Target Database must be an existing Container Database
Restrictions
– PDB must not contain TDE-encrypted tablespaces
– Non-CDBs cannot be duplicated into a CDB (as PDB)
– Parameter REMOTE_RECOVERY_FILE_DEST must be set on Target CDB
13. RMAN Pre-Plugin Backups (Non-CDB & PDB)
Oracle 18c – Multitenant New Features16 26.09.2018
Problem until now:
– After you plug in a PDB or a non-CDB as PDB into a CDB no backup metadata in
new CDB
– Workaround: new backup, but this takes time and resources and we have a risk until it
is finished
18c: Pre-Plugin Backups
– Metadata of pre-plugin backups is registered at target CDB during plug operation
– For the Non-CDB case a manual write of backup metadata to the data dictionary is
required before plugging the Non-CDB into the CDB
SQL> exec DBMS_PDB.EXPORTRMANBACKUP;
14. RMAN Pre-Plugin Backups – Example (1)
Source is non-CDB, you have backups as usual
Regular archive log backups afterwards as usual
Maintenance window starts – Non-CDB is prepared to be plugged in as PDB into a CDB:
RMAN> BACKUP DATABASE;
RMAN> BACKUP ARCHIVELOG ALL;
SQL> exec DBMS_PDB.EXPORTRMANBACKUP;
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP OPEN READ ONLY
SQL> exec DBMS_PDB.DESCRIBE (pdb_descr_file=>'/home/oracle/ncdb.xml');
SQL> SHUTDOWN IMMEDIATE
Oracle 18c – Multitenant New Features17 26.09.2018
15. RMAN Pre-Plugin Backups – Example (2)
Plug into CDB:
Imagine you now lose a datafile of this PDB before you have created new backups:
SQL> CREATE PLUGGABLE DATABASE prod USING '/home/oracle/ndb.xml' NOCOPY;
SQL> ALTER SESSION SET CONTAINER=prod;
SQL> @?/rdbms/admin/noncdb_to_pdb.sql
RMAN> SQL 'PROD' 'ALTER TABLESPACE users OFFLINE';
RMAN> SET PREPLUGIN CONTAINER = prod;
RMAN> RESTORE TABLESPACE prod:users FROM PREPLUGIN;
RMAN> RECOVER TABLESPACE prod:users FROM PREPLUGIN;
RMAN> SQL 'PROD' 'ALTER TABLESPACE users ONLINE';
Oracle 18c – Multitenant New Features18 26.09.2018
16. Oracle 18c – Multitenant New Features19 26.09.2018
Security
17. PDB Lockdown Profiles
Oracle 18c – Multitenant New Features20 26.09.2018
A PDB lockdown profile is a named set of features that controls a group of operations
– Restrict feature usage on PDB level
Areas
– Network access
– Common user or object access
– Administrative features (e.g. "ALTER SYSTEM", ..)
– XML database access
– Database options (e.g. Partitioning)
Developed for Use Case where identities are shared…
– … on OS level when DB is interacting with the OS
– ... cloud environments
– ... within the DB when access common user / objects
– … when administrative features and xml features are used
18. PDB Lockdown Profiles Enhancements in Oracle 18c
Oracle 18c – Multitenant New Features21 26.09.2018
PDB lockdown profiles in the Application root, as well as in the CDB root
Create PDB lockdown profile that is based on another PDB lockdown profile
New view V$LOCKDOWN_RULES to see the lockdown rules
SQL> REM Static dependency
SQL> CREATE LOCKDOWN PROFILE <profile> FROM <other profile>;
SQL> REM Dynamic dependency
SQL> CREATE LOCKDOWN PROFILE <profile> INCLUDING <other_profile>;
19. Keystores for Pluggable Database
Oracle 18c – Multitenant New Features22 26.09.2018
PDB can now have its own keystore instead of one for the entire container database
United Mode (only mode available until Oracle 12.2)
– TDE master encryption key for CDB and PDBs reside in the same keystore
– Keys are primarily managed from the CDB root
Isolated Mode (new in Oracle 18c)
– PDB has its own keystore
– TDE master encryption keys are managed from the PDB only
New Parameters
– WALLET_ROOT – location of the wallet (set on instance level)
– TDE_CONFIGURATION - Per-PDB configuration for Transparent Data Encryption
(eg. "FILE", "OKV" (Oracle Key Vault), "HSM") (set on PDB level)
20. Oracle 18c – Multitenant New Features23 26.09.2018
Exadata & Oracle Cloud only
features
21. CDB Fleet Management (1)
Managing a group of CDBs ("fleet") from a "lead CDB"
Whole group looks like a single logical CDB
– You can retrieve information from all CDBs from the "lead CDB" (GV$-views, CDB-views,
Container Maps)
CDB1
CDB2 CDB3 CDB4
ALTER DATABASE SET
LEAD_CDB=TRUE;
ALTER DATABASE
SET
LEAD_CDB_URI=
<link_to_lead>
Oracle 18c – Multitenant New Features24 26.09.201826.09.2018 Oracle 18c – Multitenant New Features
22. CDB Fleet Management (2)
Oracle 18c – Multitenant New Features25 26.09.2018
SQL> REM Lead CDB (CDB144A)
SQL> ALTER DATABASE SET LEAD_CDB=TRUE;
SQL> REM Member CDB (CDB145A)
SQL> CREATE PUBLIC DATABASE LINK LEAD_LINK CONNECT TO C##FLEETCONNECT
2 IDENITIFIED BY MANAGER USING 'CDB144A';
SQL> ALTER DATABASE SET LEAD_CDB_URI='dblink:LEAD_LINK';
SQL> REM Lead CDB
SQL> SELECT NAME,OPEN_MODE FROM GV$PDBS;
NAME OPEN_MODE
------------ -------------
PDB144A READ WRITE <- local PDB
PDB145A MOUNTED <- remote PDB
Common user required,
required privileges not
documented, SR open
PDB is open in Member-
CDB, Status in Lead –
CDB wrong, SR open
23. Snapshot Carousel (1)
Oracle 18c – Multitenant New Features26 26.09.2018
PDB snapshot = Point in time copy of a PDB
– Oracle creates a local clone and unplug the
clone into a PDB archive
Snapshot Carousel = library of snapshots
– Maximum number of snapshots can be defined
(Maximum and Default=8)
– Older snapshots are overwritten
– Manual snapshots can be created, too
Data Dictionary View
– CDB_PDB_SNAPSHOTS
MASTER
create pluggable database MASTER [..] snapshot mode every 30 minutes;
SNAP1 – 13:00
SNAP2 – 13:30
SNAP3 – 14:00
SNAP8 – 16:30
[..]
24. Snapshot Carousel (2)
Oracle 18c – Multitenant New Features27 26.09.2018
Create a PDB from a snapshot (OMF required)
SQL> create pluggable database MASTERBCK from MASTER
2 using snapshot '<snapshot_name>';
25. Refreshable PDB Switchover
Oracle 18c – Multitenant New Features28 26.09.2018
Idea: Role change of a refreshable PDB
Use Cases
– PDB-level high availability
– Load Distribution
–
CDB1
CDB2
PDB1A [open] PDB2A [mount]
PDB1A [mount] PDB2A [open]
Refresh
connect sys@CDB2 as sysdba
create pluggable database PDB1A from
PDB1A@CDB1 refresh mode every 1 minutes;
connect sys@CDB2 as sysdba /* clone */
alter pluggable database PDB1A open read only;
connect sys@CDB1_PDB1A as sysdba /* source */
alter pluggable database PDB1A refresh mode
every 1 minutes from PDB1A@CDB2 switchover;
26. Just in case you didn't know it ..
Oracle 18c – Multitenant New Features29 26.09.2018
How to test Exadata only Oracle 18c features in a VM on your notebook
SQL> ALTER SYSTEM SET "_exadata_feature_on"=TRUE scope=spfile;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;
27. Oracle 18c – Multitenant New Features30 26.09.2018
DataGuard
28. DataGuard (1)
Oracle 18c – Multitenant New Features31 26.09.2018
Problem until Oracle 12.2:
– When plugging in a PDB or running a remote-cloning operation, the files are not transfered
to the standby database automatically
– Workaround: stop apply on standby database, copy files manually, re-enable apply
Solution in Oracle 18c
– New Parameters
–
– Backported to 12.1.0.2 and 12.2 (Patch 25802510)
STANDBY_PDB_SOURCE_FILE_DIRECTORY Directory on the Standby-Server where the datafiles for plugging-
in a PDB are stored
STANDBY_PDB_SOURCE_FILE_DBLINK Database link which points to the Source-CDB of a remote-clone
PDB (open read-only), Standby-Database must be open read-
only (Active Data Guard)
29. DataGuard (2) – Example (Plug-In a PDB)
Oracle 18c – Multitenant New Features32 26.09.2018
Step 1: Unplug the PDB from the Source CDB
Step 2: Set Parameter STANDBY_PDB_SOURCE_FILE_DIRECTORY on Standby
SQL> alter pluggable database PDB145A close;
Pluggable database altered.
SQL> alter pluggable database PDB145A unplug into '/nfs/pdb145a.xml';
Pluggable database altered.
SQL> !cp /u01/oradata/CDB145A/PDB145A/*.dbf /nfs/.
SQL> alter system set STANDBY_PDB_SOURCE_FILE_DIRECTORY='/nfs/';
System altered.
30. DataGuard (3) – Example (Plug-In a PDB)
Oracle 18c – Multitenant New Features33 26.09.2018
Step 3: Plug-In the PDB on the Primary-CDB
Step 4: Check Standby
– New PDB is there
– Redo-Apply did not stop
– But the filenames are strange (GUID included, not the PDB name)
SQL> create pluggable database PDB145A
2 using '/nfs/pdb145a.xml'
3 source_file_name_convert=('/u01/oradata/CDB145A/PDB145A/','/nfs/')
4 copy
5 file_name_convert=('/nfs/','/u01/oradata/CDB144A/PDB145A/');
Pluggable database created.
PDB145A(4):Successfully added datafile 78 to media recovery
PDB145A(4):Datafile #78:
'/u01/oradata/CDB144A_S2/7563AC8F7F4A7D19E0539101A8C0DFF9/datafile/users01.dbf'
31. DataGuard (4)
Oracle 18c – Multitenant New Features34 26.09.2018
Open issue
– When doing a local or remote clone of a PDB which is open "read-write", redo-apply stops
– Reason: 2 incompatible recovery-modes required (DataGuard Recovery & PDB recovery)
Workaround: (see MOS-Note 1916648.1 for more information)
1. Create the PDB on the primary database with "STANDBYS=NONE"
2. Open the PDB on the Primary
3. Copy the files from the primary server to the standby server via RMAN restore via network
4. Stop the redo apply on the standby site
5. Restart the standby DB in mount mode
6. Enable Recovery for the PDB
7. Re-Enable redo apply
32. Oracle 18c – Multitenant New Features35 26.09.2018
Miscellaneous
33. PDB-Split-Mirror-Clones with ASM
Oracle 18c – Multitenant New Features36 26.09.2018
Requirements
– Oracle 18c Database
– Flex or Extended Disk Groups with COMPATIBLE.ASM and COMPATIBLE.RDBMS >=18.1
Step 1: Prepare the Mirror Copy
Step 2: Create the Split-Mirror-Clone
SQL> ALTER SESSION SET CONTAINER=SOURCEPDB;
SQL> ALTER PLUGGABLE DATABASE PREPARE MIRROR COPY MIRRORPDB;
SQL> CREATE PLUGGABLE CLONEPDB FROM SOURCEPDB
2> USING MIRROR COPY MIRRORPDB;
34. RAC: Session Drain-Out during Maintenance (1)
Oracle 18c – Multitenant New Features37 26.09.2018
Application Continuity works in 18c with
– JDBC
– OCI
– ODP.NET
Application Continuity is used to drain out database sessions during maintenance activitities
– AC determines automatically a "good point in time"
Application Continuity is used to transfer sessions to another instance (without loss of
transactions)
– .. when stopping a PDB on an instance
– .. when stopping a PDB application service on an instance
35. RAC: Session Drain-Out during Maintenance (2)
Oracle 18c – Multitenant New Features38 26.09.2018
srvctl relocate service
-db TVDCDB
-pdb TVDPDB1
-service TVDAPP1SVC
-oldinst TVDCDB1
-newinst TVDCDB2
–drain_timeout 60
–stopoption immediate
Maximum time Oracle waits for the sessions to be relocated
is specified in seconds
After the drain_timeout the service/instance is stopped etc. (depending on the command )
Works for Non-CDBs, too
36. Resource Management: Parallel Statement Queueing
Oracle 18c – Multitenant New Features39 26.09.2018
Oracle 12c Release 1:
– Resource Management is done using Resource Manager (CPU share, CPU Limit (%),
Parallel Server Limit (%)
Oracle 12 Release 2:
– Parameter CPU_COUNT can be set on PDB level
– Oracle Recommendation: do not use Resource Manager for CPU resources (CPU
share, CPU limit), use CPU_COUNT instead
Oracle 18c
– Parameter PARALLEL_SERVERS_TARGET can be set on PDB level (Default:
PARALLEL_THREADS_PER_CPU * CPU_COUNT * concurrent_parallel_users * 2)
– Oracle Recommendation: do not use Resource Manager (Parallel Server Limit)
37. Oracle 18c – Multitenant New Features40 26.09.2018
Summary
38. Summary – Oracle 18c Multitenant New Features
Oracle 18c – Multitenant New Features41 26.09.2018
"Re-usable" Pre-Plugin Backups
ASM Split-Mirror-Clones
"rman duplicate" is not really an
improvement
DataGuard improvements do not
help when cloning read-write
PDBs
Documentation sometimes
misleading
Bugs and other issues
Training O-MT will be updated for
Oracle 18c until October 2018
39. Oracle 18c – Multitenant New Features42 26.09.2018
Further Information
• Oracle 18c Documentation - Database New Features Guide
• Oracle 18c Documentation - Multitenant Administrators Guide
• Whitepaper - Oracle 18c Multitenant New Features -
http://www.oracle.com/technetwork/database/multitenant/learn-more/multitenantwp18c-
4396158.pdf
40. More on Oracle Database 18c at the TechEvent
Oracle 18c – Multitenant New Features43 26.09.2018
Friday, September 14th 2018
12:00 Oracle Database 18c – New Performance Features Christian Antognini
16:10 Oracle Database 18c – New Features for DB Developers Philipp Salvisberg
16:10 Oracle Database 18c - New Features for Oracle Multitenant Markus Flechtner
16:10 Oracle Database 18c - New Security Features Stefan Oehrli
17:15 Oracle Database 18c - Data Guard New Features Mathias Zarick
Saturday, September 15th
09:15 10 Behavior Changes in Oracle 12c/18c Christian Gohmann
41. Questions and Answers
Markus Flechtner
Principal Consultant
Phone +49 211 5866 64725
Markus.Flechtner@Trivadis.com
@markusdba https://markusdba.net
Please don‘t forget the session feedback – Thank you!
26.09.2018 Oracle 18c – Multitenant New Features44
42. Session Feedback – now
Oracle 18c – Multitenant New Features45 26.09.2018
Please use the Trivadis Events mobile app to give feedback on each session
Use "My schedule" if you have registered for a session
Otherwise use "Agenda" and the search function
If the mobile app does not work (or if you have a Windows smartphone), use your
smartphone browser
– URL: http://trivadis.quickmobileplatform.eu/
– User name: <your_loginname> (such as "svv")
– Password: sent by e-mail...