Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of Oracle 20C Multi-tenant _ 1.2 Database and examples

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1.2 databases and instances

The Oracle database server consists of a database and at least one database instance, usually referred to as an instance for short.

Because an instance and a database are so closely linked, the term Oracle database sometimes refers to both an instance and a database. In the strictest terms, these terms have the following meanings:

L database

A database is a set of files on disk that are used to store user data. These data files can exist independently of the database instance. Starting with Oracle database 20c, "database" specifically refers to the data files of a multi-tenant container database (CDB), pluggable database (PDB), or application container.

L instance

An instance is a set of named memory structures used to manage database files. The database instance consists of a shared memory area (called the system global zone (SGA)) and a set of background processes. The instance can exist independently of the database file.

1.2.1 Multi-tenant architecture

The multi-tenant architecture makes the Oracle database CDB.

Each Oracle database must or can contain another database. For example, CDB contains pdb, while the application container contains the application pdb. PDB is contained by CDB or the application container, which is contained by CDB.

Starting with Oracle Database 20c, the multi-tenant container database is the only supported architecture. In previous versions, Oracle supported non-container databases (non-container databases, non-CDBs).

1.2.1.1 CDBs

A CDB contains one or more user-created pdb and application containers.

At the physical level, a CDB is a set of files: control files, online redo log files, and data files. The above files managed by the database instance are called CDB.

The following figure shows an CDB and an associated database example.

Figure 1-1 Database example and CDB

1.2.1.2 PDBs

PDB is a removable collection of schemas, schema objects, and nonschema objects that appear as separate databases in the application.

At the physical level, each PDB has its own set of data files for storing PDB data. CDB includes all pdb data files, as well as a set of system data files that store CDB's own metadata.

To move or archive PDB, you can unplug it. Unplugged PDB consists of PDB data files and metadata files. Unplugged PDB is not available until it is inserted into CDB.

The following figure shows a CDB named MYCDB.

Figure 1-2 PDBs in CDB

Physically, a MYCDB is an Oracle database, a set of data files associated with an instance. Although there can be multiple instances in an Oracle Real application cluster, MYCDB has only one database instance and a set of database files.

MYCDB contains two pdb: hrpdb and salespdb. As shown in figure 1-2, these pdb appear as separate, separate databases in their respective applications. The application does not know whether it is connected to CDB or PDB.

To manage CDB itself or any PDB within it, you can connect to the CDB root. Root is a collection of schemas, schema objects, and non-schema objects to which all pdb and application containers belong.

1.2.1.3 Application Container

An application container is an optional, user-created container in CDB that stores data and metadata for one or more applications.

An application (also known as a master application definition) is a named, versioned set of common data and metadata stored in application root. For example, application might include definitions of tables, views, user accounts, and PL/SQL packages that are common to a set of pdb.

In some ways, the application container acts as an application-specific CDB in CDB. Like CDB itself, an application container can contain multiple application pdb and allow these pdb to share metadata and data. At the physical level, the application container, like PDB, has its own set of data files.

For example, a SaaS deployment can use multiple application pdb, each pdb for a separate customer who shares application metadata and data. For example, in the following figure, sales_app is the application model in the application root directory. The application named cust1_pdb contains only sales data for customer 1, while the application named cust2_pdb contains only sales data for customer 2. For a single customer PDBs, insert, dial-out, clone, and other pdb-level operations can be performed.

Figure 1-3 SaaS use case

1.2.2 Sharding architecture

Oracle Sharding is a database extension technology based on horizontal partitioning of data across multiple pdb. The application treats PDBs pools as a single logical database.

The main benefits of sharding for OLTP applications include linear scalability, fault tolerance, and geographic data distribution. Sharding is ideal for deployment in the Oracle cloud. Unlike implementing NoSQL data storage for sharding, Oracle sharding provides the advantages of sharding without sacrificing the capabilities of enterprise RDBMS.

In the sharding architecture, each CDB is hosted on a dedicated server with its own local resources: CPU, memory, flash, or disk. You can specify PDB as shard. PDB shard from different cdb forms a logical database called sharded database. Two shard in the same CDB cannot be members of the same sharded database. However, in the same CDB, one PDB can be in one sharded database and the other PDB can be in a separate sharded database.

A horizontal partition splits a database table, and each slice contains a subset with the same columns but different rows. Tables that are split in this way are also called sharded table. The following figure shows a split horizon sharded table that spans three shards, each shard being a PDB in a separate CDB.

Figure 1-4 sharded table of horizontal partition

The following example stores customer account data across multiple CDBs. For example, a customer with an ID of 28459361 can query his record. The following figure shows a possible structure. The customer request is routed through the connection pool, where the shard controller (network listener) directs the request to the appropriate PDB shard, which contains all customer lines.

Figure 1-5 Oracle Sharding Architecture

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report