Home » RDBMS Server » Server Administration » TX Lock Wait time disappears when gather stat is run (Oracle 11g R1 windows 2003 SP 2)
TX Lock Wait time disappears when gather stat is run [message #505983] Thu, 05 May 2011 17:45 Go to next message
benodom
Messages: 4
Registered: May 2011
Junior Member
Hi Guys,

We are experiencing tx row lock wait time over hours. There is no blocking session and it seems that the application hangs. What is funny is that when we gather_stats on the tables, those tx row lock wait are being released. Anyone as an idea on what is happening here?

Thanks

Dom
Re: TX Lock Wait time disappears when gather stat is run [message #505984 is a reply to message #505983] Thu, 05 May 2011 17:57 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: TX Lock Wait time disappears when gather stat is run [message #505990 is a reply to message #505984] Thu, 05 May 2011 20:08 Go to previous messageGo to next message
benodom
Messages: 4
Registered: May 2011
Junior Member
I am new to this. Can you please tell me what part of the guidelines I missed?

Thanks
Re: TX Lock Wait time disappears when gather stat is run [message #505991 is a reply to message #505990] Thu, 05 May 2011 20:17 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Can you please tell me what part of the guidelines I missed?
in other words, you don't want to take the time to read them but be spoonfed.

>What is funny is that when we gather_stats on the tables, those tx row lock wait are being released.
Do you realize that default DB installation collects statistics once every 24 hours.
I SERIOUSLY, seriously doubt that collecting statistics has any impact on tx row lock waits.

Post SQL & results that demonstrate these TX ROW LOCK WAIT along with the specific objects being locked.

It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.
Re: TX Lock Wait time disappears when gather stat is run [message #506035 is a reply to message #505983] Fri, 06 May 2011 04:19 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Quote:
We are experiencing tx row lock wait time over hours. There is no blocking session
Can you provide some evidence? Such as

select sid,blocking_session,event,seconds_in_wait from v$session
where wait_time=0 and wait_class <> 'Idle';
Re: TX Lock Wait time disappears when gather stat is run [message #506888 is a reply to message #506035] Wed, 11 May 2011 10:49 Go to previous messageGo to next message
benodom
Messages: 4
Registered: May 2011
Junior Member
Sorry guys,

I am working a lot of hours and shift work and did not have time to get back to you since this problem has a lower priority. On top of this, I cannot display any data even though they are not confidential. This may help you understand my position better.

So, to give you more information on my system, the auto gather stats is turned off (required by the consultant company that developed the system). We have partitioned tables called DAYYYYMMDD which we write to on a daily basis. So, we start from o records to hundred of thousands and more... every partition gets written to with a different ratio meaning that some partitions will grow faster than others. Also, every day we change partition to the next day. We have 15 partitioned tables (same logic). We run stats once a day at night. This is a business requirement, no possible change there.

So, what I have discovered is that we have stale stats on those day partitions. By running stats on those, it seems to release the lock wait but not all the time. We suspect an error in the code (but again, do not have access to the code since it is contractor that has built our system). They are looking into it thought.

The problem with this is since we start every day with 0 records in those partitions, the stats become stale very often. It is clear to me that this is due to the factor of 10% (default) modifications being made on those partitioned tables... Let`s say we inserts 10 records, than 10% of this is 1 new insertion would bring the stats in stale....

I know I cannot provide you with a lot of information and I am very sorry. This is really difficult when trying to get help, but management knows about it. So, if you have any idea, let me know. At this point, I think I am to ask the consultant to put back in the auto gather stats. I believe they are scared of the performance since their entire system was not tested with this option turned on.

John, what I can tell you is that we would have a similar output as this:

sessionID process machine seconds_in_wait
X XX XXXXX 2120

you can tell the process is having a seconds_in_wait really high. Usually it should be runing between 0 and 10 sec.

Thank you guys for taking the time to write to me. Sorry again for being so vague. I do my best with what I can. Sad

[Updated on: Wed, 11 May 2011 10:50]

Report message to a moderator

Re: TX Lock Wait time disappears when gather stat is run [message #506890 is a reply to message #506035] Wed, 11 May 2011 10:53 Go to previous messageGo to next message
benodom
Messages: 4
Registered: May 2011
Junior Member
An other information to John, we do not have any blocking session. it seems, thru Grid, that the row lock get released after a long time (could be after more than 8 hours). The reason I believe we do not see blocking session, is that this step is one of the last of our system and no other processes would require access to those new rows inserted (to my knowledge).

Hope this answer your question.

Thanks
Re: TX Lock Wait time disappears when gather stat is run [message #506897 is a reply to message #506890] Wed, 11 May 2011 12:23 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>We are experiencing tx row lock wait time over hours.
>There is no blocking session and it seems that the application hangs.
I'll stipulate that both are valid observations.
I'm questioning the conclusion that the former caused the latter.
What proof (SQL & results) exists that provides evidence actual cause & effect exists?
If something else results in the application hanging, then looking at TX Row Locks is futile.
Re: TX Lock Wait time disappears when gather stat is run [message #506898 is a reply to message #506897] Wed, 11 May 2011 12:41 Go to previous message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Black Swan is dead right. You have to begin by making some observations, not by drawing conclusions. The most basic observation is that query I gave you. Why can't you post the results? THere is nothing remotely confidential, we all have the same session numbers and wait events.

And by the way, if your application developer is worried that updated statistics might cause SQLs to regress, tell him to attend an 11g DB Admin course. There are many ways of preventing this. Enabling SQL plan baselines, for instance. Or simply deferring the statistics publication until you've tested the effect.
Previous Topic: Connect to idle instance
Next Topic: Oracle 11g installation problem
Goto Forum:
  


Current Time: Wed May 08 09:46:52 CDT 2024