Oracle DBMS_REGISTRY_SIMPLE
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.2 to 12.2.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.

Do you remember when mainframes were replaced by client-server? When client-server was replaced by n-tier architecture? The "Cloud" is a distraction ... DevOps is not. Prepare for the future.
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_SERVER
DBMS_REGISTRY_SYS
What's New In 12cR1
What's New In 12cR2

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