OceanBase Database provides procedural language (PL) system packages to extend database functionality and provide access to SQL features by using PL statements.
You can use the system packages provided when you create your own stored procedures and applications. This manual describes the system packages supported by the current OceanBase Database server version.
A system 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.
If you have the required privileges, you can run the following statement in the oceanbase schema to query the supported system packages and their information:
SELECT * FROM __all_package;
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 of PL system packages
System packages supplied with OceanBase Database are automatically installed when you create a database.
Overview of PL system packages
The following table describes the PL system packages supported by the current OceanBase Database version.
| System package | Description |
|---|---|
| DBMS_RESOURCE_MANAGER | Maintains resource usage plans, consumer groups, and plan directives. |
| DBMS_STATS | Allows you to view and modify the statistics collected by the optimizer for database objects. |
| DBMS_UDR | Provides the rewrite binding feature, which rewrites an SQL statement received by the database before execution based on the rewrite rule that the statement matches. |
| DBMS_XPLAN | Provides features for the management of logical plans, such as optimizing and tracing logical plans. |
| DBMS_WORKLOAD_REPOSITORY | Manages the Automatic Workload Repository (AWR). |
| DBMS_MVIEW | Provides you a general understanding of materialized views and their potential features such as query rewrite, and allows you to refresh materialized views that belong to different refresh groups and purge logs. |
| DBMS_MVIEW_STAT | Allows you to manage the collection and retention of materialized view refresh statistics through API operations. |
| DBMS_TRUSTED_CERTIFICATE_MANAGER | Allows you to add, delete, or modify a trusted root CA certificate for a cluster, which is used for remote procedure call (RPC) security authentication. |
| DBMS_OB_LIMIT_CALCULATOR | Obtains the current resource usage information of the cluster. You can plan scaling, node replacement, and standby tenant creation based on the obtained information. |
| DBMS_EXTERNAL_TABLE | Provides a programming interface for managing and operating external tables. |