Results 1 to 5 of 5

Thread: urgent

  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Unanswered: urgent

    hi all,



    i wanted to know how to find out the query which is hitting the table ??

    i meant which data dictionary i shud use it?

    im getting record is locked by another user messg whn im trying to update a table data. so whn i chkd i got tat spcficic session is lockd by one machine.so whn i restared that problm gone.

    but i wanted to know how to know which query it is doing it and how many times it is hitting tat table

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    there are many ways.
    if you just want to see DML that is accessing that table:
    select * from v$sqlarea
    where sql_text like '%TABLENAME%';


    from there you could take the MODULE_HASH column value
    and match that to v$session to find the session/user
    that is running it.

    you could also look in any of the various LOCK tables:
    select * from dba_objects
    where object_name like '%LOCK%'
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
    id1, id2, lmode, request, type
    FROM V$LOCK
    WHERE (id1, id2, type) IN
    (SELECT id1, id2, type FROM V$LOCK WHERE request>0)
    ORDER BY id1, request
    /
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Here's a script I use (from sqlplus) to find out object locks, who has them,
    who's wanting them ...

    Gregg
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62
    thanx for all replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •