linux limit限制

wanglinghua0907發表於2023-12-28

檢視

ulimit -a

/etc/profile

~/.bash_profile

/etc/security/limit.conf

/etc/security/limit.d/20-nproc.conf


優先順序(網上說法):

1./etc/security/limit.d/20-nproc.conf

2./etc/security/limit.conf

3.~/.bash_profile

4./etc/profile


優先順序(我個人理解)(bash_profile裡的類似每次切換使用者臨時生效,所以高於持久化生效):

1.~/.bash_profile

2./etc/profile

3./etc/security/limit.d/20-nproc.conf

4./etc/security/limit.conf


1.常規

編輯/etc/security/limits.conf 新增如下內容:

vi /etc/security/limits.conf 


grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536



2.99 20檔案(優先順序高於上面的limits.conf)

Linux6:

/etc/security/limits.d/90-nproc.conf

Linux7:

/etc/security/limits.d/20-nproc.conf


3.oracle-database-preinstall-19c.conf檔案

一般19c有,位置也在 /etc/security/limits.d/下,用sqlplus startup起會用這個的限制


# oracle-database-preinstall-19c setting for nofile soft limit is 1024

oracle   soft   nofile    1024


# oracle-database-preinstall-19c setting for nofile hard limit is 65536

oracle   hard   nofile    65536


# oracle-database-preinstall-19c setting for nproc soft limit is 16384

# refer orabug15971421 for more info.

oracle   soft   nproc    16384


# oracle-database-preinstall-19c setting for nproc hard limit is 16384

oracle   hard   nproc    16384


# oracle-database-preinstall-19c setting for stack soft limit is 10240KB

oracle   soft   stack    10240


# oracle-database-preinstall-19c setting for stack hard limit is 32768KB

oracle   hard   stack    32768


# oracle-database-preinstall-19c setting for memlock hard limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM

oracle   hard   memlock    474620572


# oracle-database-preinstall-19c setting for memlock soft limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90% of RAM

oracle   soft   memlock    474620572


# oracle-database-preinstall-19c setting for data soft limit is 'unlimited'

oracle   soft   data    unlimited


# oracle-database-preinstall-19c setting for data hard limit is 'unlimited'

oracle   hard   data    unlimited


來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/69980685/viewspace-3001913/,如需轉載,請註明出處,否則將追究法律責任。

相關文章