Latch, mutex and beyond

shared_latch_X.sql

/*
     This file is part of demos for "Contemporary Latch Internals" seminar v.24.08.2010
     Copyright:   (c)  Andrey S. Nikolaev (Andrey.Nikolaev@rdtex.ru) RDTEX

http://AndreyNikolaev.wordpress.com

*/
connect / as sysdba
alter session set max_dump_file_size=0;

/* 
   before 11g shared latch get function was named kslgetsl()
   in 11g - kslgetsl_w()
*/
col shared_latch_function new_value shared_latch_function

var db_v varchar2(100);

var db_comp varchar2(100);

begin dbms_utility.db_version(:db_v,:db_comp); end;

/ 

select decode(sign(replace(:db_v,'.','')-110000),1,'kslgetsl_w', 'kslgetsl') shared_latch_function
   from dual;


col laddr new_value laddr 
set echo on

SELECT addr laddr   FROM v$latch
WHERE NAME='gcs partitioned table hash';

/* get latch in exclusive mode */

oradebug setmypid
oradebug call &shared_latch_function 0x&laddr 1 4 5 16

host sleep 100
oradebug call kslfre 0x&laddr
exit

1 Comment »

  1. [...] the number of holders. To simplify further demonstrations I wrote scripts shared_latch_S.sql and shared_latch_X.sql This scripts acquire the ‘gcs partitioned table hash’ latch in S and X mode respectively and [...]

    Pingback by Shared latch behaves like enqueue « Latch, mutex and beyond — November 17, 2010 @ 10:16 pm | 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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 67 other followers

%d bloggers like this: