今天在测试环境上出现数据库锁死的情况,不能正常通过shutdown immediate 关掉数据库,所以我就是用ps -fu oracle|grep ecds|awk '{print $2}'|xargs kill -9强制删除了所有的
oracle的进程。现在我进入sqlplus进去启动数据库的时候说数据库再运行。于是就执行shutdown immediate进行关数据库,报如下错误:
WH7620_2:/home/db/oracle/OraHome_1/dbs/> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Mon May 20 15:35:50 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected.
SQL> shutdown immediate
ORA-24324: service handle not initialized
ORA-24323: value not allowed
ORA-00020: maximum number of processes (%s) exceeded
SQL> quit
Disconnected
解决方案:查看共享内存资源
WH7620_2:/home/db/oracle/OraHome_1/dbs/> ipcs -pmb
IPC status from /dev/kmem as of Mon May 20 15:36:28 2013
T ID KEY MODE OWNER GROUP SEGSZ CPID LPID
Shared Memory:
m 0 0x411c01a9 --rw-rw-rw- root root 348 940 940
m 1 0x4e0c0002 --rw-rw-rw- root root 61760 940 4759
m 2 0x41200d18 --rw-rw-rw- root root 8192 940 942
m 163843 0x00a5c581 --rw------- sfmdb users 10469376 23673 23677
m 4 0x411c10cf --rw------- root root 4096 1982 2645
m 2392069 0x00000000 --rw-r----- oracle dba 16777216 4212 5423
m 425990 0x01200ce2 --rw-rw-r-- root root 4192 5398 5398
m 65543 0x06347849 --rw-rw-rw- root sys 65544 5460 685
m 8 0x4918b212 --rw-r--r-- root root 22912 2196 8298
m 65545 0x00000000 --rw-r----- oracle dba 1073741824 4212 5423
m 10 0xa90c0292 ----------- root root 1 2463 2464
m 1409035 0xbea746bc --rw-r----- oracle dba 553656320 4212 5423
m 12 0x01200cea --rw-rw-r-- root root 4192 2510 2510
m 13 0x01200c44 --rw-rw-r-- root root 4192 2512 2512
m 14 0x01200cfa --rw-rw-r-- root root 4192 2516 2555
m 65551 0x01200d1a --rw-rw-r-- root root 4192 2601 2601
m 163864 0x0001e240 --rw-rw-rw- tuxedo tuxedo 442976 24529 24677
m 131102 0x01108f85 --rw-rw-rw- csspkm csspkm 47532 20662 10148
m 360482 0x01108129 --rw-rw-rw- nettrack informix 50432104 4371 4379
m 229411 0x01100d01 --rw-rw-rw- nettrack informix 262272104 4371 4385
m 229412 0x01107934 --rw-rw-rw- nettrack informix 51584104 4371 4382
m 393253 0x52614806 --rw-rw---- informix informix 8388608 29904 18132
m 524326 0x01108133 --rw-rw-rw- nettrack informix 1360000 4371 4371
m 524327 0x0110812b --rw-rw-rw- nettrack informix 1520000 4371 4371
m 524328 0x01107602 --rw-rw-rw- nettrack informix 3360000 4371 4371
m 41 0x52614801 --rw-rw---- root informix 119341056 29904 18132
m 42 0x52614802 --rw-rw---- root informix 33439744 29904 18132
m 43 0x52614803 --rw-rw-rw- root informix 561152 29904 4234
m 44 0x52614804 --rw-rw---- informix informix 8388608 29904 18132
m 458797 0x011009ee --rw-rw-rw- nettrack informix 3360000 4371 4371
m 458798 0x01100b02 --rw-rw-rw- nettrack informix 3360000 4371 4371
m 458799 0x0110793f --rw-rw-rw- nettrack informix 50432104 4375 4379
m 458800 0x01108136 --rw-rw-rw- nettrack informix 1360000 4375 4375
m 458801 0x0110812f --rw-rw-rw- nettrack informix 1520000 4375 4375
m 458802 0x01108138 --rw-rw-rw- nettrack informix 3360000 4375 4375
m 458803 0x0110813a --rw-rw-rw- nettrack informix 3360000 4375 4375
m 458804 0x01108148 --rw-rw-rw- nettrack informix 3360000 4375 4375
m 458805 0x01100da0 --rw-rw-rw- nettrack informix 304128052 4391 4385
m 458806 0x01100a81 --rw-rw-rw- nettrack informix 190080052 4397 4385
m 458807 0x01100dbe --rw-rw-rw- nettrack informix 190080052 4421 4385
m 458808 0x01100db1 --rw-rw-rw- nettrack informix 190080052 4412 4418
m 458809 0x01100df0 --rw-rw-rw- nettrack informix 190080052 4447 4385
m 458810 0x01100de9 --rw-rw-rw- nettrack informix 190080052 4441 4385
m 458811 0x01100db9 --rw-rw-rw- nettrack informix 95040052 4432 4427
m 458812 0x01100e12 --rw-rw-rw- nettrack informix 190080052 4453 4456
m 458813 0x01100ecf --rw-rw-rw- nettrack informix 95040052 4486 4489
m 458814 0x01100ecd --rw-rw-rw- nettrack informix 95040052 4480 4483
m 458815 0x01100e14 --rw-rw-rw- nettrack informix 190080052 4385 4465
m 458816 0x01100eca --rw-rw-rw- nettrack informix 95040052 4385 4477
m 458817 0x01100ed1 --rw-rw-rw- nettrack informix 190080052 4385 4495
m 458818 0x01100ed6 --rw-rw-rw- nettrack informix 190080052 4385 4504
m 458819 0x01100ed8 --rw-rw-rw- nettrack informix 190080052 4385 4522
m 458820 0x01100eda --rw-rw-rw- nettrack informix 95040052 4385 4531
m 458821 0x01100ee1 --rw-rw-rw- nettrack informix 190080052 4385 4543
m 458822 0x01100ee3 --rw-rw-rw- nettrack informix 190080052 4385 4540
m 73 0x52614805 --rw-rw---- informix informix 8388608 29904 18132
m 65615 0x0c6629c9 --rw-r----- root dba 17869240 685 8298
发现有三个oracle资源在占用,所以必须进行资源释放,执行如下操作:
WH7620_2:/home/db/oracle/OraHome_1/dbs/>
WH7620_2:/home/db/oracle/OraHome_1/dbs/> ipcrm -m 2392069
WH7620_2:/home/db/oracle/OraHome_1/dbs/> ipcrm -m 65545
WH7620_2:/home/db/oracle/OraHome_1/dbs/> ipcrm -m 1409035
再次启动发现成功:
WH7620_2:/home/db/oracle/OraHome_1/dbs/> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Mon May 20 15:37:56 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> shutdown immediate
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
HPUX-ia64 Error: 2: No such file or directory
SQL> startup
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2068296 bytes
Variable Size 385876152 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14708736 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
分析与总结:出现以上原因是因为强制kil掉oracle进程后,系统中的内存依然被kill的进程所占用,所以就会报超过了最大的进程数。