Overview

2023-12-25 08:49:42  Updated

The DBMS_UTILITY package provides utility subprograms.

Notice

In the current OceanBase Database version, the DBMS_UTILITY package does not support passing parameters in the UTF-16 code.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

Data structure

The DBMS_UTILITY package defines the following RECORD and TABLE types:

/*RECORD type*/
TYPE INSTANCE_RECORD IS RECORD (
INST_NUMBER   NUMBER,
INST_NAME     VARCHAR2(60));

/*TABLE types*/
TYPE UNCL_ARRAY IS TABLE OF VARCHAR2(32767) INDEX BY BINARY_INTEGER;
TYPE NAME_ARRAY IS TABLE OF VARCHAR2(128) INDEX BY BINARY_INTEGER;
TYPE QUOTED_NAME_ARRAY IS TABLE OF VARCHAR2(130) INDEX BY BINARY_INTEGER;
TYPE LNAME_ARRAY IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;
TYPE MAXNAME_ARRAY IS TABLE OF VARCHAR2(32767) INDEX BY BINARY_INTEGER;
TYPE DBLINK_ARRAY IS TABLE OF VARCHAR2(128) INDEX BY BINARY_INTEGER;
TYPE INDEX_TABLE_TYPE IS TABLE OF BINARY_INTEGER INDEX BY BINARY_INTEGER;
TYPE NUMBER_ARRAY IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;

TYPE INSTANCE_TABLE IS TABLE OF INSTANCE_RECORD INDEX BY BINARY_INTEGER;

Subprograms

The following table describes the DBMS_UTILITY subprograms supported by the current OceanBase Database version.

Subprogram Description
ACTIVE_INSTANCES Returns active instances.
COMMA_TO_TABLE Converts a list of names delimited by commas (,) into a PL table of names.
CURRENT_INSTANCE Returns the ID of the currently connected instance.
DB_VERSION Returns the version information of the database.
FORMAT_CALL_STACK Formats the current call stack.
FORMAT_ERROR_BACKTRACE Formats the backtrace of the call stack where the exception was thrown.
FORMAT_ERROR_STACK Formats the current error stack.
GET_ENDIANNESS Obtains the endianness of the database platform.
GET_HASH_VALUE Calculates the hash value of a given string.
GET_PARAMETER_VALUE Obtains the value of a specified init.ora parameter.
GET_SQL_HASH Calculates the hash value of a specified string by using the MD5 algorithm.
GET_TIME Returns the current time in hundredths of a second.
IS_BIT_SET Checks the setting of a specified bit in a specified RAW value.
IS_CLUSTER_DATABASE Checks whether the database is running in cluster database mode.
NAME_RESOLVE Resolves a specified name.
NAME_TOKENIZE Calls the parser to parse a specified name.
OLD_CURRENT_SCHEMA Returns the session value from SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA').
OLD_CURRENT_USER Returns the session value from SYS_CONTEXT ('USERENV', 'CURRENT_USER').
PORT_STRING Returns a string that uniquely identifies the database version and OS.
TABLE_TO_COMMA Converts a PL table of names into a list of names delimited by commas (,).

Contact Us