|
|
|
|
Re: ora-60 Dead Lock [message #160714 is a reply to message #160672] |
Tue, 28 February 2006 03:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
Are the 3 tables referred in your post, having referential constriants? if they do, then are the foreign keys indexed? I have faced one situation, where somehow deadlocks were happending and by indexing the foreign keys we got rid of that.
Also it would be good , if you can identify EXACT scenario that leads to the deadlock..EXACT sql statement being fired etc..(assuming indexing foreign keys do not solve the issue..)
|
|
|
|
Re: ora-60 Dead Lock [message #160755 is a reply to message #160714] |
Tue, 28 February 2006 04:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Atul P
Messages: 61 Registered: June 2003 Location: Mumbai-Jakarta
|
Member |
![atulonline](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi Nirav
No only the DETAIL and Sub detailed table is referred.
They are joined by JOIN-CONDITION.
Foreign Keys are Primary Keys for respective Tables.
Exact scenario is.
When multipkle Users try to enter Data in the SUB-DETAILEd thats is the third level Table(FD_DB_MR_HEADER) for which the POST is used it goes into Dead-lock.
Rgds
Atul p
[Updated on: Tue, 28 February 2006 04:40] Report message to a moderator
|
|
|
|
Re: ora-60 Dead Lock [message #160763 is a reply to message #160756] |
Tue, 28 February 2006 05:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
so you have foreign keys..are ALL of the FOREIGN keys in the 3 tables involved, indexed?- just make sure that there is NO foreign key that is left unindexed. -at least to rule out the possibility that they are the cause.
|
|
|
Re: ora-60 Dead Lock [message #160768 is a reply to message #160763] |
Tue, 28 February 2006 05:14 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
for example u can use this query:
select constraint_name from User_cons_columns where table_name in ('FH_TRANS','FD_TRANS','FD_DB_MR_HEADER' ) and
constraint_name in (select constraint_name from user_constraints where
constraint_type='R') and column_name not in (select column_name from user_ind_columns)
/
This query should NOT RETURN ANY ROWS..if they do then there are unindexed foreign keys..pl. check.
|
|
|
|
Re: ora-60 Dead Lock [message #160777 is a reply to message #160770] |
Tue, 28 February 2006 05:50 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
Atul,
If it does not return any rows than that it! that proves that our original suspect that "this may be due to unindexed foreign keys" is proven false.
however, I did not ask you to create any primary or foreign keys..so I do not understand why you have added them. Are you the main developer or one having all authority to modify the tables? if not THEN PLEASE ROLL BACK THESE CHANGES....AS IT MAY LEAD TO PROBLEMS. HAVE a discussion with your architect or whoever is responsible for table design before you modify.
So what next? well you need to continue the investigation..as I said earlier..try finding the EXACT SCENARIO..(WITH more details)
what is all the work done by the code at the time when the deadlock ocurrs..list it down -if possible with the detail of all the data that is being entered. Now if any other person repeat this steps , they should get a deadlock..once that is done, try to find out which exact sql statements are begin sent..EXACT statements. that may start giving a clue to the answer.
|
|
|
|
Re: ora-60 Dead Lock [message #160781 is a reply to message #160778] |
Tue, 28 February 2006 06:13 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
Hi Atul,
Thank you about clarification on altering the tables.
About finding of scenario --can you identify exact sql statements that are fired when this post occurs? after finding that, can you from 2 different sql plus sessions, try to insert the same sql statements that were prepared and sent by the application?
IF your findings are correct THEN you will be able to get a deadlock from sql plus also..
so this is one way to investigate further. (this same thing can also be done by setting sql_trace for those sessions and then seeing the trace files)
also it is possible that I missed out some other points/cause-this is AFAIK.
|
|
|