In oracle12c, the concept of pluggable databases, the PDB, is added to allow a database container (CDB) to host multiple pluggable databases (PDB). CDB is all called Containerdatabase, the Chinese translation is a database container, the PDB is all called pluggabledatabase, you can plug and unplug the database. The following is an official document about the CDB vs. pdb diagram.
In CDB, you can only create a C # #或C # #开头的用户, and if you do not add c##, you will be prompted with the error "ORA-65096: Public user name or role name is invalid ", only in the PDB database to create our habitual named user, Oracle is called the Local User, the former is called common user. This article primarily addresses how to create DPB users and set the default tablespace throughout the process.
1. Create PDB
At 12C installation, you are prompted to install a pluggable database, as shown in:
This is the default installation and can be created with the following statement if it is not installed at the time:
CREATE DATABASE USER by Learning roles=(connect) file_name_convert= ('D:\App\Oracle\oradata\orcl\ Pdbseed'D:\App\Oracle\oradata\orcl\pdborcl');
Where PDBORCL is the pluggable database I created, Pdbadmin is the user created, learning is the password. File_name_convert to the appropriate directory. The PDB was created successfully.
2. Start the PDB database
1) Open SQL Plus, log in as System user, note the "as SYSDBA" after entering the password;
This is if creating a normal user will prompt "ORA-65096: Public user name or role name is invalid".
Input
Show Con_name
Display as:
You can see that the current container is CDB.
2) Start the PDB database by entering the following code:
Alter Set Container=pdborcl; startup;
3) Modify Tnsnames.ora:
In the "D:\App\Oracle\product\12.1.0\dbhome_1\NETWORK\ADMIN" directory, open Tnsnames.ora with Notepad, and at the end add
= = = = = = =1521= == pdborcl )))
Exit after saving.
3, PL/SQL developer landing
You should pay attention to the database selection here.
4. Create a default table space
1) Login with DBA account
2) Create a table space and modify the user default Tablespace
1 --Create a temporary space2 Create Temporarytablespace pdbadmin_temp3Tempfile'D:\App\Oracle\oradata\orcl\pdborcl\pdbadmin_temp01.dbf'4 size 32m5Autoextend on6 Next32m MAXSIZE Unlimited7 extent management Local;8 9 Ten --Create a data table space One Createtablespace pdbadmin_data A Logging -DataFile'D:\App\Oracle\oradata\orcl\pdborcl\pdbadmin_data01.dbf' - size 10240m theAutoextend on - Next100m MAXSIZE Unlimited - extent management Local; - + --Change the user default table space - Alter UserPdbadmindefaultTablespace Pdbadmin_dataTemporaryTablespace pdbadmin_temp;
Resources:
1, http://www.cnblogs.com/kerrycode/p/3386917.html
2, http://blog.csdn.net/yuguanquan1990/article/details/17495331
Oracle 12c Create PDB users and set default Tablespace