OceanBase Database supports PL system packages to 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.
A system package is a collection of related program objects stored in the database. Program objects include stored procedures, functions, variables, constants, cursors, and exceptions.
After you have the corresponding privileges, run the following statement to query the system packages supported by the current version of OceanBase Database and their related information:
SELECT * FROM DBA_SOURCE;
Run the following statement to query the system packages and their related information:
SELECT * FROM DBA_SOURCE WHERE NAME ='pl_package_name';
Structure 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 application interface, which contains public declarations visible to the application. These declarations include types, variables, constants, exceptions, cursors, and subprograms that can be used. 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 specification.
Note
OceanBase Database does not support user modification of system packages in the current version.
Use of PL system packages
When you create a database, OceanBase Database automatically installs the system packages it provides.
PL system packages
The following table lists the PL system packages supported in the current version of OceanBase Database and their brief descriptions.
System package |
Description |
|---|---|
| DBMS_APPLICATION_INFO | Registers the application name in the database for auditing or performance tracking. |
| DBMS_AUDIT_MGMT | Manages audit logs. |
| DBMS_CRYPTO | Encrypts and decrypts stored data, can be used with running PL programs, and supports encryption and hashing algorithms. |
| DBMS_DEBUG | Debugs PL programs. |
| DBMS_DESCRIBE | Retrieves information about PL objects. |
| DBMS_LOB | Provides general procedures for large objects (LOB) data types BLOB and CLOB (read/write). |
| DBMS_LOCK | Requests, converts, and releases locks through the Lock Management service. |
| DBMS_METADATA | Allows callers to easily retrieve complete database object definitions (metadata) from the dictionary. |
| DBMS_OUTPUT | Inputs and outputs information. |
| DBMS_PLAN_CACHE | Removes specified SQL statements from the Plan Cache. |
| DBMS_RANDOM | Provides a built-in random number generator. |
| DBMS_RESOURCE_MANAGER | Maintains resource usage plans, resource usage groups, and resource plan directives. |
| DBMS_SCHEDULER | Manages scheduled tasks. |
| DBMS_SESSION | Provides access to SQL ALTER SESSION statements and other session information through stored procedures. |
| DBMS_SQL | Accesses the database using dynamic SQL. |
| DBMS_STATS | Views and modifies optimizer statistics collected for database objects. |
| DBMS_UDR | Provides rewrite binding functionality, which allows you to rewrite SQL statements received by the database before SQL execution starts based on matching rules. |
| DBMS_UTILITY | Provides various utility subprograms. |
| DBMS_WORKLOAD_REPOSITORY | Manages the Automatic Workload Repository (AWR). |
| DBMS_XA | Contains the XA/Open interface for applications to call the XA interface in PL. |
| DBMS_XMLGEN | Converts the results of SQL queries to standardized XML format and returns the results as CLOBs. |
| DBMS_PROFILER | Records the execution of each line in PL and summarizes the results, providing detailed execution times for each statement in the PL execution process. |
| DBMS_XPLAN | Provides features related to logical plan management, including logical plan optimization tracing. |
| DBMS_DDL | Encrypts PL object definition strings. |
| ODCIConst | Defines constants applicable to PL. |
| UTL_ENCODE | Encodes RAW data in standard formats for data transmission between hosts. |
| UTL_FILE | Allows PL programs to read and write operating system text files and provides a restricted version of standard operating system stream file I/O. |
| UTL_I18N | Provides a set of services (globalization services) for applications written in PL. |
| UTL_RECOMP | Recompiles objects in the entire database or in a specific schema. |
| UTL_RAW | Provides SQL functions for processing RAW data types. |
| ANYDATA TYPE | Contains instances of a given type and a description of the type. |
| XMLType | Processes XML data. |
