You were brought to this page based on an internet search
and as a free service to Oracle DBAs.
The text below is an except from the book,
Oracle Performance Firefighting, written by
Craig Shallahamer of
OraPub, Inc.
Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click
here.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
-------------------------------
For years, the _spin_count instance parameter has been set to 2000 by default, which is still the case in Oracle Database 11g. Note that Oracle does not spin for 2,000 ms, but rather makes up to 2,000 latch fast get requests.
A good mental picture of spinning on a latch is to think of a room full of people looking intently at the room's center. There is a hole in the very center of the room where the just-released latch shoots out like a rocket. All the people in the room are repeatedly yelling, "Give me the latch!" and swinging their arms as fast as they can up to 2,000 times, hoping that their hand will move over the launch spot just as the latch is released. When they look in their hand, the contestants hope to see the latch. If they don't, they continue swinging their arms and yelling (up to _spin_count times), hoping next time they will be the lucky one.
As I wrote earlier, unlike enqueues, with latches there is no ordering, no enqueue, and no dequeue. It's dynamic, changing, exciting, and probabilistic. But unless the Oracle architects made a poor choice, this should be a fast way for a process to acquire a latch. I guess it is possible for the first people to ask for the latch to be the last people to acquire the latch, but I have not experienced that situation.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
|