프린트 하기

OS환경 : Oracle Linux 6.8 (64bit)


DB 환경 : Oracle Database 11.2.0.4, 19.3.0.0


에러 : Active Session History (ASH) performed an emergency flush. This may ~~

sga_target 값 증설 작업 이후 alert log에 발생한 메세지

1
2
3
4
5
6
7
8
9
$ vi alert_orcl.log
Mon Jun 22 21:53:44 2020
Active Session History (ASH) performed an emergency flush. This may mean that ASH is undersized. 
If emergency flushes are a recurring issue, you may consider increasing ASH size by 
setting the value of _ASH_SIZE to a sufficiently large value. Currently, 
ASH size is 17000944 bytes. Both ASH size and the total number of emergency flushes 
since instance startup can be monitored by running the following query:
 
select total_size,awr_flush_emergency_count from v$ash_info; 



해결 방법 : ASH 크기를 현재보다 최소 50% 이상 증가

현재 ASH 크기 확인(alert log 에도 이미 표시되어있음)

1
2
3
4
5
SQL> select total_size from v$ash_info;
 
TOTAL_SIZE
----------
   2097152

2MB로 할당되어 있음



히든 파라미터인 _ash_size 값을 현재 할당 된 것보다 50% 더 큰 값으로 증가

(예를 들어 total_size = 2MB 인 경우 50% 증가하면 (2MB + (2MB * 50 %)) = 3MB가 됨)

1
2
3
4
$ sqlplus / as sysdba
SQL> alter system set "_ash_size"=3145728;
 
System altered.



변경된 ASH 크기 확인

1
2
3
4
5
SQL> select total_size from v$ash_info;
 
TOTAL_SIZE
----------
   3145728

재기동 없이 바로 적용됨

RAC의 경우 한쪽에서 작업 시 모든 노드에 적용됨



alert log 확인 시 scope=both로 적용됨을 알 수 있음

1
2
3
$ vi alert_orcl.log
Mon Jun 22 21:54:04 2020
ALTER SYSTEM SET _ash_size='3145728' SCOPE=BOTH;



추가1

11g 이하에서 "_ash_size"의 설정 가능한 최대 크기는 254MB임, 즉, 2MB 크기의 127개 청크임 

( 12c 이상에서 "_ash_size"의 설정 가능한 최대 크기는 254MB 이상임)



추가2

"_ash_size" 를 더 높은 값을 설정할 수 있지만 내부적으로 254MB로 조정됨 

254MB 이상의 값으로 설정하면 ORA-2097 메세지가 발생함



300MB로 설정 시
1
2
3
4
5
6
7
8
9
SQL> alter system set "_ash_size"=314572800;
 
System altered.
 
SQL> select total_size from v$ash_info;
 
TOTAL_SIZE
----------
 265289728
253MB로 적용됨


400MB로 설정 시
1
2
3
4
5
6
SQL> alter system set "_ash_size"=419430400;alter system set "_ash_size"=419430400
 
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-02097: parameter cannot be modified because specified value is invalid

ORA-2097 메세지가 발생함



19c 에서 테스트 시

400MB로 설정 시

1
2
3
4
5
6
7
8
SQL> alter system set "_ash_size"=419430400;                                      
 
System altered.
 
SQL> select total_size from v$ash_info;
TOTAL_SIZE
----------
 266338304

254MB로 적용됨



500MB로 설정 시

1
2
3
4
5
6
SQL> alter system set "_ash_size"=524288000;
 
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-02097: parameter cannot be modified because specified value is invalid

ORA-2097 메세지가 발생함



12c 이상의 버전일때 400MB 명령은 수행 되지만

적용된 값을 조회해보면 결국 최대 값은 254MB 임



원인 : Active session 증가에 따른 ASH 버퍼 부족

일반적으로 시스템의 일부 활동으로 인해 더 많은 Active session이 발생함

따라서 ASH 버퍼를 평소보다 빠르게 채우면 alert log에 위 메시지가 표시됨

메세지 그 자체는 문제가 아니며 데이터베이스에서 최대 활동을 지원하기 위해 버퍼를 늘려야 할 수도 있음



참조 : Doc. 1385872.1