Search notes:

Oracle: V$SQLTEXT_WITH_NEWLINES

v$sqltext_with_newlines contains the same data as v$sqltext, except that newlines are not replaced with spaces.
select /* tq84: v$sqltext_with_newlines */
  listagg(t.sql_text, '') within group (order by t.piece)
from
  v$sqlarea                a                          join
  v$sqltext_with_newlines  t on a.sql_id = t.sql_id
 where
  a.sql_text like '%tq84: v$sqltext_with_newlines %'
order by
  t.piece;
Github repository oracle-patterns, path: /Installed/dynamic-performance-views/sql/text_with_newlines/listagg.sql
select
  listagg(t.sql_text, '') within group (order by t.piece)
from
  v$sqltext_with_newlines t
where
  t.sql_id = '...';
Github repository oracle-patterns, path: /Installed/dynamic-performance-views/sql/text_with_newlines/sqlid-to-stmt.sql

See also

Oracle Dynamic Performance Views

Index