shutdown命令被job进程hang住(续)

针对留言中,有朋友说再做个hanganalyze,具体分析下,趁今天星期天再把这个问题再探讨下。

当时执行shutdown命令,alert日志的信息有:

Sat Oct 22 02:21:27 2011
Active call for process 2674792 user 'oracle' program 'oracle@
■■■(J006)'
SHUTDOWN: waiting for active calls to complete.

这个信息很明白了,就是说SHUTDOWN正在等待active call完成,指的就是OS进程2674792。在Oracle后台进程中也可以找到:

■■db1:/home/oracle>ps -ef | grep ora_
  oracle  663606       1   0   Jun 22      - 3018:50 ora_lms8_
db1
  oracle 1773750       1   0   Jun 22      - 3822:32 ora_lms2_
db1
  oracle 2256938       1   0   Jun 22      - 120:13 ora_dbw2_
db1
  oracle 2674792       1   5 01:10:48      -  5:07 ora_j006_
db1
  oracle  295196       1   0   Jun 22      - 120:07 ora_dbw1_
db1
  oracle  340320       1   1   Jun 22      - 3009:44 ora_lms7_
db1
  oracle  356740       1   0   Jun 22      - 1632:38 ora_lmd0_
db1
  oracle  381358       1   1   Jun 22      - 727:09 ora_lmon_
db1
………………………

就是因为有这个job进程在跑,所以才hang住了shutdown命令。

之前也没少在生产库上做起停操作,但都“幸运的”没有碰到job相关的进程,所以这次也就是忽视了在停库前将运行的job进程kill掉。通常,我在停库之前,都会在停掉LISTENER后,就开始杀进程,起码把LOCAL=NO的客户端连接进程都杀掉,再将数据库checkpoint下,这样就基本可以保证数据库下次启动时,不会出太的问题。

关于alert中的SHUTDOWN: waiting for active calls to complete.这个信息,在metalink上也有对其的解释:

Explanation:
The database is waiting for pmon to clean up processes,but pmon is nuable to clean them.The client connections to the server are causing the shutdown immediate or normal to hang.Killing them allows pmon to clean up and release the associated Oracle processes and resources.

What resources are we talking about?
1) Any non committed transactions must be rolled back.
2) Any temporary space (sort segments / lobs / session temporary tables)must be freed.
3) The session itself and any associated memory consumed by the session.
4) Internal locks / enqueues must be cleaned up

完整的文档信息可参考:metalink ID 1039389.6

shutdown业务比较繁忙的生产库时,必须首先要kill process,否则时间之长,令人无法忍受,之前有听说因长时间未正常shutdown,最后又取消了,重新执行了abort命令,这是一种很危险的做法。

在此之后,我也注意到了,要提前把OS中的运行的JOB进程也清理下。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25834554/viewspace-709555/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25834554/viewspace-709555/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值