OceanBase Database provides procedural language (PL) packages to extend database functionality and provide access to SQL features by using PL statements.
You can use the packages provided when you create your own stored procedures and applications. This manual describes the packages supported by the current OceanBase Database version.
A package is an encapsulated collection of related program objects stored in the database. A program object can be a stored procedure, a function, a variable, a constant, a cursor, or an exception.
You can execute the following statement as a user with sufficient privileges to view the supported system packages and their information:
SELECT * FROM DBA_SOURCE;
You can execute the following statement to query information about a specific system package:
SELECT * FROM DBA_SOURCE WHERE NAME ='pl_package_name';
Composition of a PL system package
A PL system package consists of two parts: the package specification (SPECIFICATION) and the package body (BODY). The package specification is the interface to applications. It declares public items visible to applications, including types, variables, constants, exceptions, cursors, and subprograms. The package body contains implementation details and private declarations invisible to applications. It completely defines cursors and subprograms to support the implementation of the package specification.
Note
The current OceanBase Database version does not allow you to modify system packages.
Usage notes
Packages supplied with OceanBase Database are automatically installed when you create a database.
PL package overview
The following table describes the PL packages supported by the current OceanBase Database version.
| Package | Description |
|---|---|
| DBMS_APPLICATION_INFO | Registers application names with the database for auditing or performance tracking. |
| DBMS_AUDIT_MGMT | Manages audit logs. |
| DBMS_CRYPTO | Encrypts and decrypts stored data. It can be used with a running PL program. It supports encryption and hash algorithms. |
| DBMS_DEBUG | Debugs PL programs. |
| DBMS_DESCRIBE | Queries information related to PL objects. |
| DBMS_JOB | Schedules and manages jobs in the job queue. |
| DBMS_LOB | Provides general-purpose programs for reading/writing large object (LOB) data types such as BLOB and CLOB. |
| DBMS_LOCK | Requests, converts, and releases locks by using the Lock Management service. |
| DBMS_METADATA | Retrieves complete database object definitions, namely the metadata, from the dictionary. |
| DBMS_OUTPUT | Sends messages and displays information. |
| DBMS_PLAN_CACHE | Removes a specified SQL statement from the plan cache. |
| DBMS_RANDOM | Provides a built-in random number generator. |
| DBMS_RESOURCE_MANAGER | Maintains resource usage plans, consumer groups, and plan directives. |
| DBMS_SCHEDULER | Manages scheduled tasks. |
| DBMS_SESSION | Provides access to SQL ALTER SESSION statements and other session information. |
| DBMS_SQL | Provides an interface to use dynamic SQL statements to access the database. |
| DBMS_STATS | Supports viewing and modifying the statistics collected by the optimizer for database objects. |
| DBMS_UDR | Rewrites the SQL statement received by the database based on matching rules before the SQL statement is executed. |
| DBMS_UTILITY | Provides various utility subprograms. |
| DBMS_WORKLOAD_REPOSITORY | Manages the Automatic Workload Repository (AWR). |
| DBMS_XA | Provides the XA/Open interface and allows applications to call the XA interface in PL. |
| DBMS_XMLGEN | Provides the XA/Open interface and allows applications to call the XA interface in PL. |
| DBMS_XPLAN | Provides logical plan management features, such as logical plan optimization and tracing. |
| ODCIConst | Defines constants applicable to PL. |
| UTL_ENCODE | Encodes RAW data into standard formats so that the data can be transmitted between hosts. |
| UTL_FILE | Allows PL programs to read and write OS text files and provides a restricted version of standard OS streaming file I/O. |
| UTL_I18N | Provides a group of services that support globalization for applications compiled by using PL. |
| UTL_RAW | Provides SQL functions for processing data of the RAW data type. |
| ANYDATA TYPE | Contains instances of the specified type, and a description of the type. |
| XMLType | Processes XML data. |