ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÓÃUNIXµÄkillÃüÁîÀ´ÖÕÖ¹OracleµÄ¹ý³Ì

·¢²¼Ê±¼ä:2008-07-06 00:03:03À´Ô´:ºìÁª×÷Õß:Courage
ÕýÈçÄãËùÖª£¬ÓÐʱºòÎÒÃÇÓбØÒªÖÕÖ¹ËùÓеÄOracle¹ý³Ì£¨process£©»òÕßÖ¸¶¨µÄÒ»×éOracle¹ý³Ì¡£µ±Êý¾Ý¿â¡°Ëø¶¨¡±¶øÄãÎÞ·¨½øÈëServer ManagerÀ´¡°ÎÂÈᡱµÄÖÕÖ¹Êý¾Ý¿âʱ£¬¾Í¿ÉÒÔÓÃUNIXÖеÄkillÃüÁîÀ´ÖÕÖ¹ËùÓеÄOracle¹ý³Ì----ÕâÊÇkillÃüÁîµÄ³£¼ûÓÃ;֮һ¡£

µ±ÄãÐèÒªÖÕÖ¹Ò»¸öUNIX·þÎñÆ÷ÉϵÄÒ»¸öOracleʵÀý£¨instance£©Ê±£¬Ö´ÐÐÏÂÃæµÄ²½Ö裺

ÖÕÖ¹ÓëORACLE_SIDÓйصÄËùÓÐOracle¹ý³Ì¡£

ÓÃipcs -pmbÃüÁîÀ´Ê¶±ðËùÓÐÕ¼ÓõÄRAMÄÚ´æƬ¶Ï¡£

ÓÃipcrm -m ÃüÁîÀ´´ÓUNIXÖÐÊÍ·ÅÕ¼ÓõÄRAMÄÚ´æ¡£

Ö»¶ÔNon-AIX£ºÓÃipcs -saÃüÁîÀ´ÏÔʾռÓñê¼Ç£¬ÓÃipcrm -sÃüÁîÀ´ÊͷŸÃʵÀýµÄÕ¼Óñê¼Ç¡£

´´½¨µ¥Ò»ÃüÁîÀ´ÖÕÖ¹Óë¹ÒÆð£¨hung£©µÄÊý¾Ý¿âʵÀýÓйصÄOracle¹ý³ÌÊǺܼòµ¥µÄ¡£ÔÚÏÂÃæµÄÀý×ÓÖ®ÖУ¬ÎÒÃÇÓÃpsÖ¸ÁîÀ´Ê¶±ðOracle¹ý³Ì£¬È»ºóÓÃawk³ÌÐòÀ´»ñÈ¡Oracle¹ý³ÌµÄ¹ý³ÌID£¨process ID£¬PID£©¡£È»ºó£¬ÎÒÃǰѹý³ÌIDÊäÈëµ½UNIXµÄkillÃüÁîÖ®ÖС£

root> ps -ef|grep ora_| \
grep -v grep|awk '{print $2}'|xargs -i kill -9 {}

ÔÚÖÕÖ¹ËùÓÐOracle¹ý³ÌÖ®ºó£¬ÎÒÃÇ¿ÉÒÔÓÃipcs -pmbÖ¸ÁîÀ´¼ì²éÕ¼ÓõÄÄÚ´æ²¢Çå³ýÊý¾Ý¿âËùÕ¼ÓõÄÄÚ´æ¡£ÎÒÃÇÊ×ÏÈÏÔʾ³öÊý¾Ý¿â·þÎñÆ÷ÉÏËùÓÐÕ¼ÓÃÄڴ棺

root> ipcs -pmb

IPC status from /dev/kmem as of Mon Sep 10 16:45:16 2001
T ID KEY MODE OWNER GROUP SEGSZ CPID LPID
Shared Memory:
m 24064 0x4cb0be18 --rw-r----- oracle dba 28975104 1836 23847
m 1 0x4e040002 --rw-rw-rw- root root 31008 572 572
m 2 0x411ca945 --rw-rw-rw- root root 8192 572 584
m 4611 0x0c6629c9 --rw-r----- root root 7216716 1346 23981
m 4 0x06347849 --rw-rw-rw- root root 77384 1346 1361

ÔÚÕâÀÎÒÃÇ¿´µ½OracleÖ»ÓµÓÐÒ»¸öID=24064µÄRAMÄÚ´æ¡£ÏÂÃæµÄÃüÁ»áÊÍ·ÅÕâ¸öÄÚ´æƬ¶Ï£º

root> ipcrm -m 24064
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ