Document Type | Technical Information
Category | Monitoring/Inspection
Applicable Product Versions | 6FS06, 6FS07, 7FS02
Document Number | TMOTI009
Overview
It can be difficult to trace the SQL causing errors when errors occur in sys.log.
This document guides you on how to find the error-inducing SQL using a memlog dump.
Method
1. Check sys.log
You can obtain the sid and cursor_id (hereafter csr_id) from the error statement below. (sid: 2616, csr_id: 5909)
$ vi $TB_HOME/instance/$TB_SID/log/slog/sys.log [03-11T14:10:13.976905] [FRM-2616] [I] THROW. ec=ERROR_DT_INVALID_DT_INPUT(-5113) [ Invalid year value 'X'. (X) ] (csr_id:5909) [datetime_fmt.c:411:parse_yyyy_]
2. Extract dump
SQL> alter system dump memlog 2616
3. Check dump
$ cd $TB_HOME/instance/$TB_SID/log/memlog $ vi sql_memlog.xxxxx.2616.1
4. Extract SQL
Search for csr_id 5909 and extract the corresponding SQL.
03/11 14:10:13.963835 CSR_ID:5909 WITH MY_INFO AS (
SELECT PERS_NO, DEPT_ID, USER_DIV_CD, SOCPS_CD, ACTVI_YN FROM COM.CSYS021 WHERE PERS_NO = :B1 /* Affiliated Department */
(omitted)CautionIn systems with many transactions, when performing memlog after checking error logs, the SQL causing the error you want to find may be overwritten and lost due to memlog's SQL storage space limitations.Therefore, capture the sid quickly and perform the dump promptly.