[root@jhoa ~]# 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) 38656
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
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) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
-u 限制每个用户的进程
[root@jhoa ~]# ulimit -u 150
这个只是暂时生效,ulimit 是SESSION级别参数
1.会话级别生效
2.一个用户能使用的进程数
适用于命令登陆shell会话期间
[root@jhoa ~]# ulimit -u
150
[root@jhoa ~]# ps -ef | grep root | wc -l
110
[root@jhoa ~]# ps -ef | wc -l
141
[oracle@jhoa ~]$ ps -ef | grep oracle | wc -l
-bash: fork: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable
[root@jhoa ~]# ps -ef | grep oracle | wc -l
30
------------------------------------------------
oracle soft nproc 100
oracle hard nproc 100
oracle soft nofile 1024
oracle hard nofile 65536
[oracle@jhoa ~]$ ulimit -u
30
[oracle@jhoa ~]$ ps -ef | grep oracle | wc -l
-bash: fork: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable
[oracle@jhoa ~]$ ps -ef | grep oracle | wc -l
34
[oracle@jhoa ~]$ ps -ef | grep oracle
root 2790 2520 0 20:11 ? 00:00:00 sshd: oracle [priv]
oracle 2792 2790 5 20:11 ? 00:00:41 sshd: oracle@pts/1
oracle 2793 2792 0 20:11 pts/1 00:00:00 -bash
oracle 2901 1 0 20:12 ? 00:00:00 ora_pmon_orcl
oracle 2903 1 0 20:12 ? 00:00:00 ora_psp0_orcl
oracle 2905 1 0 20:12 ? 00:00:00 ora_mman_orcl
oracle 2907 1 0 20:12 ? 00:00:00 ora_dbw0_orcl
oracle 2909 1 0 20:12 ? 00:00:00 ora_lgwr_orcl
oracle 2911 1 0 20:12 ? 00:00:00 ora_ckpt_orcl
oracle 2913 1 0 20:12 ? 00:00:00 ora_smon_orcl
oracle 2915 1 0 20:12 ? 00:00:00 ora_reco_orcl
oracle 2917 1 0 20:12 ? 00:00:00 ora_cjq0_orcl
oracle 2919 1 0 20:12 ? 00:00:00 ora_mmon_orcl
oracle 2921 1 0 20:12 ? 00:00:00 ora_mmnl_orcl
oracle 2923 1 0 20:12 ? 00:00:00 ora_d000_orcl
oracle 2925 1 0 20:12 ? 00:00:00 ora_s000_orcl
oracle 2938 1 0 20:12 ? 00:00:00 ora_qmnc_orcl
oracle 2947 1 0 20:13 ? 00:00:00 ora_q001_orcl
oracle 2949 1 0 20:13 ? 00:00:00 ora_q002_orcl
oracle 2951 1 0 20:13 ? 00:00:00 ora_q003_orcl
root 3012 2830 0 20:15 pts/1 00:00:00 su - oracle
oracle 3013 3012 0 20:15 pts/1 00:00:00 -bash
root 3072 2520 0 20:16 ? 00:00:00 sshd: oracle [priv]
oracle 3074 3072 0 20:16 ? 00:00:00 sshd: oracle@pts/0
oracle 3075 3074 0 20:16 pts/0 00:00:00 -bash
root 3151 2520 0 20:16 ? 00:00:00 sshd: oracle [priv]
oracle 3153 3151 23 20:16 ? 00:01:38 sshd: oracle@pts/2
oracle 3154 3153 0 20:17 pts/2 00:00:00 -bash
root 3192 3112 0 20:17 pts/0 00:00:00 su - oracle
oracle 3193 3192 0 20:17 pts/0 00:00:00 -bash
oracle 3268 3154 46 20:21 pts/2 00:01:15 sh ./2.sh
oracle 3304 3193 0 20:23 pts/0 00:00:00 ps -ef
oracle 3305 3193 0 20:23 pts/0 00:00:00 grep oracle
[oracle@jhoa ~]$ ps -ef | grep oracle | wc -l
-bash: fork: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable