Monitoring Blocking locks (dba_blockers vs v$lock)

Hi
This question relates to monitoring blocking locks on a 9.2.0.5 database
Origionally I have been monitoring bocking locks with every 5 mins using the following query:
"select * from dba_blockers"
I have recently implemented monitoring via grid control this is running an out of the box metric every 5 mins, the sql behind it is as follows:
"SELECT blocking_sid, num_blocked
FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
FROM ( SELECT l.id1, l.id2,
MAX(DECODE(l.block, 1,l.sid,
2,l.sid, 0 )) blocking_sid,
SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
FROM v$lock l
WHERE ( l.block!= 0 OR l.request > 0 ) AND
GROUP BY l.id1, l.id2)
GROUP BY blocking_sid
ORDER BY num_blocked DESC)
WHERE num_blocked != 0 "
Now.. At one point today the alert using "select * from dba_blockers" fired where as the out of the box metric from gird control did not fire.... alert duration was around 5 - 10 mins
At first i simply assumed that this could have been a brief lock and due to both 5 min intervals being out of sync, the lock had shown and cleared before the grid control interval run.
now im a little more curious.
Is there any significan difference in what these 2 different SQL's will alert on (different types of blocking locks / sessions?) , I was under the impression that DBA_BLOCKERS was simply querying a number of joined views, and Oracle had decided to use V$lock for their out of the box metric as it was more efficient.
Any comments welcome
Thanks

Re: Monitoring blocking Locks

Similar Messages

  • Monitoring blocking Locks

    Hi
    This question relates to monitoring blocking locks on a 9.2.0.5 2 node RAC
    Origionally I have been monitoring bocking locks with every 5 mins using the following query:
    "select * from dba_blockers"
    I have recently implemented monitoring via grid control this is running an out of the box metric every 5 mins, the sql behind it is as follows:
    "SELECT blocking_sid, num_blocked
    FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
    FROM ( SELECT l.id1, l.id2,
    MAX(DECODE(l.block, 1, i.instance_name||'-'||l.sid,
    2, i.instance_name||'-'||l.sid, 0 )) blocking_sid,
    SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
    FROM gv$lock l, gv$instance i
    WHERE ( l.block!= 0 OR l.request > 0 ) AND
    l.inst_id = i.inst_id
    GROUP BY l.id1, l.id2)
    GROUP BY blocking_sid
    ORDER BY num_blocked DESC)
    WHERE num_blocked != 0 "
    Now.. At one point today the alert using "select * from dba_blockers" fired where as the out of the box metric from gird control did not fire.... alert duration was around 5 - 10 mins
    At first i simply assumed that this could have been a brief lock and due to both 5 min intervals being out of sync, the lock had shown and cleared before the grid control interval run.
    now im a little more curious.
    Is there any significan difference in what these 2 different SQL's will alert on, I was under the impression that DBA_BLOCKERS was simply querying a number of joined views, and Oracle had decided to use V$lock for their out of the box metric as it was more efficient.
    Any comments welcome
    Thanks

    Just to prove that the SQL is correct I have constrcuted a demo for you...
    SQL> create table t (a char(1));
    Table created.
    SQL> insert into t values ('z');
    1 row created.
    SQL> commit;
    in session 1 ---->
    select * from t where a='z' for update;
    ==================================================================
    in session 2 ---->
    update t set a='x' where a='z';
    (session simply hangs)
    ==================================================================
    in session 3 ------>
    SQL> select * from dba_blockers;
    HOLDING_SESSION
    48
    SQL>
    SQL> SELECT blocking_sid, num_blocked
    FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
    FROM ( SELECT l.id1, l.id2, MAX(DECODE(l.block, 1, i.instance_name||'-'||l.sid,
    2, i.instance_name||'-'||l.sid, 0 )) blocking_sid,
    SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
    FROM gv$lock l, gv$instance i
    WHERE ( l.block!= 0 OR l.request > 0 ) AND
    l.inst_id = i.inst_id
    GROUP BY l.id1, l.id2)
    GROUP BY blocking_sid
    ORDER BY num_blocked DESC)
    WHERE num_blocked != 0;
    2 3 4 5 6 7 8 9 10 11 12
    BLOCKING_SID NUM_BLOCKED
    RAC1-48 1
    So back to the origional question,
    I am using both these queries from different monitors on my prod syystem, both running on 5 minute intervals, " select * from dba_blockers" fired where as the above query - querying gv$lock did not fire.
    Origionaly i assumed that the blocking lock may have simply lasted 3t0 seconds, and due the 5 minute monitor intervals of each metric not being in sync, ... "select * from dba_blockers" may have picked up the lock, then the query selecting from gv$lock ran 2 mins later by which time the lock had disapeared.
    -Can anyone suggest any other reasons other than this why one monitor (select * from dba_blockers) picked up the lock and the other (gv$lock) didnt?
    Thanks

  • What Is D Block ? What is country Lock & how to open it?

    What Is D Block ? What is country Lock & how to open it?
    Message was edited by: Rupnay

    From Wikipedia:
    D-Block Records is a subsidiary of the American hip hop label Ruff Ryders.
    If you meant something else, you're going to have to clarify.
    If your phone is carrier locked, ONLY the carrier it is locked to can authorize unlocking it.

  • Monitor enters suddenly power save mode locks up machine

    monitor enters suddenly power save mode locks up machine
    I have all power saving  settings at never in windows
    I had 4x in 9 months  bizarre crash suddenly my monitor turned black then went into energy saving mode then I was unable to reset using button I had to shut down by turning off power supply
    HELP
    amd quad core 980 msi 890fx-gd65                    corsair twinx ddr 1333 2x2 gb
    seasonic s series 520w psu
    swiftech polaris129                        powercolor 6790
    coolermaster storm enforcer 2x 200mm
    dell Dell UltraSharp U2212HM

    Well, a few things could cause such a problem and it could be a true pain in the butt to narrow down.
    How old is the computer? 9months
    When this happens, is it when you are playing a game or other high load process?first times on web last 2 idle
    If so are you keeping track of temperatures via core temp or some other program?using speccy and bios
    Anything in the event log? nothing unfortunately
    Any Graphical distortion other than the screen turning black or do you ever see a window popping up telling you a driver re-set was required. some window screen almost overlay in photshop 7 intermittent
    Have you run memtest to check the memory? some portable apps and benchmarking apps
    If its not a new comp, have you cleaned the comp recently and verifed all the fans are working.
    Have you done an error check on the HDD? fans are ok
    running win xp sp3

  • HT1338 I recently purchased a new Mac Pro w/ mountain lion 10.8 and I am using my Apple 30 inch monitor.  When watching video or browsing certain websites, my monitor will flicker grey and sometimes lock up.  I figure it is the grphic crd or I am missn a

    recently purchased a new Mac Pro w/ mountain lion 10.8 and I am using my Apple 30 inch monitor.  When watching video or browsing certain websites, my monitor will flicker grey and sometimes lock up.  I am a video producer so this is quite frustrating...I figure it is the grphic card or I am missn a plugin or driver update? help!

    Maybe this will help:
    http://support.apple.com/kb/HT1573
    PRAM reset: http://support.apple.com/kb/PH11243                       
    SMC reset: http://support.apple.com/kb/HT3964  

  • Hi there, can anyone please help? Download itunes and it says The Itunes library .itl file is locked, or on a locked disk or you do not have write permission for this file.

    Hi there, can anyone please help? Download itunes and it says The Itunes library .itl file is locked, or on a locked disk or you do not have write permission for this file.

    Holding down the shift key while iTunes is opening. That will bring up the 'choose iTunes library' dialog. Select 'Choose LIbrary' from the choices and navigate to your music folder and iTunes music folder.
    Or refer to this article:
    iTunes for Windows XP: "Disk is locked" or "iTunes folder cannot be found" when installing or opening iTunes
    http://support.apple.com/kb/HT1866

  • My colleague recently synched his phone and now has a full keyboard on the lock screen.  My lock screen keypad is set up like phone keys (alphanumeric).  He's wondering why his is different, and he also now cannot unlock it.  Anyone have this happen?

    My colleague recently synched his phone and now has a full keyboard on the lock screen.  My lock screen keypad is set up like phone keys (alphanumeric).  He's wondering why his is different, and he also now cannot unlock it.  Anyone have this happen?  He came to me yesterday and I noticed that his iPhone 4 still had old software (version in the 4's), so I advised him that he needed to synch it up to get the iOS 5.1.1 version.  He synched and now can't get back in.  He was entering his passcode on the lock screen (which wasn't taking) and I noted to him that his screen didn't look like mine.  Anyone know how to fix this issue, or does he have to do a full restore?

    He has set up a complex password instead of a simple passcode for his phone. If he doesn't know what it is, he'll have to restore. There is no way around a forgotten passcode.

  • Enqueue: Elem.lock 0 contains unpermitted lock mode . lock object EZBEV_BO

    Hello Guru's,
    we have a unusual problem in the syslog of our ERP System.
    Enqueue: Elem.lock 0 contains unpermitted lock mode . lock object EZBEV_BO
    We can't found any note or forum entry to solve this.
    We checked SAP Notes: 1324099, 891372, 606425, 447242, 1260601 and searched in the forum, but nothing helpful found.
    System Data:
    ERP 6.0 / NW7.01 with EHP4
    SAP Kernel :  701_REL
    created on  :  Jan 18 2010 21:47:07
    Kernel Patch number : 77
    Source ID  :  0.077
    DBSL Patch No. : 075
    Database
    ORACLE 10.2.0.2
    Operating System
    AIX 5.3
    Can someone help?
    regards
    Chris

    developer error

  • HT201303 When I try to open iTunes on my pc it says it is locked or on a locked disc I don't have permission

    When I try to open iTunes on my PC it it's locked or on a locked disc and don't have permission to open

    Hey Itunesilliterate1,
    Thanks for the question. I understand you are experiencing issues launching iTunes for Windows. The following resources may provide a solution:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/TS1717
    iTunes for Windows XP: "Disk is locked" or "iTunes folder cannot be found" when installing or opening iTunes
    http://support.apple.com/kb/HT1866
    Thanks,
    Matt M.

  • I have problem with my iphone 5 lock switch..as lock switch not working properly..and my iphone is not in warrenty.. so plz tell me what i do...

    i have problem with my iphone 5 lock switch..as lock switch not working properly..and my iphone is not in warrenty.. so plz tell me what i do...

    The iPhone 5 is less than a year old, so all of them should still be in warranty unless they have been jailbroken or physically damaged. If you have a hardware problem as you describe the only option is to get the phone replaced by Apple or repaired by a non-authorized shop. The Apple replacement will be free at any Apple store in the country where the phone was purchased. If Apple determines that the phone was physically damaged or jailbroken it will cost $229.

  • How to unlock a locked ipad It is locked and now i can not unlock it, the screen is not responding to my sliding the arrow to unlock. can someone suggest what should i do?

    How to unlock a locked ipad It is locked and now i can not unlock it, the screen is not responding to my sliding the arrow to unlock. can someone suggest what should i do?

    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
    You may have to force iPad/iPod into Recovery Mode
    http://support.apple.com/kb/ht4097

  • Different _scope parameter of Enqueue_ lock object and Dequeue_ lock objec

    Hi, all.
    When we create lock object and generate enqueue_<lock object> and
    dequeue_<lock object>, the default value of _scope is
    enqueue : _scope = 2(update owner only)
    dequeue : _scope = 3(for both dialog owner and update owner).
    Does anyone tell me the reason of this different default values?
    i read help.sap.com - lock related help but i couldn't get the idea
    of these different default values between enqueue and dequeue.
    Best Regards.
    Sejoon

    Hi,
    When you use ENQUEUE, the owner is going to lock that record. So at that time, the only person who can modify the record in the one who has locked it using ENQUEUE. So only he needs to be informed.
    Whereas when you use DEQUEUE, the owner who has locked the record and processed it + the 2nd user who wants to lock it needs to be informed. Hence it is to update the 1st User(who has done the update and planning to release the lock) + 2nd User(who wants to do the update and planning to lock the record ).
    Best regards,
    Prashant

  • Enqueue: Elem.lock 0 contains unpermitted lock mode /. lock object

    Hello All,
    SCM 5.0 system which is upgraded from 4.1:
    System log entries contains:
    <b>Enqueue: Elem.lock 0 contains unpermitted lock mode /. lock object /sapapo/E</b>
    Work process log file contains :
    LOG GE8===>0 /sapapo/E_MATLOC
    I have gone through few notes like  606425, 447242.( lower version)
    From which I came to the conclusion that it is program error.
    Also group GE and No:8 What does it mean?
    Please let  me know your thoughts.Thanks.
    Regards,
    Tushar
    Message was edited by:
            Tushar Chavan
    Message was edited by:
            Tushar Chavan

    Hi,
    I found one more note :
    Note 891372 - Lock entries for TemSe obj remain after completion of proc
    The issue looks pretty similar. I think the notes you found are better suited for sap apo.
    Log a call with SAP and check what they have to say.
    Regards,
    Siddhesh

  • ITunes library is locked or on a locked disk windows 7

    Hi all,
    I recently downloaded some software called Jamcast which allows you to view iTunes / Spotify files on your Xbox360.
    Since then my iTunes has been having problems.
    I have a large number of mp3s on here 110Gb so it's causing me a bit of annoyance.
    I'm getting the error iTunes library is locked or on a locked disk...
    If I hold down shift I can get into iTunes and do the scan for media which brings back all my music but it loses the smart playlists and then when I come out of iTunes and go back into it brings back the same error message again.
    My computer only has two accounts Mark administrator and Guest so I doubt it is a permissions error.
    Also I seem to have far too many folders in my iTunes folder in my Windows 7 library.
    I have
    iTunes
    subfolders
    iTunes Media
    Previous iTunes Libraries
    Mobile Applications
    iTunes Music
    iTunes Plug-ins
    iPod Games
    Album Artworks
    iTunes1
    subfolders
    iTunes Media
    Album Artwork
    and
    Playlists
    Recorded Radio
    License Backup
    iPod
    and my iTunes library fles I have
    iTunes Library.itl
    iTunes Music Library.xml
    itunesPrefs (2).xml
    iTunesPrefs.xml
    sentinel (2)
    iTunes Library.xml
    iTunes LibraryBackup.itl
    iTunes Library Extras (2).itdb
    iTunes Library Genius (2).itdb
    iTunes Library (3).itl
    iTunes Library (2).xml
    iTunes LIbrary (2) Extras.itdb
    iTunes Library (2) Genius.itdb
    iTunes Library (2).itl
    iTunes Library Extras.itdb
    itunes Library Genius.itdb
    sentinel
    A lot of the itl and itdb files seem to have a sort of locked icon on them.
    Please could you let me know what the xml files and itl files do in iTunes thanks.

    Copy the following (bold text) into a new document in Notepad (Don't use Word or Wordpad - they add formatting and it won't work)
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    Save it under "All file types" as "ownit.reg". Save it to your desktop.
    Double Click it and click OK when prompted. You will now be able to take ownership of ANY file on your sytem with just a right click.

  • Table lock ? dictionary row lock? recursive?

    hi guys,
    was looking at dml locks and ddl locks
    for example
    DML changes to table tab
    1) (TX lock for table tab's affected row - stored in the row itself)
    2) (TM lock for table tab - store in V$lock)
    DDL changes to table tab
    1) (DDL lock for table tab -> store in v$lock ?)
    2) (TX lock for dictionary affected row -> locking that row in data dictionary tab to reflect changes)
    3) (TM lock for dictionary tab -> store in V$lock ?)
    (Since i doing a DML to the data dictionary table, am i going to hold another TM lock for that data dictionary table)
    what is a DDL lock exactly?
    1) a lock on the table tab in v$lock
    or
    2) or tx lock on the data dictionary row (which will then incurr a recursive TM lock the data dictionary table)
    or ?
    please advise!

    On behalf of Tanel. :)
    is that TM lock in v$lock view a DDL lock? (tried an alter table command and saw a TM lock appeared)No, TM lock is dml lock as documented. DDL lock(a.k.a, library cache lock) is not exposed via v$lock view. It's exposed only via x$kgllk view.
    so how many locks are actually acquire for e.g when i issue a ALTER TABLE tab xxx ADD col1 NUMBER;You can identify it yourself without big effort.
    alter session set events '10704 trace name context forever, level 10';
    alter table ...;
    alter session set events '10704 trace name context off';==================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    http://dioncho.blogspot.com (japanese)
    ==================================

Maybe you are looking for