Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to remove blank lines using vi editor command Linux/Unix
  • create user with unlimited quota Oracle
  • Good RAC & Standby Notes Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Oracle10g – Using SQLAccess Advisor (DBMS_ADVISOR) with the Automatic Workload Repository Oracle
  • Jai Shree Ram Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Locktree.sql Oracle
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • Reading parameter file and printing Linux/Unix
  • get_vmstat.ksh for Solaris Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • Monitor and Trace Unix processes using truss Linux/Unix
  • plan10g.sql Oracle

mutex in Oracle 10.2.0.2 or Oracle 10g

Posted on 13-Sep-2006 By Admin No Comments on mutex in Oracle 10.2.0.2 or Oracle 10g

#########

# _kks_use_mutex_pin

#

# Enables use of more efficient mutex mechanism for

# implementing library cache pins.

#

#########

_kks_use_mutex_pin=TRUE

Apparently, Oracle is migrating some of its serialization protection from latches to mutexes. For example, the structures previously protected by the Library Cache Pin latch are now protected by a mutex and evidenced by the cursor:pin S wait event. Actually there are several new mutexes and mutex related wait events new to 10g. For example:

– cursor:mutex indicates mutex waits on parent cursor operations and statistic block operations.

– cursor:pin events are waits for cursor pin operations (library cache pin now protected by mutex).

There are a couple interesting facts about Oracle and mutexes. A mutex get is about 30-35 instructions, compared to 150-200 instructions for a latch get. Also, a mutex is around 16 bytes in size, compared to 112 bytes for a latch in Release 10.2 (in prior releases, it was 200 bytes).

One of the appeals of the mutex, per the documentation, is the reduced potential for false contention. That is, a mutex can protect a single structure; often times stored with the structure it protects. However, latches often protect many structures (see cache buffers chain latch) and can yield what the documentation calls false contention. It is called false contention because “the contention is for the protection mechanism rather than the target object you are attempting to access.” This all sounds really great, right? Well, maybe. If Oracle goes to more widespread use of mutexes instead of latches to protect target objects that would be a boatload more mutexes. I am sure the porters at Oracle are not intending to use mutexes exclusively in the future. But, I can see where contention in Oracle could be dramatically reduced at the cost of CPU cycles and memory. What would happen if Oracle protected each buffer with a mutex? While each mutex is less expensive with regard to memory and CPU than an individual latch, you will need considerably more mutexes for each replaced latch. 50 mutexes used to replace a single latch could run the CPU up considerably for the “same” application workload.

I have one final note on mutexes. As of version 10.2.0.2 a SELECT against V$SQLSTAT and searches of child cursor lists are mutex protected.

I found the Tuning the Buffer Cache discussion somewhat interesting. Unless you have been hiding under a rock the past 4-5 years, I am sure you have heard the Oracle experts preaching the notion that ratios are not very helpful in diagnosing the health of a database. In particular, the buffer cache hit ratio is frequently tagged as meaningless. A smile came to my face when I read the following excerpt from the course material:

“A badly tuned database can still have a hit ratio of 99% or better…hit ratio is only one part in determining tuning performance…hit ratio does not determine whether a database is optimally tuned…”

Oracle is finally teaching what the experts have been saying for years!

I have been to several Hotsos events/training classes. They often talk about the need to include the buffer is pinned count statistic in the tally for logical reads. These operations are simply latch-reduced logical reads. Why doesn’t Oracle integrate this information into their course material or documentation set? They still only claim that db block gets and consistent gets constitute logical reads. I monitored a process recently in one of my production environments and noticed the process did 2 buffer is pinned count logical reads for every 1 (db block gets + consistent gets). That is a substantial percentage of work owed to operations not officially categorized as a measure of work by Oracle.

Lastly, the on-topic impromptu discussions were fruitful. That always makes the training session more interesting 🙂

10.2.0.2 defaults the use of mutexes for certain shared cursor operations, instead of library cache latches and library cache pin latches and library cache pins. Mutexes use the CAS (compare and swap) operation. . On platforms which do not support CAS, the Mutex code simulates the mutex operation using a pool of latches (called ‘Mutex’). Mutex latches are only used on platforms where CAS (compare-and-swap) operations are not supported (I believe the only platform that CAS is not supported is PA-RISC). . Disabling mutexes reduced CPU usage by 10%-15% (the values were derived looking at the average of the Current CPU values of the Glance output for a mutex and non-mutex run).

Oracle, SQL scripts

Post navigation

Previous Post: tuning commmand for cpu, ip and memory stats
Next Post: Vivek’s egrep commands to trace problem. (on linux x86-64)

Related Posts

  • Good links for x$ tables in oracle. Oracle
  • Create type and Grant on it. Oracle
  • Oracle Connections expire_time and firewall Oracle
  • Rman Notes -1 Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Generating XML from SQLPLUS Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • RAC with RHEL4 and 11g Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • Oracle Material from OTN Oracle
  • xargs use Linux/Unix
  • Export Import with QUERY Oracle
  • DBMS_JOB all example Oracle
  • fkwoind.sql fkwoindex.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme