今天发生了好几次,杀进程不释放锁的情况。大部分是由于使用 alter system kill session 命令杀不干净导致的,这种情况对于生产库危害很大,锁的长期持有会严重影响业务正常运行。为此问题也曾不止一次开SR,但都没有得到满意的结果。最近在DSI上面看到了关于这方面的一些内部解释,留此备忘:
[@more@]Note: When a session is marked for kill (alter session), PMON rolls back that transaction anumber of undo entries at a time (determined by _CLEANUP_ROLLBACK_ENTRIES). After
that, PMON continues with its regular cycle to poll other processes and goes to sleep on pmon
timer (20 seconds). In addition, if it encounters any locks or latches during the rollback, it gives
up and tries again later. (As of Oracle8i PMON defers transaction recovery of "killed" sessions
to SMON when the number of transactions to recover is greater than a defined maximum. This
allows the use of fast start parallel rollback if necessary, and frees up locks held by the killed
process immediately.)
When you kill a process from the operating system, it becomes a dedicated job for PMON and it
rolls it back immediately until it is finished. The NT platform is different, because there are no
operating system processes that you can kill. On all Unix platforms, it is usually better to just
kill the Oracle process and let PMON clean it up. On NT, everything is thread-based and there is
only one Oracle process. However, there is a utility on NT to let you kill the thread
(killora.exe).
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/19015/viewspace-995627/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/19015/viewspace-995627/