sql-server

9 Пост

oracle

11 Пост

postgresql

12 Пост

my-sql

2 Пост

common-sql

2 Пост

News

5 Новости

Oracle Non-CDB vs CDB/PDB — Quick Reference

1. Check database architecture

 
SELECT name, cdb, open_mode
FROM v$database;
 
  • CDB = NONon-CDB
  • CDB = YESCDB/PDB architecture

If CDB = YES, check the current container:

 
SHOW CON_NAME;
 

2. Non-CDB

Traditional Oracle architecture:

 
ORCL (Non-CDB)
 ├── SYS
 ├── SYSTEM
 └── DWH_N
 

Create a normal user directly:

 
CREATE USER DWH_N IDENTIFIED BY "password";
 

No C##, no PDB.

3. CDB/PDB

 
CDB
 ├── CDB$ROOT
 │    └── C##...      ← common users
 └── ORCLPDB
      └── DWH_N       ← local user
 

Inside a PDB, normal usernames such as DWH_N are allowed. In CDB$ROOT, user-created common users normally use C##.

4. Creating a non-CDB

With DBCA:

 
-createAsContainerDatabase false
 

This is the key option.

5. Most important rule

A user does not exist independently of a database/container.

 
Create database
      ↓
Connect to correct database/container
      ↓
CREATE USER
      ↓
GRANT privileges
 

If you have both a non-CDB and a CDB/PDB, connect to the non-CDB first and then create the user there.