快速殺掉Oracle的Session

lilong發表於2006-05-08
很多的時候我們需要迅速的殺掉Oralcle的一些session...... [@more@]

單位伺服器上的Oracle突然出現無法連線的現象,提示程式已經達到了最大的限制,奇怪!線上不過幾個人為什麼達到了500個程式?肯定是由於程式錯誤造成大量死程式留在系統中。但是殺掉這些死程式卻很麻煩。在網上找了半天終於發現Orakill這個命令!

C:>orakill -help
Usage: orakill sid thread
where sid = the Oracle instance to target
thread = the thread id of the thread to kill
The thread id should be retrieved from the spid column of a query such as:
select spid, osuser, s.program from
v$process p, v$session s where p.addr=s.paddr

這是Orakill的幫助提示,根據此提示,找出所有狀態為Inactive的程式session,然後並記下paddr,用上面的語句找出這個session所對應的spid,用orakill sid spid殺掉。
面對一大堆的死程式,只好用批處理的辦法進行處理,最終問題解決。

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

相關文章