DBA_OB_SOURCE

2025-11-24 11:02:56  Updated

Note

This view is available starting with V4.2.5 BP7.

Purpose

The DBA_OB_SOURCE view displays the source code information of all stored objects in the current tenant.

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 in the source code, which identifies the position of the line in the object definition.
TEXT VARCHAR2(4000) NO The text of the source code, which stores the actual code content of 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 display the source code information of all stored objects in the current tenant, and display the first 5 records.

obclient [oceanbase]>SELECT * FROM DBA_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

ALL_OB_SOURCE USER_OB_SOURCE

Contact Us