프린트 하기

OS환경 : Oracle Linux 7.6 (64bit)

 

DB 환경 : Oracle Database 19.3.0.0

 

에러 : WARNING: too many parse errors

alert log 에 발생하는 WARNING: too many parse errors 메세지

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ vi alert.log
2023-05-01T03:54:39.882161+09:00
WARNING: too many parse errors, count=100 SQL hash=0x5ea91b7c
PARSE ERROR: ospid=5585, error=6550 for statement: 
2023-05-01T03:54:39.882243+09:00
BEGIN
FOR i IN 1..100000
LOOP
INSERT INOT SESS_TEST VALUES (SESS_TEST_SEQ.NEXTVAL, SYSDATE, i);
END LOOP;
END;
Additional information: hd=0x65bf2de8 phd=0x6275cd90 flg=0x28 cisid=78 sid=78 ciuid=78 uid=78 sqlid=0jqxyxpgak6vw
...Current username=IMSI
...Application: SQL*Plus Action:

 

 

해결 방법 : 어플리케이션에서 에러 발생시키는 쿼리 찾아서 수정

해당 sql을 실행한 어플리케이션을 찾아서 쿼리를 수정해줘야함

alert log 에서 최초 발생한 WARNING: too many parse errors 다음 메세지에 문제를 일으킨 쿼리가 나옴 

해당 쿼리를 어플리케이션 담당자에게 전달하여 쿼리를 수정할수 있도록 하면 됨

 

 

원인 : 오라클 구문 에러로 인한 파싱 에러 발생

오라클 쿼리를 실행할때 예를들어 아래와 같이 입력해줘야 정상실행 되는데

1
SQL> SELECT * FROM EMP;

 

 

이렇게 FROM을 FORM으로 틀리거나 오타를 내면 구문 분석 과정(PARSE) 과정에서 에러가 발생함

1
SQL> SELECT * FORM EMP;

 

 

이 에러가 과도하게 많이 발생하면 alert log에 해당 워닝 메세지가 발생함

 

 

테스트

sql 반복 실행용 toom.sh 파일 생성

1
2
3
4
5
6
7
8
$ vi toom.sh
#!/bin/bash
 
for ((i=1; i<=100; i++))
do
nohup sqlplus imsi/imsi @toom.sql &
done
wait

 

 

오타를 낸 sql 파일 생성(insert 에서 INTO를 INOT로 작성함)

1
2
3
4
5
6
7
8
9
$ vi toom.sql
BEGIN
FOR i IN 1..100000
LOOP
INSERT INOT SESS_TEST VALUES (SESS_TEST_SEQ.NEXTVAL, SYSDATE, i);
END LOOP;
END;
/
EXIT;

 

 

쉘 스크립트 실행

1
$ sh toom.sh

 

 

alert log 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ vi alert.log
2023-05-01T03:54:39.882161+09:00
WARNING: too many parse errors, count=100 SQL hash=0x5ea91b7c
PARSE ERROR: ospid=5585, error=6550 for statement: 
2023-05-01T03:54:39.882243+09:00
BEGIN
FOR i IN 1..100000
LOOP
INSERT INOT SESS_TEST VALUES (SESS_TEST_SEQ.NEXTVAL, SYSDATE, i);
END LOOP;
END;
Additional information: hd=0x65bf2de8 phd=0x6275cd90 flg=0x28 cisid=78 sid=78 ciuid=78 uid=78 sqlid=0jqxyxpgak6vw
...Current username=IMSI
...Application: SQL*Plus Action: 

WARNING: too many parse errors 워닝 메세지가 발생함

 

 

만약 어플리케이션 수정이 어려운 경우 아래 파라미터를 0으로 변경하여 이 메세지가 발생하지 않게 할수도 있음(기본값은 100)

1
2
3
SQL> alter system set "_kks_parse_error_warning"=0 scope=both;
 
System altered.

 

 

해당 히든 파라미터 설명

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SQL> 
set lines 200 pages 1000
col desc for a30
col name for a40
col current_value for a15
col default_value for a15
col default_t_f for a15
select
ksppinm "name",
ksppdesc "desc",
ksppstvl "current_value",
b.ksppstdfl "default_value"
from x$ksppi a, x$ksppsv b
where 1=1
and a.indx=b.indx
AND SUBSTR(a.KSPPINM, 11= '_'
and a.ksppinm like '%_kks_parse_error_warning%' 
order by 1;
 
name                                     desc                           current_value   default_value
---------------------------------------- ------------------------------ --------------- ---------------
_kks_parse_error_warning                 Parse error warning            0               100

 

 

위 방법으로 메세지가 발생하지 않게 할수 있긴 하지만

파싱 에러가 많이 발생하면 CPU, library cache 경합이 높아져 성능에도 안좋음

어플리케이션에서 쿼리를 수정하는게 바람직함

 

 

참조 : https://positivemh.tistory.com/675

 

WARNING: too many parse errors, count=500 SQL hash=0x750004bb

OS환경 : Oracle Linux 7.6 (64bit) DB 환경 : Oracle Database 12.2.0.1 에러 : WARNING: too many parse errors, count=500 SQL hash=0x750004bbdb 기동시 alert log에 다량 발생하는 메세지1234567891011121314151617181920212223242526272829303132333

positivemh.tistory.com

2320935.1, 2895943.1