New Features of ORACLE12C: CDB and PDB

Source: Internet
Author: User
Oracle12C introduces new features of CDB and PDB. In the multi-tenant user environment (MultitenantEnvironment) introduced by ORACLE12C, a database container (CDB) is allowed) host multiple pluggable databases (PDB ). CDB is called ContainerDatabase, and Chinese translation is a database container. PDB is called PluggableDatabase.

Oracle 12C introduces new features of CDB and PDB. In the multi-tenant user Environment (Multitenant Environment) introduced by ORACLE 12C, a database container (CDB) is allowed) host multiple pluggable databases (PDB ). CDB is called Container Database, and Chinese translation is used as a Database Container. PDB is called Pluggable Database.

Oracle 12C introduces new features of CDB and PDB. In the multi-tenant user Environment (Multitenant Environment) introduced by ORACLE 12C, a database container (CDB) is allowed) host multiple pluggable databases (PDB ). CDB is called the Container Database, and the Chinese translation is a Database Container. PDB is called the Pluggable Database, which can be used to plug and unplug the Database. Before ORACLE 12C, an instance and a database have one-to-one or many-to-one relationship (RAC): that is, an instance can only be associated with one database, and the database can be loaded by multiple instances. The relationship between instances and databases cannot be one-to-many. After entering ORACLE 12C, the relationship between the instance and the database can be one-to-many. The following is the relationship between CDB and PDB in the official documents.

In fact, if you are familiar with SQL server, does this CDB and PDB feel the same as the single-instance multi-database architecture of SQL SERVER. For example, PDB $ SEED can be regarded as a system database such as master and msdb, and PDBS can be regarded as a user-created database. The concept of pluggable is the same as that of separating and attaching user databases in SQL SERVER. It seems that ORACLE has also copied the concept of an SQL SERVER, but it just changed its packaging.

CDB Components (Components of a CDB)

A cdb database container contains the following components:

ROOT component

ROOT, also known as CDB $ ROOT, stores metadata and Common users provided by ORACLE. An example of metadata is the source code of the PL/SQL package provided by ORACLE, common User is a User that exists in each container.

SEED component

Seed is also called PDB $ SEED. This is the template for creating a PDBS database. You cannot add or modify an object in Seed. One CDB can have only one Seed. This sentiment is very similar to the model database in SQL SERVER.

PDBS

There can be one or more PDBS in CDB. PDBS is backward compatible and can be used to operate PDBS as in the database. Most common operations are described here.

Each of these components can be called a container. Therefore, ROOT is a container, Seed is a container, and each PDB is a container. Each container has a unique ID and name in CDB.

1) connect to the CDB Database

Connecting to the CDB database container is very simple, just like connecting to the database

[oracle@get-orasvr02 ~]$ sqlplus / as sysdbaSQL*Plus: Release 12.1.0.1.0 Production on Sun Oct 20 23:41:36 2013Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.SQL>[oracle@get-orasvr02 ~]$ sqlplus sys/password   as sysdbaSQL*Plus: Release 12.1.0.1.0 Production on Sun Oct 20 23:43:17 2013Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.SQL>

2) check whether the database is CDB

SQL> select name, decode(cdb, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option" , open_mode, con_id from v$database;NAME      Multitenant Option                   OPEN_MODE                CON_ID--------- -----------------------------   --------------------         ----------EPPS      Multitenant Option enabled            READ WRITE                  0

YES indicates that the database is CDB, if it is NO indicates that it is a NO-CDB (normal database)

3) view the current Container (Container)

3.1

SQL> show con_nameCON_NAME------------------------------CDB$ROOTSQL>3.2SQL> select sys_context('userenv', 'con_name') "Container DB" from dual;Container DB----------------------------------------------------CDB$ROOTSQL>

4) view the PDBS information in the CDB container

Check the number of pluggable databases in CDB

SQL>  select con_id, dbid, guid, name , open_mode from v$pdbs;    CON_ID       DBID GUID                             NAME                           OPEN_MODE---------- ---------- -------------------------------- ------------------------------ ----------         2 4071321146 E89E8DA2866E3157E043DE07A8C09238 PDB$SEED                       READ ONLY         3 1930201447 E89E9418B882350CE043DE07A8C092B6 PDBEPPS                        MOUNTEDSQL>

5) Start the PDB Database

Method 1:

SQL> alter pluggable database PDBEPPS open;Pluggable database altered.SQL> select con_id, dbid, guid, name , open_mode from v$pdbs;    CON_ID       DBID GUID                             NAME                           OPEN_MODE---------- ---------- -------------------------------- ------------------------------ ----------         2 4071321146 E89E8DA2866E3157E043DE07A8C09238 PDB$SEED                       READ ONLY         3 1930201447 E89E9418B882350CE043DE07A8C092B6 PDBEPPS                         READ WRITE

Method 2:

SQL> alter session set container=PDBEPPS;Session altered.SQL> startupPluggable Database opened.SQL>

6) shut down the PDB Database

SQL> alter pluggable database PDBEPPS close;

Pluggable database altered.

SQL> select con_id, dbid, guid, name, open_mode from v $ pdbs;

CON_ID dbid guid name OPEN_MODE

--------------------------------------------------------------------------------------------

2 4071321146 E89E8DA2866E3157E043DE07A8C09238 PDB $ SEED READ ONLY

3 1930201447 E89E9418B882350CE043DE07A8C092B6 PDBEPPS MOUNTED

SQL>

7) switch between containers

SQL> alter session set container = PDBEPPS;

Session altered.

SQL> show con_name;

CON_NAME

------------------------------

PDBEPPS

SQL>

SQL> alter session set container = CDB $ ROOT;

Session altered.

SQL> show con_name;

CON_NAME

------------------------------

CDB $ ROOT


References:

Http://docs.oracle.com/cd/E16655_01/server.121/e17636/cdb_intro.htm

Http://www.orasos.com/4445.html

Http://www.oracle-base.com/articles/12c/multitenant-connecting-to-cdb-and-pdb-12cr1.php

Http://www.orasos.com/4445.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.