OceanBase Database supports PL system packages, which extend database functionality and provide access to SQL features from PL.
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 collections of encapsulated 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 system packages and their related information:
SELECT * FROM __all_package;
Structure of PL system packages
PL system packages have two parts: the package header (SPECIFICATION) and the package body (BODY). The package header is the application interface and contains public declarations visible to the application, declaring types, variables, constants, exceptions, cursors, and subprograms that can be used. The package body contains implementation details and private declarations hidden from the application, fully defining cursors and subprograms to support the package header's implementation.
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 | For managing resource usage plans, resource groups, and resource plan directives. |
| DBMS_STATS | For viewing and modifying 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_WORKLOAD_REPOSITORY | For managing the Automatic Workload Repository (AWR). |
| DBMS_XPLAN | Provides functionality related to logical plan management, including logical plan optimization tracing. |
| DBMS_OB_LIMIT_CALCULATOR | For retrieving the current resource usage information of the cluster and planning operations such as scaling, node replacement, and creation of standby tenants based on this information. |
| DBMS_DATA_DICT | For controlling the scheduling of the data dictionary. |