Oracle 12C R2-新特性-新增兩個檢視:方便檢視trace檔案和內容

lhrbest發表於2017-02-19

Oracle 12C R2-新特性-新增兩個檢視:方便檢視trace檔案和內容

型別:原創 分類: 2017-02-16 21:08 閱讀(80)次 (0)

版權宣告:本文為博主原創文章,未經博主允許不得轉載。

Oracle 12C R2-新特性-新增兩個試圖-方便檢視trace檔案和內容

12.2中,Oracle新增了兩個V$DIAG_TRACE_FILE and V$DIAG_TRACE_FILE_CONTENTS檢視,使檢視trace檔案路徑及其內容變得非常簡單。不用大把拼接sql去查了。


如:

---檢視con_id3的產生的trace檔案路徑及名稱



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/orcl	       orcl_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
 



---檢視對應trace檔案內容



SQL> SELECT payload

FROM   v$diag_trace_file_contents

WHERE  trace_filename = 'orcl_mmon_2309.trc'

ORDER BY line_number;

....內容太多。。。

*** 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.








來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2133815/,如需轉載,請註明出處,否則將追究法律責任。

相關文章