프린트 하기

OS 환경 : Oracle Linux 9.6 (64bit)

 

DB 환경 : Oracle Database 19.28.0.0

 

에러 : ORA-27106: system pages not available to allocate memory

리눅스9 버전에서 19c 설치 후 hugepage 설정 후 기동하려할때 발생하는 에러

 

 

db 설치 후 기동

1
2
3
4
5
SQL> select status from v$instance
 
STATUS
------------
OPEN

 

 

hugepage 파라미터 값 계산

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ sh hugepages_settings.sh
 
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments on Oracle Linux. Before proceeding with the execution please note following:
 * For ASM instance, it needs to configure ASMM instead of AMM.
 * The 'pga_aggregate_target' is outside the SGA and
   you should accommodate this while calculating the overall size.
 * In case you changes the DB SGA size,
   as the new SGA will not fit in the previous HugePages configuration,
   it had better disable the whole HugePages,
   start the DB with new SGA size and run the script again.
And make sure that:
 * Oracle Database instance(s) are up and running
 * Oracle Database Automatic Memory Management (AMM) is not setup
   (See Doc ID 749851.1)
 * The shared memory segments can be listed by command:
     # ipcs -m
 
 
Press Enter to proceed...
 
Recommended setting: vm.nr_hugepages = 738

vm.nr_hugepages을 738로 설정해야함
참고 : 오라클 19c Hugepages 설정 스크립트 최신버전 및 수동계산 ( https://positivemh.tistory.com/1278 )

 

 

sysctl.conf에 삽입 후 적용

1
2
3
# cat /etc/sysctl.conf | grep huge
vm.nr_hugepages = 738
# sysctl -p

 

 

memlock limit 삽입

1
2
3
4
5
$ cat /etc/security/limits.conf | grep mem
#        - memlock - max locked-in-memory address space (KB)
#        - msgqueue - max memory used by POSIX message queues (bytes)
*   soft   memlock    60397977
*   hard   memlock    60397977

 

 

use_large_pages 파라미터 only 로 변경 후 db 종료

1
2
3
4
5
SQL> alter system set use_large_pages=only scope=spfile;
 
System altered.
 
SQL> shutdown immediate

 

 

db 기동

1
2
3
4
5
SQL> startup nomount
ORA-27106: system pages not available to allocate memory
Additional information: 6206
Additional information: 2
Additional information: 3

nomount 조차도 기동되지 않음

 

 

alert log 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$ tail -300f /app/oracle/diag/rdbms/ora19fs/ORA19FS/trace/alert_ORA19FS.log
2025-10-12T15:56:47.602272+09:00
Starting ORACLE instance (normal) (OS id: 61137)
2025-10-12T15:56:47.610400+09:00
****************************************************
 Sys-V shared memory will be used for creating SGA
 ****************************************************
2025-10-12T15:56:47.610658+09:00
ERROR: Failed to get available system pages to allocate memory
2025-10-12T15:56:47.610732+09:00
**********************************************************************
2025-10-12T15:56:47.610790+09:00
Dump of system resources acquired for SHARED GLOBAL AREA (SGA)
 
2025-10-12T15:56:47.610960+09:00
 Domain name: user.slice/user-0.slice/session-14.scope
2025-10-12T15:56:47.611061+09:00
 Per process system memlock (soft) limit = 128G
2025-10-12T15:56:47.611116+09:00
 Expected per process system memlock (soft) limit to lock
 instance MAX SHARED GLOBAL AREA (SGA) into memory: 1476M
2025-10-12T15:56:47.611236+09:00
 Available system pagesizes:
  4K, 2048K
2025-10-12T15:56:47.611331+09:00
 Supported system pagesize(s):
2025-10-12T15:56:47.611384+09:00
  PAGESIZE  AVAILABLE_PAGES  EXPECTED_PAGES  ALLOCATED_PAGES  ERROR(s)
2025-10-12T15:56:47.611488+09:00
     2048K                0             738                0   ORA-27102
2025-10-12T15:56:47.611537+09:00
 Reason for not supporting certain system pagesizes:
2025-10-12T15:56:47.611584+09:00
  4K - (Pages=0) Large pagesizes only
2025-10-12T15:56:47.611629+09:00
RECOMMENDATION:
2025-10-12T15:56:47.611672+09:00
 1. Configure system with expected number of pages for every
 supported system pagesize prior to the next instance restart operation.
2025-10-12T15:56:47.614625+09:00
**********************************************************************
2025-10-12T15:56:47.614727+09:00
SGA: Realm creation failed

nomount 조차도 기동되지 않음

 

 

해결 방법 : sysctl.conf에 vm.hugetlb_shm_group 추가

group에서 dba 그룹의 gid 확인

1
2
3
4
# cat /etc/group |grep dba
dba:x:54322:oracle
# cat /etc/group |grep oinstall
oinstall:x:54321:oracle

54322, 54321임

 

 

sysctl.conf 파일에 아래 파라미터 추가
오라클 db 프로세스가 속한 os 그룹(예: oinstall)으로 설정해야함
예시) vm.hugetlb_shm_group=<gid>

1
2
# vi /etc/sysctl.conf
vm.hugetlb_shm_group=54322

 

 

적용

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
vm.nr_hugepages = 738
vm.hugetlb_shm_group = 54322

적용됨

 

 

다시 기동 시도

1
2
3
4
5
6
7
8
9
10
SQL> startup
ORACLE instance started.
 
Total System Global Area 1543502248 bytes
Fixed Size                  8939944 bytes
Variable Size             369098752 bytes
Database Buffers         1157627904 bytes
Redo Buffers                7835648 bytes
Database mounted.
Database opened.

정상적으로 기동됨

 

 

원인 : 리눅스9 버전부터 vm.hugetlb_shm_group를 설정해줘야함

리눅스9 버전부터 redhat linux 정책에 따라 hugepages 사용 권한이 있는 oracle os 사용자 그룹의 경우
vm.hugetlb_shm_group 파라미터 설정을 sysctl.conf에 추가해야함
이 파라미터는 오라클 db 프로세스가 속한 os 그룹(예: oinstall)으로 설정할 수 있음
이 파라미터를 넣지 않으면 본문과 같은 에러로 db가 기동되지 못함

 

 

참조 : 

Customer RecommendedOracle 19c Database not Using HUGEPAGES - Implement SHM_HUGETLB (Doc ID 3010862.1)
https://positivemh.tistory.com/1278
https://positivemh.tistory.com/603