Blocking sessions [message #622188] |
Fri, 22 August 2014 07:26 |
|
mc1825263
Messages: 7 Registered: August 2014 Location: india
|
Junior Member |
|
|
Hi,
I see numerous blocking sessions in my database say around 100 blocking sessions.It looks user is deleting some data from application end and he wants to kill all those blocking sessions which is tedious task to do.What to do here and how to kill all those blocking sessions in one time ?
Regds,
mc
|
|
|
|
Re: Blocking sessions [message #622193 is a reply to message #622190] |
Fri, 22 August 2014 07:49 |
cookiemonster
Messages: 13961 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I'd also want to know how you ended up with one session being blocked by 100 others, that sounds like the delete is something that should be done with the application shut down.
|
|
|
|
|
|
|
|
Re: Blocking sessions [message #622200 is a reply to message #622199] |
Fri, 22 August 2014 08:38 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
>How to prove that issue is on application side
These are DML locks - the application is issuing the DML.
I agree with CM - looks like someone is running something which should be run in an outage.
|
|
|
Re: Blocking sessions [message #622201 is a reply to message #622199] |
Fri, 22 August 2014 08:40 |
cookiemonster
Messages: 13961 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You don't have 100 sessions blocking 1 session.
You have 1 session blocking 100 sessions.
blocking_session is the sid of the session blocking the session that row in the view is for.
|
|
|
|
Re: Blocking sessions [message #622207 is a reply to message #622198] |
Fri, 22 August 2014 09:10 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
BlackSwan wrote on Fri, 22 August 2014 18:58I suspect that application has a serious design flaw.
+1
Mostly it is seen that, having blocking sessions, locks, deadlocks etc in an application... Oracle is just the victim, the application is the culprit.
|
|
|
|
|
Re: Blocking sessions [message #622380 is a reply to message #622207] |
Mon, 25 August 2014 21:47 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Lalit Kumar B wrote on Fri, 22 August 2014 14:10BlackSwan wrote on Fri, 22 August 2014 18:58I suspect that application has a serious design flaw.
+1
Mostly it is seen that, having blocking sessions, locks, deadlocks etc in an application... Oracle is just the victim, the application is the culprit.
No, I do not think all of them are even victim or culprit. The very reasons apear around this problem, example:
- 1 user do DML into 1 milion rows table by another tool for business, it done by commit, at this time, 20 milion rows are to be inserted into this table by 3 or 4 progressions java, yes, right, but how about online_redo_log groups? In the end of commit by user manual DML, the redo would be switch by configuration small log, now, 20 millions rows would be inserted continous. And what? I see the even "log file switch " and its wait class is "Configuration", the bloking sid occur. Is Oracle victim or culprit?
[Updated on: Mon, 25 August 2014 21:48] Report message to a moderator
|
|
|
Re: Blocking sessions [message #622407 is a reply to message #622380] |
Tue, 26 August 2014 03:01 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
A log file switch falls under a configuration wait class. Deletes locking rows falls under application wait class.
The reasons for this is the log file switches are indeed internal oracle enforced waits, but unless you're having severe hardware/system/design problems, these are extremely fast and won't be a bottleneck on a reasonable system.
Application wait classes, the DB can't really do much about (hence the class) as if someone is holding an open, uncommitted transaction, there is no automatic fix available. The database cannot arbitrarily decide to kill it.
You need to understand the blocking session and what it is doing. From the OPs description it read to be application waits as opposed to config ones.
|
|
|
Re: Blocking sessions [message #622423 is a reply to message #622201] |
Tue, 26 August 2014 05:11 |
|
martens_b2014
Messages: 13 Registered: June 2014
|
Junior Member |
|
|
cookiemonster wrote on Fri, 22 August 2014 15:40You don't have 100 sessions blocking 1 session.
You have 1 session blocking 100 sessions.
blocking_session is the sid of the session blocking the session that row in the view is for.
Hi,
I think you are right. There can only be one session blocking the rest. When this session is gone then most likely all the other sessions will be able to perform there mutation followed by a commit and so slowly all blocking session will vanish. If not then you have to kill them one by one until all other not blocking sessions are freed. It is no use of killing all sessions in the list of v$session.
I have uploaded a small query that hopefull helps to find the main blocking session.
|
|
|