Editing a trace file from SQL*Plus

The following script developed under Oracle 9.2.0.1 on Windows 2000 displays the contents of the current trace file in SQL*Plus

SET SUFFIX TRC
COLUMN filename NEW_VALUE filename

SELECT p1.value||'\'||p2.value||'_ora_'||p.spid filename
FROM
    v$process p,
    v$session s,
    v$parameter p1,
    v$parameter p2
WHERE p1.name = 'user_dump_dest'
AND p2.name = 'db_name'
AND p.addr = s.paddr
AND s.audsid = USERENV ('SESSIONID');

EDIT &&filename
    
SET SUFFIX SQL
COLUMN filename CLEAR

Note that this script may need amendment for other Oracle versions / platforms as the format of the trace file name is subject to change.

Note that this script will need amendment if the name of the trace file has been altered using the TRACEFILE_IDENTIFIER parameter.