Oracle Source Code Text Search

Searches Oracle source code objects for a specified text string within a given schema. Useful for locating procedures, functions, packages, and triggers that contain specific keywords or logic.

oraclesqlreporting-analyticsv1.0.0
0 stars0 downloads13 views0 comments
By OracleDba • Created

Code

(26 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/search_source.sql
-- Author       : Tim Hall
-- Description  : Displays a list of all code-objects that contain the specified word.
-- Requirements : Access to the ALL views.
-- Call Syntax  : @search_source (text) (schema-name)
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
BREAK ON Name Skip 2
SET PAGESIZE 0
SET LINESIZE 500
SET VERIFY OFF

SPOOL Search_Source.txt

SELECT a.name "Name",
       a.line "Line",
       Substr(a.text,1,200) "Text"
FROM   all_source a
WHERE  Instr(Upper(a.text),Upper('&&1')) != 0
AND    a.owner = Upper('&&2')
ORDER BY 1,2;

SPOOL OFF
SET PAGESIZE 14
SET VERIFY ON

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!