I recently encountered an issue where DBCA failed with ORA-27125 when creating a 19c database on Oracle Linux 7. Most of the support notes and posts on the internet pointed to Kernel parameters SHMMAX and SHMALL. The Kernel settings were fine on my server. Here’s how we solved it.
Start with the alert log for the failed instance. The error happens a little after DBCA starts executing. It happens when it tries to start the new instance for database creation.
2020-05-19T18:14:11.304221+00:00 Per process system memlock (soft) limit = 64K 2020-05-19T18:14:11.304325+00:00 Expected per process system memlock (soft) limit to lock instance MAX SHARED GLOBAL AREA (SGA) into memory: 8182M 2020-05-19T18:14:11.304496+00:00 Available system pagesizes: 4K, 2048K 2020-05-19T18:14:11.304649+00:00 Supported system pagesize(s): 2020-05-19T18:14:11.304726+00:00 PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s) 2020-05-19T18:14:11.304917+00:00 2048K 27462 4091 0 ORA-27125 2020-05-19T18:14:11.305012+00:00 Reason for not supporting certain system pagesizes: 2020-05-19T18:14:11.305111+00:00 4K - Large pagesizes only 2020-05-19T18:14:11.305199+00:00 RECOMMENDATION: 2020-05-19T18:14:11.305287+00:00 1. Increase per process memlock (soft) limit to at least 8182MB to lock 100% of SHARED GLOBAL AREA (SGA) pages into physical memory 2020-05-19T18:14:11.305519+00:00
The alert log has the ORA-27125 error logged under the ‘Pagesize’ section.
We are trying to create an instance with 8G SGA.
2020-05-19T18:14:11.304325+00:00 Expected per process system memlock (soft) limit to lock instance MAX SHARED GLOBAL AREA (SGA) into memory: 8182M
The recommendation section tells us to increase the per-process memlock (soft) limit to at least 8182MB to lock 100% of SGA pages into physical memory.
So how much did DBCA detect?
2020-05-19T18:14:11.304221+00:00 Per process system memlock (soft) limit = 64K
DBCA session detected only 64K as the per-process memlock setting. So the issue is not due to a large SGA, free memory, huge pages, SHMMAX, or SHMALL. It is due to the
ulimit setting for Oracle user.
I checked the ulimit setting for the oracle user. It was fine.
> ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 3093692 max locked memory (kbytes, -l) unlimited ============> unlimited max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 131072 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
Upon further digging found that the issue was with VNC. I used VNC to start DBCA. When I check the ulimit setting in a VNC session, here’s what I got. It was 64K, not unlimited.
> ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 3093692 max locked memory (kbytes, -l) 64 ============> not unlimited
For some reason, VNC session picks up a different limit than a regular SSH session.
VNC as systemd service
After our recent OS upgrade (OEL 6 to OEL 7), we had to install VNC as a
systemd service. Read this post to see how we did it. In the VNC service (
[Service] section, add the last line shown in the code snippet below.
[Service] Type=forking WorkingDirectory=/home/oracle User=oracle Group=oinstall LimitMEMLOCK=infinity
After making the change, restart VNC service. The new VNC session should have ‘max locked memory’ set to unlimited. Re-run DBCA to create the database and it should go fine.
Mapping – systemd limits to ulimit
Here’s the systemd vs ulimit mapping. I got this from this SO post.
The mappings of systemd limits to ulimit Directive ulimit equivalent Unit LimitCPU= ulimit -t Seconds LimitFSIZE= ulimit -f Bytes LimitDATA= ulimit -d Bytes LimitSTACK= ulimit -s Bytes LimitCORE= ulimit -c Bytes LimitRSS= ulimit -m Bytes LimitNOFILE= ulimit -n Number of File Descriptors LimitAS= ulimit -v Bytes LimitNPROC= ulimit -u Number of Processes LimitMEMLOCK= ulimit -l Bytes LimitLOCKS= ulimit -x Number of Locks LimitSIGPENDING= ulimit -i Number of Queued Signals LimitMSGQUEUE= ulimit -q Bytes LimitNICE= ulimit -e Nice Level LimitRTPRIO= ulimit -r Realtime Priority LimitRTTIME= No equivalent If a ulimit is set to 'unlimited' set it to 'infinity' in the systemd config ulimit -c unlimited is the same as LimitCORE=infinity ulimit -v unlimited is the same as LimitAS=infinity ulimit -m unlimited is the same as LimitRSS=infinity