Note
This view is available starting with V2.2.30.
Purpose
The view displays the text source of the storage objects that the current user can access.
Applicability
This view applies only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(30) | NO | The owner of the object. |
| NAME | VARCHAR2(30) | NO | The name of the object. |
| TYPE | VARCHAR2(12) | NO | The type of the object. |
| LINE | NUMBER | NO | The line number in the source code corresponding to the TEXT field. |
| TEXT | CLOB | NO | The source code of the current line. |
| ORIGIN_CON_ID | NUMBER(38) | NO | The tenant ID of the tenant to which the object belongs. The value is 0 for system packages. |
Sample query
View the text source of the storage objects that the current user can access and display the first two records.
obclient [SYS]> SELECT * FROM SYS.ALL_SOURCE WHERE ROWNUM<=2\G
The query result is as follows:
*************************** 1. row ***************************
OWNER: SYS
NAME: JOB_UTILS
TYPE: PACKAGE
LINE: 1
TEXT: PACKAGE JOB_UTILS IS
PROCEDURE insert_date;
PROCEDURE insert_date_program ( job IN VARCHAR2, job_name IN VARCHAR2);
END;
ORIGIN_CON_ID: 1004
*************************** 2. row ***************************
OWNER: SYS
NAME: JOB_UTILS
TYPE: PACKAGE BODY
LINE: 1
TEXT: PACKAGE BODY JOB_UTILS IS
PROCEDURE insert_date IS
BEGIN
INSERT INTO DBMS_SCHEDULER_T1 VALUES(TO_CHAR(sysdate));
COMMIT;
END;
PROCEDURE insert_date_program ( job IN VARCHAR2, job_name IN VARCHAR2) IS
BEGIN
INSERT INTO DBMS_SCHEDULER_T2 VALUES(sysdate, job, job_name);
COMMIT;
END;
END;
ORIGIN_CON_ID: 1004
2 rows in set
References
DBA_SOURCE: view the text source of all storage objects in the current tenant.
USER_SOURCE: view the text source of the storage objects that the current user owns.