减少oracle进程数,减少OS信号量
上次同事反应测试环境报:“无法启动进程” 的错误,大致是这个意思,具体错误信息记不清了。说可能进程起动太多了。到系统查看ipcs -a
关于操作系统命令:http://blog.csdn.net/dbcommando/article/details/7887957:
[root@dbatwa1]:/#ipcs -a IPC status from /dev/kmem as of Wed Aug 8 15:53:45 2012 Message Queue facility not in system. T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME Shared Memory: m 0 0x550c0c47 --rw-r--r-- root root root root 1 120064 492 492 13:14:05 no-entry 13:14:05 m 1 0x411c01a9 --rw-rw-rw- root root root root 0 348 1225 1225 13:14:31 13:14:31 13:14:27 m 2 0x4e0c0002 --rw-rw-rw- root root root root 3 61760 1225 6968 15:35:41 15:44:01 13:14:27 m 3 0x41200aa4 --rw-rw-rw- root root root root 2 8192 1225 1227 13:16:27 13:14:27 13:14:27 m 4 0x00a5c581 --rw------- sfmdb users sfmdb users 10 10469376 8590 8593 13:16:36 13:16:36 13:16:36 m 5 0x06347849 --rw-rw-rw- root root root root 2 65544 9876 10054 13:17:38 13:17:34 13:17:30 m 32774 0x5e20370a --rw------- root root root root 1 512 9615 9615 13:17:34 no-entry 13:17:34 m 7 0x0c6629c9 --rw-r----- root root root root 3 43366176 10119 18338 14:31:39 14:31:52 13:17:34 m 8 0x01200d3e --rw-rw-r-- root root root root 1 4192 10068 10068 13:17:35 13:17:36 13:17:35 m 9 0x4914ac1a --rw-r--r-- root root root root 0 22912 10317 10313 15:53:40 15:53:40 13:17:36 m 10 0xa90c0037 ----------- root root root root 1 1 10675 10676 13:17:50 no-entry 13:17:49 m 4390923 0xe775e110 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 17301 7364 15:49:27 15:49:27 14:17:25 m 12 0x01200cf7 --rw-rw-r-- root root root root 1 4192 10777 10777 13:17:57 13:17:57 13:17:57 m 13 0x01200b1e --rw-rw-r-- root root root root 1 4192 10837 10837 13:17:58 no-entry 13:17:58 m 14 0x01200d0e --rw-rw-r-- root root root root 1 4192 10840 10840 13:18:00 13:18:06 13:18:00 m 32783 0x01200d2c --rw-rw-r-- root root root root 1 4192 11132 11132 13:18:07 no-entry 13:18:07 m 65552 0x01200d36 --rw-rw-r-- root root root root 1 4192 11142 11142 13:18:08 no-entry 13:18:08 m 655377 0xd8f9e934 --rw-rw---- oracle oinstall oracle oinstall 58 3120574464 15419 7328 15:48:18 15:48:18 13:37:22 m 655378 0x9f0a09c4 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 15787 7554 15:53:07 15:53:07 13:45:41 m 655379 0xad8601a0 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 17598 7285 15:46:33 15:46:33 14:19:49 m 491540 0xbc01f97c --rw-rw---- oracle oinstall oracle oinstall 58 3238014976 17887 7456 15:50:19 15:50:19 14:23:16 m 294933 0xf79c1f58 --rw-rw---- oracle oinstall oracle oinstall 106 4311756800 20426 7448 15:50:16 15:50:16 15:48:34 T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME Semaphores: s 0 0x72200c33 --ra-ra-ra- root root root root 2 14:31:38 13:14:10 s 1 0x4f1c062e --ra------- root root root root 1 13:14:26 13:14:26 s 2 0x411c01a9 --ra-ra-ra- root root root root 1 13:14:31 13:14:27 s 3 0x4e0c0002 --ra-ra-ra- root root root root 2 13:14:29 13:14:27 s 4 0x41200aa4 --ra-ra-ra- root root root root 2 13:16:27 13:14:27 s 5 0x01090522 --ra-r--r-- root root root root 1 no-entry 13:16:26 s 6 0x00a5c581 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 7 0x00a5c582 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 8 0x00a5c583 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 9 0x00a5c584 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 10 0x00a5c585 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 11 0x00a5c586 --ra------- sfmdb users sfmdb users 17 13:20:41 13:16:36 s 12 0x00a5c587 --ra------- sfmdb users sfmdb users 17 13:20:41 13:16:36 s 458765 0x6bde715c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 14:17:26 s 14 0x7120253c --ra-ra-ra- root root root root 1 13:19:04 13:17:09 s 131087 0x876644d8 --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 13:37:22 s 32784 0xc9e03647 --ra-r--r-- root root root root 3 13:17:34 13:17:21 s 17 0x31200c78 --ra-ra-ra- root root root root 5 15:53:00 13:17:30 s 65554 0x4914ac1a --ra-r--r-- root root root root 1 15:53:40 13:17:36 s 19 0x72200ce5 --ra-ra-ra- root root root root 2 14:31:39 13:17:33 s 20 0x72200ce6 --ra-ra-ra- root root root root 2 14:31:39 13:17:33 s 21 0x410c0294 --ra-ra-ra- root root root root 1 13:17:37 13:17:37 s 32790 0x00000000 --ra-ra-ra- root root root root 32 no-entry 13:17:49 s 262167 0xf58592c8 --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 13:45:41 s 3375128 0x9487bf6c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 15:48:35 s 32794 0x01200a8d --ra-ra-r-- root root root root 1 13:17:59 13:17:58 s 65563 0x01200d2a --ra-ra-r-- root root root root 1 13:19:33 13:18:07 s 65564 0x01200d34 --ra-ra-r-- root root root root 1 13:18:08 13:18:08 s 229407 0xd9fdbf4c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 14:19:50 s 98336 0xbe75ebd0 --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 14:23:18 [root@dbatwa1]:/#
发现跟Oracle相关的进程数也正常,但信号量到了3004,于是检查实例参数processes
[root@dbatwa1]:/#su - oracle oracle@dbatwa1:/home/oracle$ sqlplus /nolog SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 8 16:00:17 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved. SQL> conn / as sysdba Connected. SQL> show parameter process NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ aq_tm_processes integer 0 cell_offload_processing boolean TRUE db_writer_processes integer 2 gcs_server_processes integer 2 global_txn_processes integer 1 job_queue_processes integer 1000 log_archive_max_processes integer 4 processes integer 3000 SQL>
发现这台机器上的6个实例进程参数都是3000,选择将其中两个实例的进程数改为1000
SQL> alter system set processes=1000 scope =spfile; System altered. SQL> alter system checkpoint; System altered. SQL> startup force ORACLE instance started. Total System Global Area 3206836224 bytes Fixed Size 2185504 bytes Variable Size 2550138592 bytes Database Buffers 637534208 bytes Redo Buffers 16977920 bytes Database mounted. Database opened. SQL> exit
再查看信息量:
oracle@dbatwa1:/home/oracle$ ipcs -a IPC status from /dev/kmem as of Wed Aug 8 16:16:39 2012 Message Queue facility not in system. T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME Shared Memory: m 0 0x550c0c47 --rw-r--r-- root root root root 1 120064 492 492 13:14:05 no-entry 13:14:05 m 1 0x411c01a9 --rw-rw-rw- root root root root 0 348 1225 1225 13:14:31 13:14:31 13:14:27 m 2 0x4e0c0002 --rw-rw-rw- root root root root 3 61760 1225 6968 15:35:41 15:44:01 13:14:27 m 3 0x41200aa4 --rw-rw-rw- root root root root 2 8192 1225 1227 13:16:27 13:14:27 13:14:27 m 4 0x00a5c581 --rw------- sfmdb users sfmdb users 10 10469376 8590 8593 13:16:36 13:16:36 13:16:36 m 5 0x06347849 --rw-rw-rw- root root root root 2 65544 9876 10054 13:17:38 13:17:34 13:17:30 m 32774 0x5e20370a --rw------- root root root root 1 512 9615 9615 13:17:34 no-entry 13:17:34 m 7 0x0c6629c9 --rw-r----- root root root root 3 43366176 10119 18338 14:31:39 14:31:52 13:17:34 m 8 0x01200d3e --rw-rw-r-- root root root root 1 4192 10068 10068 13:17:35 13:17:36 13:17:35 m 9 0x4914ac1a --rw-r--r-- root root root root 0 22912 10317 10313 16:16:30 16:16:30 13:17:36 m 10 0xa90c0037 ----------- root root root root 1 1 10675 10676 13:17:50 no-entry 13:17:49 m 4390923 0xe775e110 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 17301 7364 16:14:38 16:15:42 14:17:25 m 12 0x01200cf7 --rw-rw-r-- root root root root 1 4192 10777 10777 13:17:57 13:17:57 13:17:57 m 13 0x01200b1e --rw-rw-r-- root root root root 1 4192 10837 10837 13:17:58 no-entry 13:17:58 m 14 0x01200d0e --rw-rw-r-- root root root root 1 4192 10840 10840 13:18:00 13:18:06 13:18:00 m 32783 0x01200d2c --rw-rw-r-- root root root root 1 4192 11132 11132 13:18:07 no-entry 13:18:07 m 65552 0x01200d36 --rw-rw-r-- root root root root 1 4192 11142 11142 13:18:08 no-entry 13:18:08 m 688145 0xd8f9e934 --rw-rw---- oracle oinstall oracle oinstall 74 3120574464 8346 8413 16:16:14 16:16:33 16:15:45 m 655378 0x9f0a09c4 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 15787 7682 16:13:11 16:15:14 13:45:41 m 655379 0xad8601a0 --rw-rw---- oracle oinstall oracle oinstall 58 3103797248 17598 7998 16:06:38 16:15:43 14:19:49 m 524308 0xbc01f97c --rw-rw---- oracle oinstall oracle oinstall 58 3238014976 8122 8457 16:16:07 16:16:07 16:10:41 m 294933 0xf79c1f58 --rw-rw---- oracle oinstall oracle oinstall 106 4311756800 20426 7980 16:05:16 16:05:16 15:48:34 T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME Semaphores: s 0 0x72200c33 --ra-ra-ra- root root root root 2 14:31:38 13:14:10 s 1 0x4f1c062e --ra------- root root root root 1 13:14:26 13:14:26 s 2 0x411c01a9 --ra-ra-ra- root root root root 1 13:14:31 13:14:27 s 3 0x4e0c0002 --ra-ra-ra- root root root root 2 13:14:29 13:14:27 s 4 0x41200aa4 --ra-ra-ra- root root root root 2 13:16:27 13:14:27 s 5 0x01090522 --ra-r--r-- root root root root 1 no-entry 13:16:26 s 6 0x00a5c581 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 7 0x00a5c582 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 8 0x00a5c583 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 9 0x00a5c584 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 10 0x00a5c585 --ra------- sfmdb users sfmdb users 17 13:16:36 13:16:36 s 11 0x00a5c586 --ra------- sfmdb users sfmdb users 17 13:20:41 13:16:36 s 12 0x00a5c587 --ra------- sfmdb users sfmdb users 17 13:20:41 13:16:36 s 458765 0x6bde715c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 14:17:26 s 14 0x7120253c --ra-ra-ra- root root root root 1 13:19:04 13:17:09 s 262159 0x876644d8 --ra-ra---- oracle oinstall oracle oinstall 1004 no-entry 16:15:46 s 32784 0xc9e03647 --ra-r--r-- root root root root 3 13:17:34 13:17:21 s 17 0x31200c78 --ra-ra-ra- root root root root 5 16:16:00 13:17:30 s 65554 0x4914ac1a --ra-r--r-- root root root root 1 16:16:30 13:17:36 s 19 0x72200ce5 --ra-ra-ra- root root root root 2 14:31:39 13:17:33 s 20 0x72200ce6 --ra-ra-ra- root root root root 2 14:31:39 13:17:33 s 21 0x410c0294 --ra-ra-ra- root root root root 1 13:17:37 13:17:37 s 32790 0x00000000 --ra-ra-ra- root root root root 32 no-entry 13:17:49 s 262167 0xf58592c8 --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 13:45:41 s 3375128 0x9487bf6c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 15:48:35 s 10420249 0xbe75ebd0 --ra-ra---- oracle oinstall oracle oinstall 1004 no-entry 16:10:43 s 32794 0x01200a8d --ra-ra-r-- root root root root 1 13:17:59 13:17:58 s 65563 0x01200d2a --ra-ra-r-- root root root root 1 13:19:33 13:18:07 s 65564 0x01200d34 --ra-ra-r-- root root root root 1 13:18:08 13:18:08 s 229407 0xd9fdbf4c --ra-ra---- oracle oinstall oracle oinstall 3004 no-entry 14:19:50 oracle@dbatwa1:/home/oracle$
修改后的两个实例变为了1004,之后再没有出现这样的情况。