解决undo global data等待一例

| 5 Comments | No TrackBacks

今天bing问我"v$sessionsidactive,v$processv$transaction 均能查到spid和相应的事务,但是在OSps -ef却查不到process了,此时如何干掉该session现在手工杀session,session已不存在"

 

这个问题在Bug 6955824里也有相类似描述:

Customer killed the OS process attatched to the oracle process first using  'kill -9' command. Then he tried killing the session from the database using 'alter system kill session' command but got the error ora-30. The killed session status was ACTIVE in v$session after following the above  procedure. The killed session blocked many transactions. PMON has not cleaned up the killed session for hours and customer has at last bounced the database to resolve the problem.

这个session必须要杀掉(它锁定了一部分数据,堵塞了相关操作),但bing的这个数据库是7*24小时的,又不允许重启。

 

这个sessionsid780

 

首先执行了一下select event from v$session_wait where sid=780 返回的结果是undo global dataundo global data控制串行化访问sgaundo block的一个latchbing的这个库是9.2.0.8

 

接着我让bing查了一下v$latchholder,发现没有process持有上述latch

去查了一下metalinkmetalink上推荐的方法就是重启数据库:)

 

怎么办?

 

吃饭的时候我就一直在琢磨这个问题,等快吃完的时候就有了处理的思路,赶紧回到座位上,如下是我跟bing之间的MSN的聊天记录:

2009-7-17  12:44:31    bing  我还有这样的想法,你看看是否可行:

2009-7-17  12:44:34  bing    说说听听

2009-7-17  12:45:22    bing  v$latchholder既然没有process hold undo global data

2009-7-17  12:45:54    bing  就说明并不是某个process阻塞了780

2009-7-17  12:46:17    bing  在这种情况下:

2009-7-17  12:46:49    bing  因为undo global data是控制串行化访问sgaundo block一个latch

2009-7-17  12:47:05    bing  sga有关

2009-7-17  12:47:35    bing  那就说明是sga可能有问题了

2009-7-17  12:48:04    bing  那么我们强制刷一下sga 

2009-7-17  12:48:19    bing  即执行alter session set events 'immediate trace name flush_cache level 1'

2009-7-17  12:49:02  bing    这是刷新buffer cache

2009-7-17  12:49:04    bing  oracle先把所有buffer cache里的东西刷到data file上去

2009-7-17  12:49:31    bing  是呀

2009-7-17  12:50:01    bing  相当于清理一下buffer cache

2009-7-17  12:50:25    bing  undo global data这个latch是在buffer cache

2009-7-17  12:52:04    bing  这样刷一下后780必然要重新去获得undo global data这个latch,说不定这时候就可以了

2009-7-17  12:52:21    bing  因为并没有process hold这个latch

2009-7-17  12:52:37  bing    刷新完之后,780会自动消失了?

2009-7-17  12:52:52    bing  有可能

2009-7-17  12:53:35    bing  你这个库的buffer cache有多大?现在这个库忙吗?

2009-7-17  12:54:56    bing  如果很忙的话刷buffer cache对应用是有影响的

2009-7-17  12:55:14  bing    现在这库不忙

2009-7-17  12:55:27    bing  那可以刷一下

2009-7-17  12:55:37  bing    Buffer Cache: 10,752M

2009-7-17  12:55:59    bing  如果能行的话就不用重启了

2009-7-17  12:56:15  bing    10g左右

2009-7-17  12:57:07    bing  我觉得重启是在实在没有办法的情况下做的事情

2009-7-17  12:57:19    bing  而且你这个系统还不允许重启

2009-7-17  12:58:29  bing    10gbuffer cache会不会导致库hang住呢

2009-7-17  12:59:24    bing  恩,有可能会

2009-7-17  12:59:51  bing    呵呵,buffer cache刷完了

2009-7-17  13:00:12    bing  哦,现在780还在吗?

2009-7-17  13:00:18  bing    正在看

2009-7-17  13:00:59  bing    780 没了,偶也~~~~~~~~~~~~~~`

2009-7-17  13:01:05    bing  :)

 

在生产库上刷10Gbuffer cache,对我来说也还是头一次。

No TrackBacks

TrackBack URL: http://dbsnake.com/cgi-bin/mt/mt-tb.cgi/54

5 Comments

哎呀妈呀,俺成为男主角了.

cuihua 换写作风格了,对症下药,很精彩~
在清不掉的时候,一般我都先尝试下wakeup pmon.

这样的问题,我在HPUX 11.31 IA64下的9208见过多次。OS进程被干掉后,PMON进程SPIN,会占用很高的CPU,所以远邦说的那唤醒PMON在这里是不管用的。

BTW,我们遇到这种情况也是flush buffer cache,因为一直没有合适的停机时间打补丁。那个buffer cache几十G呢。

类似的问题,我也遇到过,都是flush一下buffer cache:
http://www.dbaroad.com/archives/2008/11/ora-00030.html

呵呵,一个问题引得众高手都出来了啊。
这两天我在家看孩子,真的觉得很累!
我闺女太皮了,不停的上窜下跳。等她一睡着,我就觉得整个世界都安静下来了:)
我现在就在她旁边,她刚刚睡着。

Leave a comment

Recent Comments

  • cui hua: 呵呵,一个问题引得众高手都出来了啊。 这两天我在家看孩子,真的觉得很累! 我闺女太皮了,不停的上窜下跳。等她一睡着,我就觉得整个世界都安静下来了:) 我现在就在她旁边,她刚刚睡着。 read more
  • OoNiceDream: 类似的问题,我也遇到过,都是flush一下buffer cache: http://www.dbaroad.com/archives/2008/11/ora-00030.html read more
  • 老熊: 这样的问题,我在HPUX 11.31 IA64下的9208见过多次。OS进程被干掉后,PMON进程SPIN,会占用很高的CPU,所以远邦说的那唤醒PMON在这里是不管用的。 BTW,我们遇到这种情况也是flush buffer cache,因为一直没有合适的停机时间打补丁。那个buffer cache几十G呢。 read more
  • Freedba: cuihua 换写作风格了,对症下药,很精彩~ 在清不掉的时候,一般我都先尝试下wakeup pmon. read more
  • jlttt: 哎呀妈呀,俺成为男主角了. read more

About this Entry

This page contains a single entry by cui hua published on July 17, 2009 2:23 PM.

关于distributed transaction was the previous entry in this blog.

解决dbconsole不能启动一例 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.