How does Oracle view trace files and content

01-16-2023

The editor in this article will give you a detailed introduction on how to view the trace file and content in Oracle. The content is detailed, the steps are clear, and the details are handled properly. I hope this article on how to view the trace file and content in Oracle can help you solve your doubts. Follow the editor's guide below Slowly deepen your thinking, let's learn new knowledge together.

In 12.2, Oracle added two new V$DIAG_TRACE_FILE and V$DIAG_TRACE_FILE_CONTENTS views, making it very simple to view the trace file path and its content. There is no need to check a lot of splicing sql.
For example:

  • Check the trace file path and name generated by con_id 3

  • SQL> SELECT ADR_HOME,TRACE_FILENAME,CON_ID 

    FROM v$diag_trace_file 

    WHERE con_id = 3; 

     ADR_HOME TRACE_FILENAME CON_ID

     -------------------------------------------------- -------------------- ------------------------------ ---------- 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_mmon_2309.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_ora_5757.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_lgwr_2289.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_dia0_6296.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_ofsd_6282_6286.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orclorcl_dia0_6171_base_1.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_svcb_5836.trc 1 

    /u01/app/oracle/diag/rdbms/orcl/orcl orcl_ora_2231.trc 1

    • View the content of the corresponding trace file

      < /li>

    SQL> SELECT payload 

    FROM v$diag_trace_file_contents 

    WHERE trace_filename = 'orcl_mmon_2309.trc' 

    ORDER BY line_number; ...too much content. . . 

    *** 2017-02-16T21:04:34.754390+08:00 (CDB$ROOT(1)) 

    AUTO SGA: kmgs_parameter_update_timeout gen0 0 mmon alive 1 PAYLOAD 

    -------------------------------------------------- -------------------------------------------------- 

     *** 2017-02-16T21:04:37.755725+08:00 (CDB$ROOT(1)) 

    AUTO SGA: kmgs_parameter_update_timeout gen0 0 mmon alive 1 

    *** 2017-02-16T21:04:40.756642+08:00 (CDB$ROOT(1)) 

    AUTO SGA: kmgs_parameter_update_timeout gen0 0 mmon alive 1 

    1179 rows selected.


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us

Recommended reading

high perspicacity