Oracle DBMS_REGISTRY_SIMPLE
Version 19.3

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Used with c scripts prior to upgrading the data dictionary.
AUTHID DEFINER
Dependencies
DBMS_REGISTRY DBMS_REGISTRY_SYS DUAL
Documented No
First Available 12.1.0.2
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/dbmscrs.sql
Subprograms
 
IS_DB_CONSOLIDATED
Returns TRUE if a database is a container DB dbms_registry_simple.is_db_consolidated RETURN BOOLEAN;
BEGIN
  IF dbms_registry_simple.is_db_consolidated THEN
    dbms_output.put_line('This is a Consolidated DB');
  ELSE
    dbms_output.put_line('Not a Consolidated DB');
  END IF;
END;
/
 
IS_DB_PDB
Returns TRUE if the current session is connected to a PDB dbms_registry_simple.is_db_pdb RETURN BOOLEAN;
conn / as sysdba

BEGIN
  IF dbms_registry_simple.is_db_pdb THEN
    dbms_output.put_line('This is a PDB');
  ELSE
    dbms_output.put_line('Not a PDB');
  END IF;
END;
/

ALTER SESSION SET CONTAINER = pdbdev;

BEGIN
  IF dbms_registry_simple.is_db_pdb THEN
    dbms_output.put_line('This is a PDB');
  ELSE
    dbms_output.put_line('Not a PDB');
  END IF;
END;
/
 
IS_DB_PDB_SEED
Returns TRUE if the current session is connected to the SEED PDB dbms_registry_simple.is_db_pdb_seed RETURN BOOLEAN;
conn / as sysdba

BEGIN
  IF dbms_registry_simple.is_db_pdb_seed THEN
    dbms_output.put_line('This is PDB$SEED');
  ELSE
    dbms_output.put_line('Not PDB$SEED');
  END IF;
END;
/

ALTER SESSION SET CONTAINER = pdb$seed;

BEGIN
  IF dbms_registry_simple.is_db_pdb_seed THEN
    dbms_output.put_line('This is PDB$SEED');
  ELSE
    dbms_output.put_line('Not PDB$SEED');
  END IF;
END;
/
 
IS_DB_ROOT
Returns TRUE if the current session is connected to the ROOT CONTAINER dbms_registry_simple.is_db_root RETURN BOOLEAN;
conn sys@pdbdev as sysdba

BEGIN
  IF dbms_registry_simple.is_db_root THEN
    dbms_output.put_line('This is CDB$ROOT);
  ELSE
    dbms_output.put_line('Not CDB$ROOT');
  END IF;
END;
/

ALTER SESSION SET CONTAINER = pdbdev;

BEGIN
  IF dbms_registry_simple.is_db_root THEN
    dbms_output.put_line('This is CDB$ROOT);
  ELSE
    dbms_output.put_line('Not CDB$ROOT');
  END IF;
END;
/

Related Topics
Built-in Functions
Built-in Packages
DBMS_REGISTRY
DBMS_REGISTRY_EXTENDED
DBMS_REGISTRY_SERVER
DBMS_REGISTRY_SYS
What's New In 18c
What's New In 19c

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-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx