1SELECT DBMS_METADATA.get_ddl('TRIGGER', TRIGGER_NAME, OWNER)
2FROM ALL_TRIGGERS -- or DBA_TRIGGERS, USER_TRIGGERS
3WHERE OWNER = 'swhema_name'
4 AND TRIGGER_NAME = 'trigger_name';
1-- Views (use USER_VIEWS or DBA_VIEWS if needed):
2SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME) LIKE upper('%VIEW_NAME%');
3-- Or:
4SELECT dbms_metadata.get_ddl('VIEW', 'VIEW_NAME', 'OWNER_NAME') FROM DUAL;
5
6-- Materialized views (use USER_VIEWS or DBA_VIEWS if needed):
7SELECT QUERY FROM ALL_MVIEWS WHERE upper(MVIEW_NAME) LIKE upper('%VIEW_NAME%');
8-- Or:
9SELECT dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'VIEW_NAME', 'OWNER_NAME')
10FROM DUAL;