Talking about the relationship between ORACLE12C database, user, CDB and PDB

Source: Internet
Author: User
Tags oracle database security guide

Noun Introduction:

Database: A database is a warehouse that organizes, stores, and manages data according to its structure, which is generated more than 60 years ago, with the development of information technology and the market, especially after the 1990s, data management is no longer just the storage and management of data, and the transformation into a variety of user needs of the data tube The way you do it.
C D b:cdb is all called Container database, Chinese translation is the container databases.
P D b:pdb is all called pluggable database and Chinese translation is pluggable.

First, let me talk about the relationship between the database, user, and schema. In my view, the database is like a large warehouse containing a lot of small rooms, and then we divide this warehouse into several pieces, this is the schema. Out of the small warehouse to be someone management Ah, management is called user. Of course, users can put a lot of goods in these small warehouses, the goods is the table and data. As for many people who do not understand the difference between the user and the schema, I hereby cite a passage on the Internet to explain the relationship between them:
"User is Oracle users, and all systems in the user concept similar to the user is holding a system of permissions and resources , and the schema covers a variety of objects that contain the "location" of objects such as tables, functions, packages, and so on, and do not include permission controls on them. Like a house filled with furniture, the owner of the House (user), not the house (schema), has the power to dominate the home. You can also be the owner of a house (user) and have your own house (schema). You can enter someone else's house by alter session. If you don't specify it, all you do is focus on what's in your current house. As to whether you have permission to use (select), Move (update) or remove the furniture, see if the owner of the house gives you such permission, or you are the Boss (DBA) of the entire building (DB). The ALTER session set schema can be used instead of synonyms. If you want to invoke other schema objects (with permission), but do not build synonym, and do not want to put other schema names into the code, you can first use ALTER session set schema=< other schema name >. "
This passage illustrates the difference and connection between user and schema.
I'll talk about the difference between 12c and previous versions, so let's guess what's the difference between "strongly". Bingo is the introduction of the PDB and CDB concepts. The
here refers to a diagram in a document that oracle12c new features to make it easier to explain the relationship between CDB and PDB.

What are the components of the

CDB? In fact, we can clearly see:
1, Root:root, aka Cdb$root, used to store Oracle-provided metadata and common user. An example of metadata is the source code for the PL/SQL package provided by Oracle. Common user refers to the database users that are known to all containers (note that when we want to create a user in the database, it is generally not possible to create it in root.) We need to first pass the statement alter session SET container = PDB's name to convert to the corresponding name of the PDB and then create the user, if you want to learn more about the differences between common user and local user, please refer to the Oracle official documentation Oracle Database Security Guide). A CDB can have only one root.
2, Seed:seed, aka Pdb$seed, is the template used to create a new PDB. However, you cannot add or modify objects in seed, and a CDB can have only one seed.
3, the image of pdb:pdb to users and applications is like a normal database without CDB. For example, a PDB can include all the data and code needed to support a particular application. The PDB is completely backwards compatible with all databases of the previous version of ORACLE12C.
Each of these components is called a container (container), and ROOT, SEED, and PDB are containers. These containers have their own unique container ID and name in the CDB. We can easily insert a PDB into the CDB or pull a pdb out of the CDB. When we insert a PDB into the CDB, it is equivalent to connecting the PDB to the CDB. Conversely, the relationship is lifted.
What? You ask me why Oracle is doing this, and it makes you feel troubled and troubled. Well, I'll tell you. This actually greatly facilitates the migration of data. We can easily move a specific PDB from one CDB to another, without changing any of the data and schemas in it. Isn't that very wonderful? Of course, a PDB can only insert a CDB instead of multiple at the same time. Each PDB has its own unique globally unique identifier (GUID) to prevent the PDB from being used in a garbled way.

Actual combat::::
Plsql related
Using SQL Developer, as with the CDB, just select "service name" and then fill in "PDBORCL" in the service name.
Using Sqlplus, conn Sys/[email PROTECTED]//LOCALHOST:1521/PDBORCL as SYSDBA.

Java Development Connection Oracle 12c encounters a problem record with PDB
Today's first use of Java to connect Oracle 12c, encountered a variety of problems, for the convenience of follow-up query, in the summary of the problem records and solutions are as follows.

Ora-28040:no Matching authentication protocol

Need to be in ... \product\12.1.0\dbhome_1\network\admin\sqlnet.ora

The file is added

Sqlnet. Allowed_logon_version=8

Ora-12505:tns:listener does not currently know of SID given in Connect descriptor

The SID should be an existing ID before it can be. When Java connects to Oracle 12c, the malformed SID is not recognized and should be treated like the following problem.

Ora-01017:invalid Username/password; Logon denied

In PDB mode, the connection string should be in this format

Jdbc:oracle:thin: @localhost: 1521/PDBORCL

Similar to the following is a colon, or locahost before//, can not be used properly.

Alter session SET container = PDBORCL;

Talking about the relationship between ORACLE12C database, user, CDB and PDB

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.