DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: V$LOCK

  1. #1
    Join Date
    Dec 1999
    Alpharetta, GA, US
    I am seeing 160 row's in my V$LOCK table. These are locks in the database? i startup the database and still i am seeing 160 row's. How do i clear these row's.


  2. #2
    Join Date
    Dec 2001
    Keene, NH
    Okay, I'll take a crack at this:

    1. First do some research to what the locks are and why!
    2. Next start killing sessions

    (these queries are 9i but I'd guess they would work in 8i)
    --See if any sessions are waitng due to locks:
    SELECT sid, seq#, event, wait_time, state, seconds_in_wait
    from v$session_wait a
    WHERE event = 'enqueue'

    --See the DML (inserts, update, deletes) locks per session
    SELECT a.*,b.osuser,b.program
    FROM dba_dml_locks a, v$session b
    where a.session_id = b.sid

    -- Now look at SQL for each session:
    SELECT s.sid , s.serial#, s.status, s.osuser , s.username,
    t.sql_text, s.machine, s.terminal, p.program
    FROM v$session s, v$process p, v$sqltext t
    WHERE t.address = s.sql_address
    and s.paddr = p.addr
    and t.hash_value = s.sql_hash_value
    /* and s.sid = 54 */
    order by p.spid, t.hash_value, t.piece

Posting Permissions

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

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.