Multitenant Database Architecture
Multitenant Database Architecture
Multitenant Database Architecture
Introduction:
Oracle Multitenant is a new architecture in Oracle database 12c and later version to
support cloud infrastructure and consolidation (integration) strategies in the data
centers. The new database option will allow the database practitioners to
consolidate multiple physical databases within a single database. The option can be
exercised in Oracle Database 12c Enterprise Edition and later version and fully
compliant with other database features like Real Application Clusters and Data
Guard. The major benefits of Oracle Multitenant option is easy adoption,
manageability, database isolation and security, and resource prioritization for each
database.
Containers in a CDB
Exactly one root: The root stores Oracle-supplied metadata and common
users. An example of metadata is the source code for Oracle-supplied
PL/SQL packages. A common user is a database user known in every
container. The root container is named CDB$ROOT.
Exactly one seed PDB: The seed PDB is a system-supplied template that
the CDB can use to create new PDBs. The seed PDB is named PDB$SEED.
You cannot add or modify objects in PDB$SEED.
Zero or more user-created PDBs: A PDB is a user-created entity that
contains the data and code required for a specific set of features. For
example, a PDB can support a specific application, such as a human
resources or sales application. No PDBs exist at creation of the CDB. You
add PDBs based on your business requirements.
The following figure shows a CDB with four containers: the root, seed, and two
PDBs. Each PDB has its own dedicated application. A different PDB administrator
manages each PDB. A common user exists across a CDB with a single identity. In
this example, common user SYS can manage the root and every PDB. At the
physical level, this CDB has a database instance and database files, just as a non-
CDB does.
It the diagram bellow hrpdb and salespdb are pluggable database inside the
container CDB. Seed PDB$SEED is the template which is used to create a new
pluggable database.
You can use the same administration tools for both CDBs and non-CDBs.
For example, you can use the following tools in a multitenant environment:
Creating CDB:
To create a Container Database (CDB) in Oracle, you can use the Database
Configuration Assistant (DBCA) tool or the SQL command "CREATE
DATABASE".
Using DBCA:
Start the DBCA tool.
Select "Create a Database"
Select "Advanced Options" and then "Container Database"
Follow the prompts to configure the CDB
Using SQL:
Connect to the SQL*Plus command line
Run the following command to create the CDB:
Character Set:
A character set in an Oracle database refers to the set of characters that can be
stored and used in the database. It defines the way characters are represented in the
database, including the encoding and mapping of characters to specific code points.
AL32UTF8: a Unicode character set that supports all languages and can
store any character in the Unicode standard.
UTF8: a Unicode character set that supports all languages, but can only
store characters in the Unicode Basic Multilingual Plane (BMP).
WE8MSWIN1252: a character set that supports the Western European
languages and is commonly used for data in the United States and Western
Europe.
When creating a new database or table, you can specify the character set to be
used. If you do not specify a character set, Oracle will use the default character set
for the database or table. You can also change the character set of an existing
database or table, but it can be a complex process and can impact the data stored in
the database.
It is important to choose an appropriate character set for the data you will be
storing in the database, as using the wrong character set can lead to data corruption
or loss, and also affect the performance of the database.
For example, the AL16UTF16 character set is a national character set that is used
for storing Chinese, Japanese, and Korean characters. It is a Unicode character set
and allows for storing any character in the Unicode standard.
When creating a new database or table, you can specify both a character set and a
national character set. The national character set is used to store characters that are
not part of the standard character set and are specific to a particular country or
region.
It is important to note that the national character set must be a subset of the
character set, and the use of a national character set can affect the performance of
the database.
It's important to choose an appropriate national character set for the data you will
be storing in the database, as using the wrong national character set can lead to
data corruption or loss, and also affect the performance of the database.
Extent Management:
SYSAUX datfile:
Data dictionary: The data dictionary is a set of tables and views that
contains information about the structure of the database, such as the tables,
indexes, and constraints.
Undo data: The undo data is used to roll back transactions and is used for
read consistency and crash recovery.
Other auxiliary information: The SYSAUX datafile also contains other
types of information, such as the data for the Oracle Scheduler, the
Automatic Workload Repository (AWR), and the Automatic Database
Diagnostic Monitor (ADDM).
Creating PDB:
Creating a pluggable database (PDB) in Oracle is a multi-step process that involves
several different commands and options. The basic steps for creating a PDB in
Oracle are:
After creating the PDB alter database from mount mode to open mode. To do this
execute following command.
Database in Cloud:
Oracle Database is available in the cloud through the Oracle Cloud Infrastructure
(OCI) platform, which is a collection of cloud-based services that can be used to
deploy and manage Oracle databases in the cloud.
The three cloud service models are Infrastructure as a Service (IAAS), Platform as
a Service (PAAS), and Software as a Service (SaaS).
With Oracle Database in the cloud, users can create and manage databases using
the same tools and features as on-premises Oracle databases, but with the added
benefits of cloud-based infrastructure. This allows users to take advantage of the
scalability, availability, and cost-effectiveness of the cloud.
There are several different options for deploying Oracle Database in the cloud,
including:
services provided by OCI like the Object Storage, Load Balancer and Identity
Access Management (IAM).
High availability: Cloud resources are always available and do not have
single point of failure.
Disaster Recovery: Enable quick recovery or continuation of service from
any kind of downtime.
Fault Tolerance: Ensure minimal downtime.
Scalability: Support scaling of resources up or down (vertical scaling), in
or out (horizontal scaling).
Elasticity: Ability to quickly scale resources including VMs and storage.
Pricing: Capital expenditure (CAPEX) spent for fixed assets such as
physical infrastructure. Operational expenditure (OPEX) spent for
operational cost such as utility and power.
OCI Architecture
The four main components that constitute the OCI architecture are:
Region: These are geographical locations around the world where the cloud
services are available.
Availability Domain: These are isolated data centers located within a region.
Fault Domain: These are logical data centers within an availability domain.
Though availability domains are isolated they are connected to each other by low
latency, high bandwidth network. Each AD consists of three fault domains for high
availability of resources. Resources placed in different fault domains do not share
single point of failure. Compartments help to isolate and control access to the
resources in the cloud.
OCI Services:
OCI services can be divided into five categories:
Compute Service
Storage Service
Network Service
Identity and Access Management Service
Database Service
Compute Service:
Bare metal
Virtual machine
Dedicated virtual host
Container engine
Function.
Bare metal offers just the physical server without any virtualization. Virtual
machines offer the virtualization layer in addition to the server. In case of
dedicated virtual host the user gets complete control of the VMs running on the
host. In container engine user will be only managing the application as the OS also
is managed by the cloud provider. Finally, in case of Oracle Function user is
responsible for only the code and rest everything is taken care. The highlight of
Oracle Functions is that user has to pay only for the resources consumed during the
execution of the code.
Storage Service:
You can choose the required type of storage based on the type and volume of data,
data durability, and performance.
Networking Service:
Internet gateway provides connection between the VCN and the internet
and its public connection.
Identity refers to user who is requesting for access, and Access refers to type of
permissions granted to the user or principal. Here principal can be a user or an
instance. The first user in OCI is always the administrator who will provide access
and permission to other users. Here a user has to belong to a group and each group
needs to be associated with a policy. Policy will have details of the resources for
which permission is given to the user. Policy can be attached to a compartment as
it is a collection of resources.
Database Service:
The main objective of database backup is high availability and disaster recovery.
OCI offers five different types of database services namely, Virtual Machine DB
system, Bare Metal DB system, Oracle RAC, Exadata DB system, and
Autonomous DB.
OCI Security
OCI provides Shared Security model. Users are responsible for securing their data
and Oracle secures the underlying infrastructure. Users are responsible for patching
applications and operating system.
Data safe is used to protect sensitive and regulated data residing in the
Oracle cloud databases.
Key Management or Oracle Vault encrypts storage and database services.
Keys are stored on highly available and durable Hardware Security Modules
(HSM).
OCI also supports centralized key management where users can use their on-
premises environment keys.
The Identity and Access Management service supports Multi-Factor
Authentication (MFA).
Web application firewall can be used to authenticate HTTP traffic.
OCI also offers compliance certifications such as HIPAA.
End of Unit-6