Select content from current trace file
alter session set events '10046 level 12';
with fil as (
select
case when platform_name like 'Microsoft Windows %' then '\' else '/' end separator
from
v$database
)
select
trc.payload,
trc.timestamp,
trc.section_id, -- This value is 0 except when RECORD_TYPE IS BETWEEN 3 AND 8.
-- When a section, dump or bucket(?) starts, the value of an internal counter is increased and returned in SECTION_ID.
-- When the section, dump or bucket(?) ends, the current value of the internal counter is returned in SECTION_ID.
trc.section_name,
trc.component_name, -- Find list of component names with oradebug doc components
trc.operation_name,
trc.session_id,
trc.serial#,
trc.file_name,
trc.function_name,
-- trc.record_type,
case trc.record_type
when 1 then 'regular'
when 2 then 'freeform'
when 3 then 'section begin' -- Start of a new section whose id is shown in SECTION_ID
when 4 then 'dump begin'
when 5 then 'bucket begin'
when 6 then 'section end'
when 7 then 'dump end'
when 8 then 'bucket end'
end rec_typ,
trc.record_level,
trc.parent_level,
trc.container_name,
trc.con_id,
trc.con_uid,
trc.adr_home, trc.trace_filename,
inf.value
from
fil cross join
v$diag_trace_file_contents trc join
v$diag_info inf on inf.value = trc.adr_home || fil.separator || 'trace' || fil.separator || trc.trace_filename
-- ^^^^^^^
-- ? ? ? ?
where
inf.name = 'Default Trace File'
order by
trc.line_number
;