Note
This view is available starting with V4.2.5 BP7.
Purpose
The ALL_OB_SOURCE view displays the source code information of the storage objects accessible to the current user.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The username of the object owner. |
| TYPE | VARCHAR2(12) | NO | The object type. |
| LINE | NUMBER(38) | NO | The source code line number, which identifies the position of the line in the object definition. |
| TEXT | VARCHAR2(4000) | NO | The source code text, which stores the actual code content corresponding to the line. |
| ORIGIN_CON_ID | NUMBER(38) | NO | The tenant ID, which identifies the tenant to which the object belongs. |
Sample query
Execute the following command to view the source code information of the storage objects accessible to the current user, and display the first 5 records.
obclient [oceanbase]>SELECT * FROM ALL_OB_SOURCE WHERE rownum <=5;
The query result is as follows:
+-------+------------+---------+------+--------------------------------------------------------------------+---------------+
| OWNER | NAME | TYPE | LINE | TEXT | ORIGIN_CON_ID |
+-------+------------+---------+------+--------------------------------------------------------------------+---------------+
| SYS | dbms_stats | PACKAGE | 1 | PACKAGE dbms_stats AUTHID CURRENT_USER | 1 |
| SYS | dbms_stats | PACKAGE | 2 | DECLARE DEFAULT_METHOD_OPT VARCHAR(1) DEFAULT 'Z'; | 1 |
| SYS | dbms_stats | PACKAGE | 3 | DECLARE DEFAULT_GRANULARITY VARCHAR(1) DEFAULT 'Z'; | 1 |
| SYS | dbms_stats | PACKAGE | 4 | DECLARE AUTO_SAMPLE_SIZE DECIMAL(20, 10) DEFAULT 0; | 1 |
| SYS | dbms_stats | PACKAGE | 5 | DECLARE DEFAULT_STAT_CATEGORY VARCHAR(20) DEFAULT 'OBJECT_STATS'; | 1 |
+-------+------------+---------+------+--------------------------------------------------------------------+---------------+