Oracle PDB$SEED
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.
Notes This page is specific to the PDB$SEED container. For more general information about CDBs, PDBs, and CDB$ROOT follow the containers link at page bottom.
Data Dictionary Objects
CDB_CONTAINER_DATA LOGMNRG_SEED$ V$CONTAINERS
CONTAINER$ LOGMNR_SEED$ V$PDBS
DBA_CONTAINER_DATA    
Roles
CDB_DBA    
System Privileges
CLONE PLUGGABLE DATABASE CREATE PLUGGABLE DATABASE SET CONTAINER
check out: catcon.pl, catcon.pm
 
PDB$SEED from PDB$ROOT
Seed Pluggable Container Exploration from Root conn / as sysdba

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> desc container$
Name               Null?    Type
------------------ -------- ------
OBJ#               NOT NULL NUMBER
CON_ID#            NOT NULL NUMBER
DBID               NOT NULL NUMBER
CON_UID            NOT NULL NUMBER
STATUS             NOT NULL NUMBER
CREATE_SCNWRP      NOT NULL NUMBER
CREATE_SCNBAS      NOT NULL NUMBER
CLNSCNWRP                   NUMBER
CLNSCNBAS                   NUMBER
RDBA               NOT NULL NUMBER
FLAGS                       NUMBER
SPARE1                      NUMBER
SPARE2                      NUMBER
SPARE3                      VARCHAR2(128)
SPARE4                      VARCHAR2(128)

SQL> SELECT obj#, con_id#, dbid, con_uid, status, create_scnbas, flags, rdba
   2 FROM container$
   3 ODER BY 2;

 OBJ# CON_ID#       DBID    CON_UID STATUS CREATE_SCNBAS FLAGS    RDBA
----- ------- ---------- ---------- ------ ------------- ----- -------
  175       1 1646890724          1      2             0     0 4194824
91834       2 2025707704 2025707704      2       1689010     1 4194824
91992       3 3821213821 3821213821      2       1702206     0 4194824

SQL> desc v$pdbs
Name              Null?    Type
----------------- -------- ------------
CON_ID                     NUMBER
DBID                       NUMBER
CON_UID                    NUMBER
GUID                       RAW(16)
NAME                       VARCHAR2(30)
OPEN_MODE                  VARCHAR2(10)
RESTRICTED                 VARCHAR2(3)
OPEN_TIME                  TIMESTAMP(3)
CREATE_SCN                 NUMBER
TOTAL_SIZE                 NUMBER

col name format a11
col open_time format a26

SQL> SELECT con_id, dbid, name, open_mode, restricted, open_time, create_scn
   2 FROM v$pdbs
   3 WHERE con_id = 2;

    CON_ID DBID       NAME            OPEN_MODE  RES OPEN_TIME                  CREATE_SCN
---------- ---------- --------------- ---------- --- -------------------------- ----------
         2 4043696482 PDB$SEED        READ ONLY  NO  14-FEB-13 08.15.16.456 AM     2389989

SQL> ALTER PLUGGABLE DATABASE pdb$seed CLOSE;
alter pluggable database pdb$seed close
*
ERROR at line 1:
ORA-65017: seed pluggable database may not be dropped or altered


-- Note: From inside any other PDB you get
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database


SQL> SELECT owner, object_type
   2 FROM dba_objects
   3 WHERE object_name = 'PDB$SEED';

OWNER                     OBJECT_TYPE
------------------------- --------------------
SYS                       UNDEFINED

SQL> SELECT COUNT(*)
2 FROM dba_objects
3 WHERE object_name LIKE 'CDB%';

  COUNT(*)
----------
      1874

SQL> SELECT COUNT(*)
   2 FROM dba_objects
   3 WHERE object_name = 'CDB_OBJECTS';

  COUNT(*)
----------
         2
 
PDB$SEED Internals
Seed Pluggable Container Exploration from inside the container conn / as sysdba

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> ALTER SESSION SET CONTAINER = PDB$SEED;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDB$SEED

-- compare this to the result seen in pdb$root above
SQL> SELECT dbid, name, open_mode, restricted
   2 FROM v$pdbs;

DBID       NAME            OPEN_MODE  RES
---------- --------------- ---------- ---
4043696482 PDB$SEED        READ ONLY  NO


SQL> SELECT COUNT(*)
   2 FROM dba_objects;

  COUNT(*)
----------
     90698

SQL> SELECT COUNT(*)
   2 FROM all_objects;

  COUNT(*)
----------
     89185

col username format a25
col account_status format a17
col default_tablespace format a7
col profile format a10
col temporary_tablespace format a4

SQL> SELECT username, common, account_status, lock_date, expiry_date
   2 FROM dba_users
   3 ORDER BY 1;

USERNAME                  COM ACCOUNT_STATUS    LOCK_DATE            EXPIRY_DATE
------------------------- --- ----------------- -------------------- --------------------
ANONYMOUS                 YES LOCKED            26-MAR-2013 01:43:28
APEX_040200               YES EXPIRED & LOCKED  27-SEP-2012 03:21:55 27-SEP-2012 03:21:55
APEX_PUBLIC_USER          YES EXPIRED & LOCKED  27-SEP-2012 03:18:57 27-SEP-2012 03:18:57
APPQOSSYS                 YES EXPIRED & LOCKED  26-MAR-2013 01:43:17
AUDSYS                    YES EXPIRED & LOCKED  26-MAR-2013 01:16:06
CTXSYS                    YES OPEN              26-MAR-2013 02:18:32
DBSNMP                    YES EXPIRED & LOCKED  26-MAR-2013 01:43:15
DIP                       YES EXPIRED & LOCKED  26-MAR-2013 01:35:36
DVF                       YES OPEN              26-MAR-2013 03:44:58
DVSYS                     YES EXPIRED & LOCKED  26-MAR-2013 03:44:58
EXFSYS                    YES EXPIRED & LOCKED  26-MAR-2013 02:16:02
FLOWS_FILES               YES EXPIRED & LOCKED  27-SEP-2012 03:21:55 27-SEP-2012 03:21:55
GSMADMIN_INTERNAL         YES EXPIRED & LOCKED  26-MAR-2013 01:36:24
GSMCATUSER                YES EXPIRED & LOCKED  26-MAR-2013 01:48:59
GSMUSER                   YES EXPIRED & LOCKED  26-MAR-2013 01:36:24
LBACSYS                   YES OPEN              26-MAR-2013 02:51:53
MDDATA                    YES LOCKED            27-SEP-2012 02:44:30 26-MAR-2013 02:44:29
MDSYS                     YES EXPIRED & LOCKED  26-MAR-2013 02:19:58
OJVMSYS                   YES EXPIRED & LOCKED  26-MAR-2013 02:07:16
OLAPSYS                   YES EXPIRED & LOCKED  26-MAR-2013 02:36:47
ORACLE_OCM                YES EXPIRED & LOCKED  26-MAR-2013 01:36:46
ORDDATA                   YES EXPIRED & LOCKED  26-MAR-2013 02:19:58
ORDPLUGINS                YES EXPIRED & LOCKED  26-MAR-2013 02:19:58
ORDSYS                    YES EXPIRED & LOCKED  26-MAR-2013 02:19:58
OUTLN                     YES OPEN              26-MAR-2013 01:16:09
SI_INFORMTN_SCHEMA        YES EXPIRED & LOCKED  26-MAR-2013 02:19:58
SPATIAL_CSW_ADMIN_USR     YES EXPIRED & LOCKED  26-MAR-2013 02:50:38
SPATIAL_WFS_ADMIN_USR     YES EXPIRED & LOCKED  26-MAR-2013 02:50:33
SYS                       YES OPEN              26-MAR-2013 01:16:06
SYSBACKUP                 YES OPEN              26-MAR-2013 01:16:06
SYSDG                     YES OPEN              26-MAR-2013 01:16:06
SYSKM                     YES OPEN              26-MAR-2013 01:16:06
SYSTEM                    YES OPEN              26-MAR-2013 01:16:06
WMSYS                     YES EXPIRED & LOCKED  26-MAR-2013 01:50:28
XDB                       YES EXPIRED & LOCKED  26-MAR-2013 01:43:27
XS$NULL                   YES EXPIRED & LOCKED  26-MAR-2013 01:36:23

SELECT username, default_tablespace, temporary_tablespace, created, profile, editions_enabled
FROM dba_users
ORDER BY 1;

SQL> SELECT username, default_tablespace, temporary_tablespace, created, profile editions_enabled
2 FROM dba_users
3 ORDER BY 1;

USERNAME                  DEFAULT TEMP CREATED              EDITIONS_E
------------------------- ------- ---- -------------------- ----------
ANONYMOUS                 SYSAUX  TEMP 27-SEP-2012 01:43:28 DEFAULT
APEX_040200               SYSAUX  TEMP 27-SEP-2012 03:18:57 DEFAULT
APEX_PUBLIC_USER          SYSTEM  TEMP 27-SEP-2012 03:18:57 DEFAULT
APPQOSSYS                 SYSAUX  TEMP 27-SEP-2012 01:43:17 DEFAULT
AUDSYS                    SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
CTXSYS                    SYSAUX  TEMP 27-SEP-2012 02:18:32 DEFAULT
DBSNMP                    SYSAUX  TEMP 27-SEP-2012 01:43:15 DEFAULT
DIP                       SYSTEM  TEMP 27-SEP-2012 01:35:36 DEFAULT
DVF                       SYSAUX  TEMP 27-SEP-2012 03:44:58 DEFAULT
DVSYS                     SYSAUX  TEMP 27-SEP-2012 03:44:58 DEFAULT
EXFSYS                    SYSAUX  TEMP 27-SEP-2012 02:16:02 DEFAULT
FLOWS_FILES               SYSAUX  TEMP 27-SEP-2012 03:18:57 DEFAULT
GSMADMIN_INTERNAL         SYSAUX  TEMP 27-SEP-2012 01:36:24 DEFAULT
GSMCATUSER                SYSTEM  TEMP 27-SEP-2012 01:48:59 DEFAULT
GSMUSER                   SYSTEM  TEMP 27-SEP-2012 01:36:24 DEFAULT
LBACSYS                   SYSTEM  TEMP 27-SEP-2012 02:51:53 DEFAULT
MDDATA                    SYSTEM  TEMP 27-SEP-2012 02:44:29 DEFAULT
MDSYS                     SYSAUX  TEMP 27-SEP-2012 02:19:58 DEFAULT
OJVMSYS                   SYSTEM  TEMP 27-SEP-2012 02:07:16 DEFAULT
OLAPSYS                   SYSAUX  TEMP 27-SEP-2012 02:36:47 DEFAULT
ORACLE_OCM                SYSTEM  TEMP 27-SEP-2012 01:36:46 DEFAULT
ORDDATA                   SYSAUX  TEMP 27-SEP-2012 02:19:58 DEFAULT
ORDPLUGINS                SYSAUX  TEMP 27-SEP-2012 02:19:58 DEFAULT
ORDSYS                    SYSAUX  TEMP 27-SEP-2012 02:19:58 DEFAULT
OUTLN                     SYSTEM  TEMP 27-SEP-2012 01:16:09 DEFAULT
SI_INFORMTN_SCHEMA        SYSAUX  TEMP 27-SEP-2012 02:19:58 DEFAULT
SPATIAL_CSW_ADMIN_USR     SYSTEM  TEMP 27-SEP-2012 02:50:38 DEFAULT
SPATIAL_WFS_ADMIN_USR     SYSTEM  TEMP 27-SEP-2012 02:50:33 DEFAULT
SYS                       SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
SYSBACKUP                 SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
SYSDG                     SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
SYSKM                     SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
SYSTEM                    SYSTEM  TEMP 27-SEP-2012 01:16:06 DEFAULT
WMSYS                     SYSAUX  TEMP 27-SEP-2012 01:50:28 DEFAULT
XDB                       SYSAUX  TEMP 27-SEP-2012 01:43:27 DEFAULT
XS$NULL                   SYSTEM  TEMP 27-SEP-2012 01:36:23 DEFAULT

SQL> SELECT COUNT(*)
   2 FROM dba_objects
   3 WHERE object_name LIKE 'CDB%';

  COUNT(*)
----------
      1873
 
Common Users and Roles
Create Common User conn / as sysdba

CREATE USER c##abc IDENTIFIED BY abc;

ALTER SESSION SET CONTAINER = PDB$SEED;

sho con_name

SELECT username
FROM dba_users
WHERE username LIKE 'C##%';

ALTER SESSION SET CONTAINER = PDBORCL;

sho con_name

SELECT username
FROM dba_users
WHERE username LIKE 'C##%';

SQL> DROP USER c##abc;
DROP USER c##abc
*
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
Create Common Role conn / as sysdba

CREATE ROLE c##mlib;

ALTER SESSION SET CONTAINER = PDB$SEED;

sho con_name

SELECT role
FROM dba_roles
WHERE role LIKE 'C##%';

SELECT *
FROM cdb_roles
WHERE role LIKE 'C##%';

ALTER SESSION SET CONTAINER = PDBORCL;

sho con_name

SELECT role
FROM dba_roles
WHERE role LIKE 'C##%';

SELECT *
FROM cdb_roles
WHERE role LIKE 'C##%';

sho user

SQL> DROP ROLE c##mlib;
DROP ROLEe c##mlib
*
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
 
Queries
PDB Related Functions conn / as sysdba

ALTER SESSION SET CONTAINER = PDB$SEED;

sho con_name

SQL> SELECT con_id, dbid, con_uid, guid
   2 FROM v$pdbs;

    CON_ID       DBID    CON_UID GUID
---------- ---------- ---------- --------------------------------
2          4043696482 4043696482 EF72EF6B4DD0416E821AB0AE16B3A4E4

SQL> SELECT con_dbid_to_id(4043696482)
   2 FROM dual;

CON_DBID_TO_ID(4043696482)
--------------------------
                         2

SQL> SELECT con_name_to_id('PDB$SEED')
   2 FROM dual;

CON_NAME_TO_ID('PDB$SEED')
--------------------------
                         2

SQL> SELECT con_uid_to_id(4043696482)
   2 FROM dual;

CON_UID_TO_ID(4043696482)
-------------------------
                        2

-- the function con_guid_to_id appears to be non-functional as seen below
SQL> SELECT con_guid_to_id('EF72EF6B4DD0416E821AB0AE16B3A4E4')
   2 FROM dual;

CON_GUID_TO_ID('EF72EF6B4DD0416E821AB0AE16B3A4E4')
--------------------------------------------------


SQL> SELECT con_guid_to_id(EF72EF6B4DD0416E821AB0AE16B3A4E4)
   2 FROM dual;
SELECT con_guid_to_id(EF72EF6B4DD0416E821AB0AE16B3A4E4)
*
ERROR at line 1:
ORA-00972: identifier is too long

Related Topics
CDBVIEW
Database
DBMS_PDB
DBMS_SERVICE
DBMS_SYNC_REFRESH

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved