Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Using _spin_count

Oracle Database Tips by Donald BurlesonApril 30, 2015

 

Mohan asks: I hear that the spin_count parameter can help relieve latch contention (high latch wait values in STATSPACK reports), but I would like to know how Oracle 9i and later versions moved the spin_count parameter to a hidden _spin_count parameter. Why did Oracle 9i depreciated the spin_count parameter?  Is there any other parameter to replace spin_count in oracle 9i and beyond?
 

Answer:  The spin_count was designed to allow the DBA to control the amount of time spent "spinning" (waiting) for a serialization latch to be released and has a default value of 2,000.  Since spin_count sets the number of spins a process will undergo before trying to get a latch, if the CPU is not fully loaded, a high value may be best; for a fully-loaded CPU, a smaller value for spin_count may help.

As you noted, spin_count is still there, re-named to an undocumented parm _spin_count.  While Oracle does publish their reasons, MOSC Note:30832.1 says that spin_count is of limited value:

?If a system is not tight on CPU resource SPIN_COUNT can be left at higher values but anything above 2000 is unlikely to be of any benefit.?.

Some DBA's will try to increase spin_count in an attempt to reduce latch contention. This is a brute force approach where we are increasing the probability of obtaining the latch by increasing the number of requests for the latch. In most cases, this addresses the symptom of the problem and not the original cause.

In my experience, you rarely need to adjust your spin_count, but there are some systems where changing the now-undocumented _spin_count can help to relieve latch contention.

Also, Guy Harrison notes that spin_count can still be valuable as a tuning tool:

"Latches protect areas of Oracle shared memory from concurrent access in roughly the same way that locks protect data in tables. When a session wants a latch it will repeatedly attempt to obtain the latch until reaching the value of "_spin_count" after which it will sleep and a "latch free" wait will occur. Excessive latch sleeps can create restrictions on throughput and response time.

The two most frequently encountered forms of latch contention in modern Oracle (10g/11g) are:

- Library cache/shared pool latch contention - This is usually caused when an application issues high volumes of SQL which are non-sharable due to an absence of bind variables. The CURSOR_SHARING parameter can often be used to alleviate this form of contention.

- cache buffer chains contention - This is usually associated with very high logical read rates and "hot" blocks within the database (sometimes index blocks). After tuning SQL to reduce logical IO and eliminate repetitive reads of the same information, partitioning is often a possible solution.

If latch contention is causing serious problems, and the system has some free CPU capacity, adjusting the value of the undocumented parameter _spin_count may be effective in reducing contention. As always, modifying undocumented parameters should be approached with great caution. "
 

This script can display the value for _spin_count:

COLUMN parameter           FORMAT a37
COLUMN description         FORMAT a30 WORD_WRAPPED
COLUMN "Session VALUE"     FORMAT a10
COLUMN "Instance VALUE"    FORMAT a10
SET LINES 100 PAGES 0
 

SELECT
   a.ksppinm  "Parameter",
   a.ksppdesc "Description",
   b.ksppstvl "Session Value",
   c.ksppstvl "Instance Value"
FROM
   x$ksppi a,
   x$ksppcv b,
   x$ksppsv c
WHERE
   a.indx = b.indx
   AND
   a.indx = c.indx
   AND
   a.ksppinm like '/_spin%' escape '/';
;
 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.