做IM 实验,查询如下视图,发现一共有4个CON_ID:
SQL> select * from v$inmemory_area;
POOL ALLOC_BYTES USED_BYTES POPULATE_STATUS CON_ID
-------------------------- ----------- ---------- -------------------------- ----------
1MB POOL 166723584 0 DONE 1
64KB POOL 33554432 0 DONE 1
1MB POOL 166723584 0 DONE 2
64KB POOL 33554432 0 DONE 2
1MB POOL 166723584 0 DONE 3
64KB POOL 33554432 0 DONE 3
1MB POOL 166723584 0 DONE 4
64KB POOL 33554432 0 DONE 4
但是查询PDBS,并没有CON_ID=1的PDB:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
4 IM READ WRITE NO
所以以为是CDB的CON_ID,但是查询发现,CDB 的是0:
SQL> select name,con_id from v$database;
NAME CON_ID
--------- ----------
DAVE 0
https://www.cndba.cn/dave/article/235https://www.cndba.cn/dave/article/235https://www.cndba.cn/dave/article/235
去官方手册上查了一下,关于CON_ID 分配的值如下:
CON_ID =1 是rootcontainer的值。 https://www.cndba.cn/dave/article/235
https://www.cndba.cn/dave/article/235
12c 中的CDB 由root container,seed pdb container,0个或者多个pdb container组成。 root container 用来存储CDB的metadata,从而来管理PDB. 一个CDB 架构中,只能有一个root container,所以的PDB都属于root container。
https://www.cndba.cn/dave/article/235
继续验证:
https://www.cndba.cn/dave/article/235
SQL> column name format a8
SQL>select name, con_id, dbid, con_uid, guid from v$containers order by con_id;
NAME CON_ID DBID CON_UID GUID
-------- ---------- ---------- ---------- --------------------------------
CDB$ROOT 1 925913465 1 FD9AC20F64D344D7E043B6A9E80A2F2F
PDB$SEED 2 377621646 377621646 0743A4726591213FE0531E02A8C01669
PDB1 3 2474873684 2474873684 0743C83A7DBA2455E0531E02A8C04F3F
IM 4 3759505804 3759505804 23D7A6C8C97431C8E0531E03A8C07448
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
4 IM READ WRITE NO
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> show con_id
CON_ID
------------------------------
1
SQL>
版权声明:本文为博主原创文章,未经博主允许不得转载。