Issues with CDB User Creation and tablespace allocation in Oracle 12c Database
In Oracle12c, the concept of database plug-in is added, that is, PDB, which allows a database container (CDB) to host multiple pluggable databases (PDB ). CDB is called ContainerDatabase, and the Chinese translation is a database container. PDB is called PluggableDatabase, 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.
It does bring many benefits to programmers for PDB, but it also brings some differences to managers. First, the container database must create a new user and allocate table space without PDB or when the PDB and CDB have the same tablespace. Otherwise, an error is reported. If the table space is allocated to the CDB user when the PDB and CDB have the same tablespace, The tablespace allocated to the user's PDB is not affected. In addition, the CDB user must start with 'C # '. Otherwise, it cannot be created. However, I created it according to the method, and it was created successfully, at the same time, he was granted various permissions, but under Oracle Enterprise Manager, I could not see the role I created myself, nor could I see the user I just created in the SQL-plus window, you can only Log On As A dba when logging on. I don't know if my computer is faulty or not. The following section describes how to create a user c # admin starting with 'C # 'without the dba permission and connect to the user. This is to create the user "C # ADMIN" without PDB and allocate the "USERS" tablespace. We connect to the database again as a system, and then create the tablespace test in the container database (CDB). Note that there is no test tablespace in the plug-in Database (PDB, create a new user c # test in the container database (CDB) and assign the test tablespace to it as its default tablespace. Because no tablespace exists in PDBORCL, an error is returned.
---- Switch to PDB "PDBORCL"
SQL> alter sessionset container = pdborcl;
The session has been changed.
SQL> createtablespace test -- create a tablespace test
2 datafile 'f: \ oracledata \ test. dbf'
3 size1m autoextend on;
The tablespace has been created.
-- Since table space test is available in both CDB and PDB, creating users and allocating table null
.
SQL> createuser c # test
2 identified by test
3 default tablespace test
4 temporary tablespace temp;
The user has been created.
SQL>