How to find Latch and what actions need to be taken when there is a latch

Hi
Can you please tell me how to find Latch and what actions need to be taken when there is a latch?
Thanks
Regards,
RJ.

1. What is a latch?
Latches are low level serialization mechanisms used to protect shared
data structures in the SGA. The implementation of latches is operating
system dependent, particularly in regard to whether a process will wait
for a latch and for how long.
A latch is a type of a lock that can be very quickly acquired and freed.
Latches are typically used to prevent more than one process from
executing the same piece of code at a given time. Associated with each
latch is a cleanup procedure that will be called if a process dies while
holding the latch. Latches have an associated level that is used to
prevent deadlocks. Once a process acquires a latch at a certain level it
cannot subsequently acquire a latch at a level that is equal to or less
than that level (unless it acquires it nowait).
2. Latches vs Enqueues
Enqueues are another type of locking mechanism used in Oracle.
An enqueue is a more sophisticated mechanism which permits several concurrent
processes to have varying degree of sharing of "known" resources. Any object
which can be concurrently used, can be protected with enqueues. A good example
is of locks on tables. We allow varying levels of sharing on tables e.g.
two processes can lock a table in share mode or in share update mode etc.
One difference is that the enqueue is obtained using an OS specific
locking mechanism. An enqueue allows the user to store a value in the lock,
i.e the mode in which we are requesting it. The OS lock manager keeps track
of the resources locked. If a process cannot be granted the lock because it
is incompatible with the mode requested and the lock is requested with wait,
the OS puts the requesting process on a wait queue which is serviced in FIFO.
Another difference between latches and enqueues is that
in latches there is no ordered queue of waiters like in enqueues. Latch
waiters may either use timers to wakeup and retry or spin (only in
multiprocessors). Since all waiters are concurrently retrying (depending on
the scheduler), anyone might get the latch and conceivably the first one to
try might be the last one to get.
3. When do we need to obtain a latch?
A process acquires a latch when working with a structure in the SGA
(System Global Area). It continues to hold the latch for the period
of time it works with the structure. The latch is dropped when the
process is finished with the structure. Each latch protects a different
set of data, identified by the name of the latch.
Oracle uses atomic instructions like "test and set" for operating on latches.
Processes waiting to execute a part of code for which a latch has
already been obtained by some other process will wait until the
latch is released. Examples are redo allocation latches, copy
latches, archive control latch etc. The basic idea is to block concurrent
access to shared data structures. Since the instructions to
set and free latches are atomic, the OS guarantees that only one process gets
it. Since it is only one instruction, it is quite fast. Latches are held
for short periods of time and provide a mechanism for cleanup in case
a holder dies abnormally while holding it. This cleaning is done using
the services of PMON.
4. Latches request modes?
Latches request can be made in two modes: "willing-to-wait" or "no wait". Normally,
latches will be requested in "willing-to-wait" mode. A request in "willing-to-wait" mode
will loop, wait, and request again until the latch is obtained. In "no wait" mode the process
request the latch. If one is not available, instead of waiting, another one is requested. Only
when all fail does the server process have to wait.
Examples of "willing-to-wait" latches are: shared pool and library cache latches
A example of "no wait" latches is the redo copy latch.
5. What causes latch contention?
If a required latch is busy, the process requesting it spins, tries again
and if still not available, spins again. The loop is repeated up to a maximum
number of times determined by the initialization parameter SPINCOUNT.
If after this entire loop, the latch is still not available, the process must yield
the CPU and go to sleep. Initially is sleeps for one centisecond. This time is
doubled in every subsequent sleep.
This causes a slowdown to occur and results in additional CPU usage,
until a latch is available. The CPU usage is a consequence of the
"spinning" of the process. "Spinning" means that the process continues to
look for the availability of the latch after certain intervals of time,
during which it sleeps.
6. How to identify contention for internal latches?
Relevant data dictionary views to query
V$LATCH
V$LATCHHOLDER
V$LATCHNAME
Each row in the V$LATCH table contains statistics for a different type
of latch. The columns of the table reflect activity for different types
of latch requests. The distinction between these types of requests is
whether the requesting process continues to request a latch if it
is unavailable:
willing-to-wait If the latch requested with a willing-to-wait
request is not available, the requesting process
waits a short time and requests the latch again.
The process continues waiting and requesting until
the latch is available.
no wait If the latch requested with an immediate request is
not available, the requesting process does not
wait, but continues processing.
V$LATCHNAME key information:
GETS Number of successful willing-to-wait requests for
a latch.
MISSES Number of times an initial willing-to-wait request
was unsuccessful.
SLEEPS Number of times a process waited a requested a latch
after an initial wiling-to-wait request.
IMMEDIATE_GETS Number of successful immediate requests for each latch.
IMMEDIATE_MISSES Number of unsuccessful immediate requests for each latch.
Calculating latch hit ratio
To get the Hit ratio for latches apply the following formula:
"willing-to-wait" Hit Ratio=(GETS-MISSES)/GETS
"no wait" Hit Ratio=(IMMEDIATE_GETS-IMMEDIATE_MISSES)/IMMEDIATE_GETS
This number should be close to 1. If not, tune according to the latch name
7. Useful SQL scripts to get latch information
** Display System-wide latch statistics.
column name format A32 truncate heading "LATCH NAME"
column pid heading "HOLDER PID"
select c.name,a.addr,a.gets,a.misses,a.sleeps,
a.immediate_gets,a.immediate_misses,b.pid
from v$latch a, v$latchholder b, v$latchname c
where a.addr = b.laddr(+)
and a.latch# = c.latch#
order by a.latch#;
** Given a latch address, find out the latch name.
column name format a64 heading 'Name'
select a.name from v$latchname a, v$latch b
where b.addr = '&addr'
and b.latch#=a.latch#;
** Display latch statistics by latch name.
column name format a32 heading 'LATCH NAME'
column pid heading 'HOLDER PID'
select c.name,a.addr,a.gets,a.misses,a.sleeps,
a.immediate_gets,a.immediate_misses,b.pid
from v$latch a, v$latchholder b, v$latchname c
where a.addr = b.laddr(+) and a.latch# = c.latch#
and c.name like '&latch_name%' order by a.latch#;
8. List of all the latches
Oracle versions might differ in the latch# assigned to the existing latches.
The following query will help you to identify all latches and the number assigned.
column name format a40 heading 'LATCH NAME'
select latch#, name from v$latchname;

Similar Messages

  • After an upgrade Firefox now throws my Mac into Work Offline mode repeatedly. What action needs to be taken so Firefox permanently disables Work Offline mode?

    Immediately after an upgrade Firefox beginning throwing my Mac into Work Offline mode. Apparently, this is done anytime my connection blips out. I have tried a work-around, but to no avail. The computer is thrown into Work Offline when I daily turn on the computer, as well as in-between website windows.

    We've seen more post about being in Offline mode on a Mac. I haven't seen any explanation or solution to this problem.
    *[[/questions/919242]]
    *[[/questions/917014]]

  • How to find date and time on photo taken by iphone?, How to find date and time on photo taken by iphone?

    How to find date and time on iphone's photo taken?

    in iPhoto no matter the source of the photo you see the information about th ephoto by selecting the photo and showing info (the get info button may be in a different location depending on the version of iPhoto you have)
    If you are not aking an iPhoto question but are asking an iPhone question instead then repost in the iPhone forum - iPhoto has no association with the iPhone
    LN

  • HT2509 Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the Mac Air? I need to be able to use a pop up window of fonts.

    Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the MacBook  Air? I need to be able to use a pop up window of fonts.

    Unless you've done anything to change it, Google keeps every email that ever passes through their server in your All Mail folder/mailbox/label. Even if you delete stuff, they hold onto it, there. You have to go out of your way to actually delete anything permanently.

  • How do I find out how to use cloud and what does it exactly do?

    I Am new to Apple and just not sure how this iCloud works and what does it do.

    Read here:
    http://www.apple.com/icloud/
    Basically it is a storage area on apple's servers that lets you keep a backup of your device to restore from in case you need to.
    It also has additional features for your media content and other services.

  • So someone took my ipod 4g and who ever took it turned it off and i dont know how to find it and i really want it back, what should i do?

    so someone took my ipod 4g and who ever took it turned it off and i dont know how to find it and i really want it back, what should i do?

    lost/stolen                                      
    No app on the iPod is required.                            
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected, on a computer browser go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it unless you had iOS 7 on the device. With iOS 7, one has to enter the Apple ID and password to restore the device.
    - Apple will do nothing without a court order                                                
    Reporting a lost or stolen Apple product                                               
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • How to shrink this LOB and what steps need to perform.

    Problem Description: hi
    one of our production database having one table i that table having 320 gb LOB in one column
    can you please suggest how to shrink this LOB and what steps need to perform.
    during shrinkg of LOB how much undo tablespace is require,and does it create more archive log because LOB size is 320gb.
    this table having function based index also.so we will not shrink it.
    we need to release the space from database this in only big LOB out of my DATABASE its took approx. 80%.
    there is any way we can reclame this space with less time.
    please suggest how to do this and how much downtime is required.
    database version 10.2.0.4 and OS AIX 5.3

    Hi;
    Please check below which could be helpful for your issue:
    Shrink LOB Segment On Partitioned Table [ID 802059.1]
    How to determine the actual size of the LOB segments and how to free the deleted/unused space above/below the HWM [ID 386341.1]
    Why is no space released after an ALTER TABLE ... SHRINK? [ID 820043.1]
    Troubleshooting Guide (TSG) - Large Objects (LOBs) [ID 846562.1]
    Regard
    Helios

  • Something was hidden in a download and now these double green underlined hyperlinks show up everywhere, and pop ups too whenever I click on ANYTHING. I can't figure out how to find it and get rid of it.

    Something was hidden in a download and now these double green underlined hyperlinks show up everywhere, and pop ups too whenever I click on ANYTHING. I can't figure out how to find it and get rid of it.

    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
    Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
    Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised the value of Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Can any guide me how to gather requirements and what r the approaches!

    HI
    Can any guide me how to gather requirements and what r the approaches and documents.
    Regards
    VSM

    Modeling approach:
    Top down - Try and find out what kind of reports the users need. Based o that you can determine your granularity of data.
    Have to find out what the sources are. Then decide if you have standard content or if you need to enhance or develop new objects.
    Try and see if standard reports are enough.
    If they ned aggregated data, decide on cubes. Then decide what all business areas the reports encompass. Based on that u can decide to build multiproviders or infosets depending on requirement.
    try to incorporate all the keyfigures  and characteristics in your data model.
    then decide how many layer ODS's you might need.
    then come up with a data model accordingly.

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • I have question about hooking up an external hdd to a time capsule and still have my printer hooked up as well. Anyone got any tips for me, how to do it and what brand of harddrive that will work best for me 1 or 2 TB

    i have question about hooking up an external hdd to a time capsule and still have my printer hooked up as well. Anyone got any tips for me, how to do it and what brand of harddrive that will work best for me 1 or 2 TB

    You just need a powered hub.. if you already use one then fine.
    Plug in just about any external hard disk will work fine. Format has to be readable by the TC.. ie fat32.. or much better HFS+.. plug it into a Mac to prepare the drive.
    Pick whatever size suits.. nowadays 2TB are most economical.
    WD, Seagate have goobled up all the minor players.. so pick one.
    Whatever suits your budget and asthetics.
    NOTE.. The USB on the TC is fine for printers.. IMHO it is the wrong way to go with USB disks.. use the internal disk of the TC.. USB is less than half the native speed plugged into a Mac.. TC to USB is slow.. far slower than internal drive.. or using external drive as external.

  • HT1848 I rented four movies on my mac and then transfered them to my iPad, i then did an update to my iPad, now the rentals are not on my ipad nor my mac. I did not watch them and I was charged for them. How do find them and transfer back on my iPad

    I rented four movies on my mac and then transfered them to my iPad, i then did an update to my iPad, now the rentals are not on my ipad nor my mac. I did not watch them and I was charged for them. How do find them and transfer back on my iPad

    If you moved them to your iPad then they will have been removed from your Mac.  If they are no longer in the iPad's Videos app following the update then you will need to try contacting iTunes support and see if they will let you re-download them : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • How to find CPU and Memory Utilization

    Hi,
    How to find CPU and Memory Utilization of my application which is
    running in solaris workstation.My application has a management console in which we need to update the cpu and memory periodically.
    (Notr : Usage of JNI is restrcited)
    Thnx and Rgds,
    Mohan

    There is no CPU usage API in Java. You need some JNI code. For memory usage see the Runtime methods:
         * Get information of memory usage: max, total, free and (available/used).
         * <ul>
         * <li>Max is the maximum amount of bytes the application can allocate (see also java options -Xmx). This value is fixed.
         * If the application tries to allocate more memory than Max, an OutOfMemoryError is thrown.
         * <li>Total is the amount of bytes currently allocated from the JVM for the application.
         * This value just increases (and doesn't decrease) up to the value of Max depending on the applications memory
         * requirements.
         * <li>Free is the amount of memory that once was occupied by the application but is given back to the JVM. This value
         * varies between 0 and Total.
         * <li>The used amount of memory is the memory currently allocated by the application. This value is always less or equal
         * to Total.
         * <li>The available amount of memory is the maximum number of bytes that can be allocated by the application (Max - used).
         * </ul>
         * In brief: used <= total <= max
         * <p>
         * The JVM can allocate up to 64MB (be default) system memory for the application. If more is required, the JVM has to be started with the Xmx option
         * (e.g. "java -Xmx128m" for 128 MB). The amount of currently allocated system memory is Total. As the JVM can't give back unallocated memory
         * to the operating system, Total can just increase (up to Max).
         * @return Memory info.
        static public String getMemoryInfo() {
            StringBuilder sb = new StringBuilder();
            sb.append("Used: ");
            sb.append(toMemoryFormat(getUsedMemory()));
            sb.append(", Available: ");
            sb.append(toMemoryFormat(getAvailableMemory()));
            sb.append(" (Max: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().maxMemory()));
            sb.append(", Total: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().totalMemory()));
            sb.append(", Free: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().freeMemory()));
            sb.append(")");
            return sb.toString();
        }//getMemoryInfo()

  • How to find 11i and r12 applications characterset

    Hi,
    How to find 11i and r12 applications characterset not of database only applications,What is IANA characterset asked in rapid install?How to find IANA character set in 11i and r12
    Regards

    Hi,
    How to find 11i and r12 applications characterset not of database only applicationsAs applmgr user, source the application env file and issue "echo $NLS_LANG".
    You can also get it from the application context file (search for <NLS_LANG oa_var="s_nlslang">).
    What is IANA characterset asked in rapid install?How to find IANA character set in 11i and r12This is documented in the installation manual.
    The IANA (Internet Assigned Numbers Authority) character set is the Internet-assigned standard character set name used by the Web server. See http://www.iana.org/assignments/character-sets for more information.
    Regards,
    Hussein

  • I am trying to connect Garritan Personal Symphony to Logic Express and Garageband. A dialog box pops up and asks for plugin Garritan-P. Where do I find it and what do I do with it. I can't locate this plugin doing searches on any of the porgrams.

    I am trying to connect Garritan Personal Symphony to Logic Express and Garageband. A dialog box pops up and asks for plugin Garritan-P. Where do I find it and what do I do with it. I can't locate this plugin doing searches on any of the porgrams.

    I'm not sure which version of Garritan Personal Orchestra you have or when you are getting a window pop-up, but check this link for starters:
    http://afjohnston.blogspot.com/2009/11/using-garritan-personal-orchestra-gpo.htm l

Maybe you are looking for

  • Need vendor report for district/county

    I am looking to pull a report for a vendor by district/county.  If possible, jurisdiction code would be nice. I was looking at a range of reports around S_ALR_87012087 but none include district.  Even vendor search doesn't have this function. Thanks!

  • Brushes unusable due to sluggish performance

    Bought AP3 the other day, all patched up. Felt ready to really start adjusting and working with my photos. Unfortunately skin smoothing causes roughly 10 sec delay per mouse click. Highlights and shadows causes AP3 to hang at about 80% processor load

  • Missing class: oracle.jdevimpl.webservices.wizard.WSDLDoc

    Hi, I downloaded and installed the latest JDeveloper (11.1.1.2.0). However, there seems to be a missing component or wizard. I uninstalled and re-installed with no better results. The missing component is the "Business Tier" section where I should be

  • Premiere Elements 9 memory leak

    Operating system Window 7 64-bit. Using Premiere Elements 9 after loading a project task manager shows memory continuously increasing and eventually Elements slows to a crawl. Has anyone else seen this problem and is there a fix for it?  One site sai

  • Which quick time should I be using for windows vista?

    which quick time should I be using for windows vista? when I look at the plugins I'm using for Google Chrome Browser there are several listed for Quick Time, do I need them all?