I believe you can find the source at all_triggers. Unfortunately, the data is in the LONG variable (the Oracle example, as I say, is not the way I am). Thus, the easiest way is to create a scratch table for use, populate it with data converted to a CLOB, and then search:
CREATE TABLE tr (trigger_name VARCHAR2(32), trigger_body CLOB); INSERT INTO tr (SELECT trigger_name, TO_LOB(trigger_body) FROM all_triggers WHERE owner = 'xxx'); SELECT trigger_name FROM tr WHERE trigger_body LIKE '%something%';
I'm not sure why the dba_source view is only available for triggers. So in my database 10.2.0.4.
EDIT:
The following is a short script that you can use to recreate all of your triggers, after which they should all be in dba_source:
CREATE TABLE temp_sql (sql1 CLOB, sql2 CLOB); INSERT INTO temp_sql (sql1, sql2) ( SELECT 'CREATE OR REPLACE TRIGGER '|| DESCRIPTION||' '||CASE WHEN when_clause IS NULL THEN NULL ELSE 'WHEN('||when_clause||')' END sql1, to_lob(trigger_body) sql2 FROM all_triggers WHERE table_owner = 'theowner'); DECLARE v_sql VARCHAR2(32760); BEGIN FOR R IN (SELECT sql1||' '||sql2 S FROM temp_sql) LOOP v_sql := Rs; EXECUTE IMMEDIATE v_sql; END LOOP; END; /
source share