OceanBase Database supports PL system packages to extend database functionality and provide access to SQL features.
You can use the provided system packages when creating applications or your own stored procedures. This manual describes the system packages supported by the current version of OceanBase Database.
System packages are encapsulated collections of related program objects stored in the database. Program objects include stored procedures, functions, variables, constants, cursors, and exceptions.
After you have the necessary privileges, you can run the following statement in the oceanbase schema to query the supported system packages and their related information:
SELECT * FROM __all_package;
Structure of PL system packages
PL system packages consist of two parts: the package header (SPECIFICATION) and the package body (BODY). The package header serves as the application interface and contains public declarations visible to the application. These declarations define the types, variables, constants, exceptions, cursors, and subprograms available for use. The package body contains implementation details and private declarations hidden from the application. It fully defines the cursors and subprograms to support the implementation of the package header.
Note
OceanBase Database does not support user modification of system packages in the current version.
Using PL system packages
When you create a database, the system packages provided by OceanBase Database are automatically installed.
Overview of PL system packages
The following table lists the PL system packages supported by the current version of OceanBase Database and their brief descriptions.
| System package | Description |
|---|---|
| DBMS_RESOURCE_MANAGER | Used to maintain resource usage plans, resource usage groups, and resource plan directives. |
| DBMS_STATS | View and modify the statistics collected by the optimizer for database objects. |
| DBMS_UDR | Provides rewrite binding functionality, allowing SQL statements received by the database to be rewritten based on matching rules before SQL execution begins. |
| DBMS_XPLAN | Provides features related to logical plan management, including logical plan optimization tracking. |
| DBMS_WORKLOAD_REPOSITORY | Used to manage the Automatic Workload Repository (AWR). |
| DBMS_MVIEW | Allows callers to understand the functionality of materialized views and potential materialized views, including their query rewrite availability. It also enables refreshing materialized views not in the same refresh group and clearing logs. |
| DBMS_MVIEW_STAT | Allows callers to use interfaces to manage the collection and retention of statistics for materialized view refresh operations. |
| DBMS_TRUSTED_CERTIFICATE_MANAGER | Allows callers to add, delete, and modify CA root certificates trusted by the OBServer cluster for RPC security authentication. |
| DBMS_OB_LIMIT_CALCULATOR | Used to obtain the current resource usage information of the cluster and plan operations such as scaling, node replacement, and standby tenant creation based on this information. |
| DBMS_EXTERNAL_TABLE | Provides programmatic interfaces for managing and operating external tables. |
| DBMS_PARTITION | Provides dynamic partition management interfaces. |
| DBMS_JAVA | Used to integrate and manage Java programs within the database, supporting the implementation of Java stored procedures, functions, and security policies. |
| DBMS_PYTHON | Used to integrate and manage Python programs within the database, supporting the implementation of Python stored procedures, functions, and security policies. |
| DBMS_OB_LIMIT_CALCULATOR | Used to obtain the current resource usage information of the cluster and plan operations such as scaling, node replacement, and standby tenant creation based on this information. |
| DBMS_DATA_DICT | Used to control the scheduling of data dictionaries. |