Check and change resource limit in Unix/Linux for Oracle

Check and change resource limit in Unix/Linux for Oracle

Syntax for Ulimit command:
ulimit [-H] [-S] [-a] [-c] [-d] [-f] [-m] [-n] [-s] [-t] [Limit]

-c Maximum size of core files.
-d Maximum size of data segment or heap.
-f Maximum size for files written by child processes.
-m Maximum size of physical memory.
-n Maximum number of file descriptors.
-s Maximum size for the stack area.
-t Maximum number of seconds to be used by each process.
-v Maximum size of virtual memory.
-w Maximum size of swap area.
-H The limits specified for the resources are hard limits.
-S The limits specified for the resources are soft limits. (the default
if neither ‘-H’ or ‘-S’ is specified.

Check the resource limit with following command

$ ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000

Check resource limit all for hard and soft

--H for hard limit
# ulimit -Ha
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) unlimited
stack(kbytes) unlimited
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited

-- S for soft
# ulimit -Sa
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000

Check the Soft limit of stack size

$ ulimit -s
32768

Check the hard limit of Stack Size

ulimit -H -s
4194304

Increase the hard limit of Stack

ulimit -Hs 4194305

Increase soft limit to unlimited of stack

ulimit -s unlimited

Increase the size of core dumps to unlimited

ulimit –c unlimited

Start the enterprise service for new limit in effect

casstart

You can use this file to edit hard and soft value limits

cat /etc/security/limits.conf

For Oracle Setting, following is the recommended range to install Oracle

-- Check the soft and hard limit for file descriptors
$ ulimit -Sn
1024
$ ulimit -Hn
65536

--Check the soft and hard limit for number of processes
$ ulimit -Su
2047
$ ulimit -Hu
16384

--Check the soft and hard limit for Stack setting
$ ulimit -Ss
10240
$ ulimit -Hs
32768