Академический Документы
Профессиональный Документы
Культура Документы
DB12c
TABLE OF CONTENTS
OVERVIEW .................................................................................................................................... 3
Challenges addressed by Oracle Multitenant ............................................................................................... 3
Managing Oracle Multitenant .................................................................................................................... 4
Oracle Multitenant Architecture ................................................................................................................... 4
Path to new Architecture .............................................................................................................................. 9
CDB global choices, PDB local choices ........................................................................................................ 12
Resource Manager in Oracle Multitenant .................................................................................................. 14
Summary .................................................................................................................................................. 15
Appendix .................................................................................................................................................. 16
Appendix A New Features for Oracle Database Developers .................................................................... 16
Appendix B Changes, Deprecated and Desupported Features for Oracle Database 12c......................... 19
DB12c
OVERVIEW
Oracle Multitenant Option is a new option for the Oracle Database 12c Enterprise Edition which helps
customers to reduce IT costs by simplifying consolidation, provisioning, upgrades and more.
It is supported by a new architecture that allows a multitenant container database (CDB) to hold zero, one
or many customer-created pluggable databases (PDBs). A PDB is a portable collection of schemas,
schema objects and non-schema objects that appears to an Oracle Net clients as a non-CDB. All Oracle
databases before Oracle Database 12c were non-CDBs.
This paper will explain the new Oracle Database Multitenant architecture, talks about the new features for
Oracle Database Developers as well as new features in SQL and PL/SQL. It also covers deprecated and
de-supported features in Oracle Database 12c..
Provisioning of databases
Patching and upgrading the Oracle Database software version
DB12c
DB12c
The PDB/non-CDB compatibility guarantee means that a PDB behaves the same as a non-CDB as seen
from a client connecting with Oracle Net. The installation scheme for an application back end that runs
against a non-CDB runs the same against a PDB and produces the same result.
DB12c
Reduction of duplication for example the source code for DBMS_PROFILER PL/SQL package is
stored only in CDB$ROOT and shared with the PDBs through internal links.
Ease of database upgrade the definition of a data dictionary table exists only in the root, so at
upgrade there is no need to separately modify it in every PDB
All container data objects have a CON_ID column. This table below shows the meaning of the values:
Container ID
0
1
2
All Other IDs
Rows pertain to
Whole CDB
CDB$ROOT
PDB$SEED
User-Created PDBs
DB12c
Commonality in a CDB
In a CDB, the basic principle of commonality is that a common phenomenon is the same in every existing
and future container.
In a CDB, common means common to all containers. In contrast, a local phenomenon is restricted to
exactly one existing container.
A corollary to the principle of commonality is that only a common user can alter the existence of common
phenomena. More precisely, only a common user connected to the root can create, destroy or modify CDBwide attributes of a common user or role.
Common and Local Users in a CDB
A common user is as database user that has the same identity in the root and in every existing and future
PDB. Every common user can connect to and perform operations within the root, and within any PDB in
which it has the appropriate privileges.
A local user is a database user that is not common and can operate only within a single PDB.
DB12c
The figure below shows sample users and schemas in two PDBs: hrpdb and salespdb.
SYS and c##dba are common users who have schemas in CDB$ROOT, hrpdb and salespdb.
Local users hr and rep exist in hrpdb.
Local users hr and rep also exist in salespdb.
DB12c
SQL> CREATE PLUGGABLE DATABASE hrpdb ADMIN USER dba1 IDENTIFIED BY <password>;
DB12c
SQL> BEGIN
DBMS_PDB.DESCRIBE(pdb_descr_file => /tmp/noncdb_to_pdb.xml);
END;
/
The XML metadata file also referred to as the PDB manifest contains all necessary information
regarding the non-CDB database.
3) Shutdown the non-CDB
4) Create a new pluggable database from your non-CDB
Adoption of the content of a non-CDB is done using Data Pumps full database export and import
functionality.
10
DB12c
If the Oracle Database release of the non-CDB is 11g Release 2 (11.2.0.3) or later then you can use full
transportable export/import to move the data. When transporting a non-CDB from an Oracle Database 11g
Release 2 to Oracle Database 12c, the VERSION Data Pump export parameter must be set to 12.0.0.0.0
or higher.
You can also use Oracle GoldenGate replication and replicate the data from the non-CDB to a PDB. Once
the PDB has caught up with the non-CDB, you can switch over to the PDB and decommission the nonCDB.
The following SQL statement plugs in a PDB named financepdb based on the metadata stored in the given
PDB manifest file. It specifies NOCOPY because the files of the unplugged PDB do not need to be copied:
CREATE PLUGGABLE DATABASE salespdb USING /tmp/financepdb.xml NOCOPY
All operations to manage PDBs are SQL statements; therefore, these can be done from a client machine
and need only authorization as suitably privileged Oracle Database users.
11
DB12c
How to connect
Only CDB has a SID. PDBs do not have a concept of SID.
The direction is to use service connections either as defined in SERVICE_NAME in the tnsnames.ora file or
by using EZCONNECT. In order to migrate client connections to use services, the Oracle Net Services has
introduced a listener.ora parameter for SID to SERVICE_NAME translations. This would permit legacy
connections which still use SID descriptors to continue working. You will need to define
USE_SID_AS_SERVICE_LISTENER=ON in the appropriate listener.ora file and restart the listener to
enable this feature.
Character set
The character set is to be determined only for the CDB as a whole. The recommendation is that Unicode
(AL32UTF8) be used as the CDBs character set.
Some PDB character sets (binary subsets with the same single/multibyte characteristics requiring no data
conversion) will be automatically updated to the CDB character set at first open. However, most PDB
character sets different from the CDB character set will prevent the PDB from being opened in nonrestricted mode. See Support Note: Changing Or Choosing the Database Character Set (
NLS_CHARACTERSET (Doc ID 225912.1) or Oracle Globalization Support documentation ) for further
information.
Time zones
Database time zone can be different per PDB, however, there can only be one system time zone.
Session time zone is a session based setting and therefore does not affecta Multitenant environment.
12
DB12c
memory_max_target
memory_target
parallel_degree_policy
pga_aggregate_limit
pga_aggregate_target
processes
result_cache_max_size
sga_max_size
sga_target
shared_pool_reserved_size
shared_pool_size
undo_management
undo_retention
undo_tablespace
user_dump_dest
To retrieve the subset of parameters which are modifiable at PDB level you can use this query:
Parameters that can have different values per PDB are distinguish by the value of CON_ID:
If you attempt to modify a parameter within a PDB which is CDB modifiable only, you will get the bellow
error message:
ORA-65040 operation not allowed from within a pluggable database
13
DB12c
14
DB12c
SUMMARY
Oracle Multitenant represents the next generation of consolidation for application backends.
It delivers the manage-as-one benefits that adopters of schema-based consolidation had hoped to win.
Adopting it is a pure deployment choice: neither the application backend, nor the client code, needs to be
changed.
15
DB12c
APPENDIX
Appendix A New Features for Oracle Database Developers
Application Continuity
Application Continuity attempts to mask outages from end users and applications by recovering requests
following recoverable outages, unplanned and planned. Application Continuity performs this recovery
beneath the application so that the outage appears to the application as a delayed execution
Transaction Guard
Transaction Guard provides a generic tool for applications to use for at-most-once execution in case of
planned and unplanned outages. Applications use the logical transaction ID to determine the outcome of
the of the last transaction open in a database session following an outage. Without Transaction Guard,
applications that attempt to replay operations following outages can cause logical corruption by committing
duplicate transactions.
SET_NULL_COLUMN_VALUES_TO_EXPR Procedure
Before release 12.1, when using edition-based redefinition (EBR), transforming the application data from its
pre-upgraded representation (in the old edition) to its post-upgrade representation (in the new edition)
required an UPDATE operation on every row a very expensive and time-consuming operation.
As of Release 12.1, you can sometimes invoke the procedure
DBMS_EDITIONS_UTILITIES.SET_NULL_COLUMN_VALUES_TO_EXPR to use a metadata operation to
transform the application data.
16
DB12c
Client Auto-Tuning
Client Auto-Tuning is a feature that transparently optimizes the configuration parameters of OCI client
session features of middle-tier applications to gain higher application performance without the need to
reprogram you OCI application
Partitioning Improvements
o
17
DB12c
Temporary UNDO
UNDO for temporary tables can now be managed in TEMP.
As we reduce the amount of UNDO in the UNDO tablespace we reduce the size of redo generated.
This allows for DML on temporary tables in Active Data Guard
SQL> ALTER SYSTEM/SESSION SET TEMP_UNDO_ENABLED=true/false
Improved Defaults
Default to a sequence, default when null inserted
Increased Size Limit for varchar2, nvarchar2 and RAW Data Types
Varchar2, NVarchar2 and raw datatypes may be up to 32k in size, like in PL/SQL
Max_string_size init.ora set to EXTENDED (default is not this)
Invisible columns
Invisible columns in Oracle Database 12c provide the ability to add a column to any table such that the
newly added column will not be visible in a SELECT * query and will not be considered for insertion in an
INSERT statement that does not explicitly list that column.
18
DB12c
Deprecation of CONNECTION_PROPERTY_STREAM_CHUMK_SIZE
JDBC property CONNECTION_PROPERTY_STREAM_CHUMK_SIZE is deprecated in this release
19
DB12c
Examples are:
Background_dump_dest
Commit_write
Log_archive_start
Plsql_v2_compatibility
Remote_os_authent
Sec_case_sensitive_logon
Sql_trace
Standby_archive_dest
User_dump_dest
LOG_ARCHIVE_LOCAL_FIRST
Deprecated Views
The following views are deprecated in Oracle Database 12c
ALL_SCHEDULER_CREDENTIALS
DBA_NETWORK_SCL_PRIVILEGES
DBA_NETWORK_ACLS
V$OBJECT_USAGE. Use USER_OBJECT_USAGE instead
20
DB12c
21
DB12c
References:
Oracle Database SQL Reference 12c Release 1
Oracle Database PL/SQL Language Reference 12c Release 1
22