DBMS UTILITY

From Oracle FAQ
Jump to: navigation, search

DBMS_UTILITY is a PL/SQL package in the Oracle database that constains various utility functions and procedures. Some examples:

Contents

[edit] Check if DB is in RAC mode

BEGIN
  IF dbms_utility.is_cluster_database THEN
      dbms_output.put_line('Running in SHARED/RAC mode.');
  ELSE
      dbms_output.put_line('Running in EXCLUSIVE mode.');
  END IF;
END;
/

[edit] Get current instance number

SELECT dbms_utility.current_instance FROM dual;

[edit] Get OS and TWO TASK PROTOCOL version

SELECT dbms_utility.port_string FROM dual;

[edit] Get OS's endianness

SELECT dbms_utility.get_endianness FROM dual;