Latch, mutex and beyond


     This file is part of demos for "Latch, mutex and beyond"  blog 
     Andrey S. Nikolaev (

     Make the mutex busy in pseudoexamine mode for 50 seconds
set echo off
set feed off
set termout off
connect / as sysdba

col word_size new_value word_size
col mutex_value new_value mutex_value
select vsize(saddr) word_size,
       decode(vsize(saddr),4,'0x10001','0x100000001') mutex_value
       from v$session where rownum=1;

oradebug setmypid
oradebug poke 0x&1  &word_size &mutex_value
host sleep 50
oradebug poke 0x&1  &word_size 0x0


  1. […] "release" the mutex, I will change its value back to zero. I wrote script mutex_e_mode.sql that "holds" mutex in E mode for 50 […]

    Pingback by Mutex waits. Part 1. “Cursor: Pin S” in Oracle 10.2-11.1. Invisible and aggressive. « Latch, mutex and beyond — July 9, 2011 @ 1:19 pm | Reply

  2. […] table sys.mon_mods$ in exclusive mode nowait“. I will artificially block this mutex using mutex_e_mode.sql script and wait for the next SQL […]

    Pingback by Mutex waits. Part II. “Cursor: Pin S” in Oracle 11.2 _mutex_wait_scheme=0. Steps out of shadow. « Latch, mutex and beyond — October 25, 2011 @ 4:23 pm | Reply

  3. Please advise what the value for &1 in the oradebug poke command. Is that the MUTEX_ADDR value from the x$mutex_sleep_history query?

    Comment by Thiinh Tran — August 15, 2012 @ 5:19 am | Reply

    • Yes, this should be the MUTEX_ADDR from the x$mutex_sleep_history. This is the only place where Oracle externalizes the mutex address to SQL.

      Comment by andreynikolaev — August 15, 2012 @ 9:15 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: