[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/29/2005 at 08:35AM PDT, ID: 21509187
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Deadlock (-60) due to parent-child relationship?

Asked by tfex in Oracle Database

Tags: oracle, deadlock

I am having a deadlock which is quite perplexing:

DEADLOCK DETECTED
Current SQL statement for this session:
LOCK TABLE table_1 IN EXCLUSIVE MODE
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
Deadlock graph:
                       ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TM-00001927-00000000        15      22    SS             34      46           X   table_2
TM-00001814-00000000        34      46     X             15      22           X    table_1
session 22: DID 0001-000F-00000012  session 46: DID 0001-0022-0000003F
session 46: DID 0001-0022-0000003F  session 22: DID 0001-000F-00000012
Rows waited on:
Session 46: obj - rowid = 0000371E - AAADceAAHAAAAAAAAA
  (dictionary objn - 14110, file - 7, block - 0, slot - 0)
Session 22: obj - rowid = 000018CD - AAADWSAAGAAAAAAAAA
  (dictionary objn - 6349, file - 6, block - 0, slot - 0)
nformation on the OTHER waiting sessions:
Session 46:
  pid=34 serial=360 audsid=221608 user: 222/R_USER
  O/S info: user: XXX, term: pts/4, ospid: 8768, machine: m1
            program: ? (TNS V1-V3)
  application name: ? (TNS V1-V3), hash value=0
  Current SQL Statement:
  LOCK TABLE table_2 IN EXCLUSIVE MODE
End of information on OTHER waiting sessions.

Before we begin, the exclusive locks on the tables are required to coordinate some complex updates that must be completed before any other user is allowed to read the table again.  The two programs are running at the same time and are different programs.  Both issue the lock commands in the same sequence: lock table_1, lock table_2.  There are other programs also running against the same database at the same time.

Both of the tables involved table_1 and table_2 have parent tables.  The childen have foreign keys to the parents.  All foreign keys are indexed.

Here is the order of the actions:

Session #22 above makes an update to the parent of table_2.
Session #46 locks table_1.
Session #22 locks table_1 and waits.
Session #46 locks table_2 and waits.
Session #22 get a -60 error. Rolls back.
Session #46 completes.

I have not been able to reproduce this error using sql*plus in two sessions.  Using sql*plus I cannot get the SS lock on table_2.

For some reason session #22 aquires an SS lock on table_2.  I assume the SS lock is a Row Share Table (RS) lock, also known as, a Subshare Table lock (SS).  Have I identified the lock correctly?  If so, why is the update to the parent locking the child during normal processing when I cannot get it to do the same using sql*plus?

My next problem is that the "Rows waited on" do not make any sense:

Session 46: obj - rowid = 0000371E - AAADceAAHAAAAAAAAA
  (dictionary objn - 14110, file - 7, block - 0, slot - 0)
Session 22: obj - rowid = 000018CD - AAADWSAAGAAAAAAAAA
  (dictionary objn - 6349, file - 6, block - 0, slot - 0)

I looked up the obects using

    select dbms_rowid.rowid_object( 'AAADceAAHAAAAAAAAA' ) from dual;
    select dbms_rowid.rowid_object( 'AAADWSAAGAAAAAAAAA' ) from dual;

    select * from dba_objects where object_id = 14110;
    select * from dba_objects where object_id = 6349;

    select * from dba_objects where data_object_id = 14110;
    select * from dba_objects where data_object_id = 6349;

to make sure they matched the 14110 and 6349 above.

The object 14110 is an index of the parent of the parent of the child table in question (p->p->c).  6349 is another table which appears to have only select queries against it.

The deadlock occurs fairly often and each time the "Rows waited on" point to different combinations of tables and indexes.  None of them are ever the actual tables indicated in the deadlock: table_1 and table_2.  Am I breaking down the deadlock information correctly?  Have I correclty identified the "Rows waited on"?  Please explain the structure of the rows identified.  For example what exactly is the dictionary objn?

How do I proceed to determine exactly what action is causing the SS lock on table_2 which I believe should not be there?

Why can't I reproduce this in sql*plus?

Is this a real deadlock or is this some type of resource conflict?


[+][-]07/29/05 09:10 AM, ID: 14556111

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/29/05 09:16 AM, ID: 14556175

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07/29/05 02:27 PM, ID: 14558733

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/30/05 10:44 PM, ID: 14563730

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/31/05 09:07 AM, ID: 14565389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/01/05 06:00 AM, ID: 14569411

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/05 02:31 PM, ID: 14574373

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/01/05 02:33 PM, ID: 14574401

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/02/05 09:17 AM, ID: 14580648

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/02/05 09:43 AM, ID: 14580900

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/02/05 10:29 AM, ID: 14581356

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: oracle, deadlock
Sign Up Now!
Solution Provided By: jrb1
Participating Experts: 4
Solution Grade: A
 
 
[+][-]08/03/05 11:52 AM, ID: 14591808

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/03/05 02:23 PM, ID: 14593338

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/04/05 11:20 AM, ID: 14600987

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/05 01:28 PM, ID: 14704141

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91