Solve ORA-27106 when starting DB without restart the system Recently updated !
On Oracle 19c and above, my recommendation is to have the parameter USE_LARGE_PAGES=AUTO_ONLY.
This means that the database will allocate huge pages automatically and only start if it was successful doing so. No need to configure manually /etc/sysctl.conf (the nr_hugepages) anymore.
On a server today, when starting the database I got this:
oracle@myclient $ srvctl start database -db CLIENTDB_SITE1
PRCR-1079 : Failed to start resource ora.clientdb_site1.db
CRS-5017: The resource action "ora.clientdb_site1.db start" encountered the following error:
ORA-27106: system pages not available to allocate memory
Additional information: 6212
Additional information: 1
. For details refer to "(:CLSN00107:)" in "/u00/app/oracle/diag/crs/myclient/crs/trace/ohasd_oraagent_oracle.trc".
CRS-2674: Start of 'ora.clientdb_site1.db' on 'myclient' failed
The database is configured with SGA_TARGET=20G (SGA_MAX_TARGET is not set) and there is enough memory in the server:
oracle@myclient $ free -h
total used free shared buff/cache available
Mem: 125Gi 62Gi 27Gi 21Gi 36Gi 41Gi
Swap: 4.0Gi 0B 4.0Gi
We see there are 41G available. Problem is that hugepages require a continuous blocks and the buffer/cache slots were fragmenting the memory.
Luckily it was enough to clear the part of the PageCache (this is a safe operation, there were other DBs running on the server):
oracle@myclient $ sudo sync # make sure all is written to disk
oracle@myclient $ sudo echo 1 | sudo tee /proc/sys/vm/drop_caches # clear PageCache
oracle@myclient $ free -h
total used free shared buff/cache available
Mem: 125Gi 58Gi 44Gi 20Gi 22Gi 46Gi
Swap: 4.0Gi 0.0Ki 4.0Gi
We see it released 14GB of memory, and then it had enough continuous blocks to provide 20G of huge pages and the database could be started.
oracle@myclient $ srvctl start database -db CLIENTDB_SITE1
oracle@myclient $ free -h
total used free shared buff/cache available
Mem: 125Gi 75Gi 26Gi 20Gi 23Gi 28Gi
Swap: 4.0Gi 0.0Ki 4.0Gi
