ALL_OB_SOURCE

2026-02-05 05:53:37  Updated

Note

This view is introduced in V4.3.5 BP4.

Purpose

The ALL_OB_SOURCE view displays the source code information of the storage objects that the current user can access.

Columns

Column Type Nullable? Description
OWNER VARCHAR2(128) NO The username of the object owner.
TYPE VARCHAR2(12) NO The type of the object.
LINE NUMBER(38) NO The line number of the source code, 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 that the current user can access, and display the first five 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 |
+-------+------------+---------+------+--------------------------------------------------------------------+---------------+

References

DBA_OB_SOURCE USER_OB_SOURCE

Contact Us