Blocking locks for how long ?

Oracle 10.2.0.3 on solaris :
I have the following select statement that get me the blocked sessions with the blocker info and blockee info :
select s1.username || '@' || s1.machine || ' ( SID=' || s1.sid || ' ) is blocking '
|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
from v$lock l1, v$session s1, v$lock l2, v$session s2 where s1.sid=l1.sid and s2.sid=l2.sid
and l1.BLOCK=1 and l2.request > 0 and l1.id1 = l2.id1 and l2.id2 = l2.id2 ;
How do I modify this SELECT statement to give me one more thing -- the amount of time the blockee has waited so far for the blocker to release the lock ?
Thanks

Sorry,,,I made my above comment without testing one more scenario(which obviously didn't work)
The GV$ views works in a scenario where, the blockee and blocker are on the same instance. For example, if both are on DATABASE02, The query with GV$ views works from DATABASE03(or DATABASE01) as well !!!
BUT, if the same object is being locked- and the blocker is on the DATABASE02 instance whereas the blockee is on DATABASE03 instance, my query does not fetch any rows.
My query is :
select s1.username ||
'@' ||
s1.machine ||
' ( SID=' ||
s1.sid ||
' SERIAL#=' ||
s1.serial# ||
' ) is blocking '||
s2.username || '@' || s2.machine ||
' ( SID=' ||
s2.sid ||
' SERIAL#=' ||
s2.serial# ||
') for the last '||
sw.seconds_in_wait ||
' seconds.'
AS blocking_status,
dbo.object_name ||
' is the object locked'
AS blocked_object
from gv$lock l1, gv$session s1, gv$lock l2, gv$session s2, gv$session_wait sw , dba_objects dbo, gv$locked_object lo
where s1.sid=l1.sid
and s2.sid=l2.sid
and l1.BLOCK=1 and l2.request > 0
and l1.id1 = l2.id1
and l2.id2 = l2.id2 and
sw.sid = l2.sid and
lo.session_id = s1.sid and
lo.object_id = dbo.object_id and
l1.sid = lo.session_id ;
Am I missing something here, or can the above query tweaked to return me the result ?
My test scenario is :
On instance DATABASE02(database is DATABASE00) - The blocker
create table tstlock (foo varchar2(1), bar varchar2(1));
insert into tstlock values (1,'a');
insert into tstlock values (2, 'b');
commit ;
select * from tstlock for update ;
On instance DATABASE03(database is DATABASE00) - The blockee
update tstlock set bar='a' where bar='a' ;
The expected result is :
USER1@COMPANY\MACHINE1 ( SID=163 SERIAL#=11766 ) is blocking USER2@COMPANY\MACHINE2 ( SID=164 SERIAL#=1570) for the last 61 seconds.
Thanks

Similar Messages

  • How long does the i tunes account lock for, how long does the i tunes account lock for

    Howlon does it take because i entered the wrong security questions

    As I wrote Apple will diagnose an Apple product even if it is out of warranty for free. That should be your first step to find out if the problem is the battery or something else.
    Once you have Apple telling you a 7 month old battery is defective (if that turns out to be the case)  then it becomes a game of horse trading. You'll need to speak to the tech and when he tells you there is nothing he can do you will need to speak to the tech manager and when she says most likely there is nothing they can do you go to the store manager, etc.  It is unlikely (though possible) that they will give in easily you need to be firm, polite and let on that you're willing to accept a partial reimbursement.
    So again the first step is to find out what is wrong.
    good luck

  • My Iphone 3g will not unlock if its been locked for too long

    just as the title says and all these issues too....
    Whenever my phone is locked for too long it will not respond to any button presses. the only way i can get it out of that is if i hard reboot it but happens again afterwards. the only way to keep it from not acting like that is to keep it plugged in constantly.  also if i try to shut it off normally it will power on by itself right after its shut off.  ive tried to do a full restore in recovery mode and that didnt even solve the problem.  any ideas?

    Anyone? C'mom, I know some of you techie type folks know how to fix this!

  • Can i put an unavailable message as a response to text messages so people who are texting me will know that I am unavailable and for how long?

    I'm going to be out of the country for a few weeks.  I have an iPhone 4s.  Can I put an unavailable message as a response to text messages so people who are texting me will know that I am unavailable and for how long?

    No. Sorry. Check with your carrier. Perhaps they offer such a service.

  • Is there a time limit for how long a free form can be used/accessed?

    Is there a time limit for how long a free form that is created can be used/accessed, or is it soely dependent upon when the 50 respondent max has been reached?  I am creating a form now, that will likely be distributed in early January, and I want it to be accessible through the end of June, 2013.  (I am simply using the option to create a single form for free- not the 30-day trial). 

    There is no time limit. The limit is the 50 responses.

  • What and for how long additional OR separate benefits I receive after buying Apple Care?

    I bought a MBA 13" in India (home) last month.
    I wanted to know about Apple Care / Extended warranty that is available for sth like ~15K (INR).
    Can you please give me a detail as in what do I get with this for my Mac and for how long?
    Can I buy this before the day my current/default warranty expires or shall I have to buy this within some stipulated period from the day of purchase of my Mac?
    What is already available for my Mac as of now and for how long? Shall anything be added to warranty or care that is available with my Mac as of now? Shall be added right from the day I buy it or it will happen so after my current warranty/care gets used up i.e. after completion or 1 year or for whatever period MBAs comes with care/warranty. So, these extended warranty simply increases the number of years on my protection plan or gives additional cookies?
    If I buy an iPhone5 then shall I have to purchase separate apple care for that? Or is it available for all my Apple products? Or if not then are there such plans that I can buy to cover all or many of my apple products and are cheaper as a combined purchase?
    Within that period if let's say my Keypad fails screen goes kaput then Apple will either fix it/replace it or it will ask for extra money if it needs replacement? Or will ask for extra money even if it was not accidental damage (my fault)? I read sth about accidental damage with AppleCare purchase - it adds to the first year also or only during the next two years (or next 3 years - not sure how long it holds).
    Shall I have to buy it offline or i can buy it online too? What if I buy from another country (online/offline) if it's available for cheap over there?
    I see some deals on such packages on eBay - mostly on USA eBay, and have read posts people buying it but they were mostly from USA/EU. Can I buy one of those? Shall they be valid for my product(s)?
    By the way, does Apple provide an email support with those plans because I couldn't find one email address for Apple support.

    http://www.apple.com/support/products/faqs.html

  • What SQL Server Agent jobs are currently running and for how long

    Is there a way to tell what SQL Server Agent jobs are currently running and for how long?  View history isn't working in my case because it's only showing completed jobs.  John Schroeder

     You can use the "Job Activity Monitor" for doing this.  Do the following steps. It will open up the Job Activity Monitor.
    1.    In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    2.    Expand SQL Server Agent.
    3.    Right-click Job Activity Monitor and click View Job Activity.
    4.    In the Job Activity Monitor, you can view details about each job that is defined for this server.
    In Job Activity Monitor page, we have column called Status. It will indicate whether job is executing or idle. Last Run column will give you the last invocation time of this job.
    Use the following link for further reference.
    http://msdn.microsoft.com/en-us/library/ms187449.aspx
    Thanks,
    Sateesh.
    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

  • My phone number will exist for how long?

    Dear,
    Excuse my bad English!
    I want buy one us number. But I need to know?
    My phone number will exist for how long? If I stop the service for some time and then reused. I can not take back my old number? Or minimal cost to maintain my phone number is how much?
    Thanks

    Thank you Great community

  • HT1657 For how long can i keep a rental movie?

    For how long can you keep a rental movies ?

    Thirty days from the day of purchase, or 24/48 hours from the time you start playing it, whichever comes first.
    (73214)

  • For how long the library Cache latch is hold.

    Hi ,
    For how long the library Cache latch is hold.
    Is it hold , till the new sql is placed in the library cache
    or
    Till it got parsed
    or
    Till it got executed?
    Thanks
    Naveen.

    Hi ,
    For how long the library Cache latch is hold.
    Is it hold , till the new sql is placed in the library cache
    or
    Till it got parsed
    or
    Till it got executed?
    Thanks
    Naveen.

  • Sandbox is down during this week, why and for how long?

    I'm trying to test if the IAPs are working correctly on the project I'm working on, as I kept receiving from Xcode an error which says "cannot connect to the itunes store" and error code 2 I did some research and it looks like sandbox is down according to this link http://www.websitedown.info/sandbox.itunes.apple.com .
    Does anyone know why is down and for how long? Any other way to test IAPs in case sandbox is down?
    thanks.

    We are also unable to test IAP. The error is "Cannot connect to iTunes Store". Plus, it sometimes offers to sign in to already signed out account, instead to confirm password for currently signed in account. We have tested previosly working IAP code, and it reports the error now as well.

  • Minimum Voltage for how long?

    Minimum Voltage for how long b/4 it f's something up?
    I just found that my V-core is only 1.28v. And it has to be due to the 12 volt only being 12A I hadn't noticed that this was bad until I ran Sandra. I can't get it over that mark even by cranking it up in the bios. What should the amps be? I know I have read all the best power supplies posts but I gather that the 12v is for the processor so that should be the highest. But any damage at my current voltage? I have been running it for a week.

    did you plug in both mobo plugs. the small 4 pin is also a 12v supply.
    if the psu had two main leads you spread out the load on both leads to your drives fans etc.
    look on the back of you psu(or top there should be a sticker with max loads etc what does that say, while your at it, check to make sure red 115V/220V swithch is is right spot ie..115 vfor us
    the 12A was on label? under what? input current
    I have a compusa 600W precision power, which i am sure is a cheapo unit
    but it has 30A +5v..25A+3.3v..28A..+12v...6A-12v...6A -12v..2A+5vsb
    +3,+5+12 max combined load is 570W input current 11A for 115v
    12a is way low I think the cpu is @9amps by its self.
    you have 3 hd and 2 dvd/cd's
    ...I would run to the store and get a new psu pronto.
    I have read underpowering can damage also, but not as bad as overpowering.
    But broke is broke

  • For how long ASA with AIP 20 keeps events?

    I have ASA5520 with AIP SSM 20 and I am using IPS Manager Express. For how long can AIP keep IPS events? How can I save events before the logs are recycled?
    Thanks in advance

    Have a look at the following post:
    http://forums.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Security&topic=Intrusion%20Prevention%20Systems/IDS&topicID=.ee6e1fc&fromOutline=&CommCmd=MB%3Fcmd%3Ddisplay_location%26location%3D.1dde8f9b
    Please rate helpful posts.
    Also please note that IME has its own database (on the PC where its installed).
    Regards
    Farrukh

  • HT201472 for how long my iphone can be on lost mode ??

    for how long my iphone can be on lost mode ??

    Welcome to the Apple Community.
    Unitil you stop it.

  • Does my new mac pro retina come with antivirus. And, for how long

    does my new mac pro retina come with antivirus? And, for how long?

    Yes it does.
    It's called OS X Lion - fully updated.
    There are no known viruses for MAC OS.
    Your current OS is your best protection
    If however, you want to feel more secured, download ClamX AV and do a scan once a week to give you peace of mind.
    Good luck

Maybe you are looking for

  • My handycam SONY DCRSR47 is no longer compatible with iMovie08???

    Incredibly frustrated with SONY right now and with Best Buy for selling me something that is so incompatible with my computer. PLEASE - if anyone has a solution besides buying another camera, please let me know how i can get this footage onto my lapt

  • Problems with PL/SQL Calling Java Function that returns String []

    Hi, I have written the following code. It's not compiling OK. DECLARE TYPE Tokens_Type IS VARYING ARRAY(20) OF VARCHAR2(20); s1 Tokens_Type DEFAULT NULL; SQL_STR VARCHAR2(2000) DEFAULT NULL; BEGIN SQL_STR := 'CREATE OR REPLACE FUNCTION Schema1.SPLIT_

  • Why is my hard drive clicking?

    i have a parrallels desktop installed on my mac. every time im using parallels theres a clicking noise coming from my hard drive. Why???

  • Are there any Apps compatible with Aventail VPN?

    My corporate network uses Aventail VPN. I know the Macs are able to access my desktop, but so far I have not seen an iPhone App which does as well and my IS department is not very pro-Apple, or helpful. Are any of the VPN apps for the iPhone compatib

  • Administrator desing star schema for "time series analysis"

    Hi all, I need to develop a set of dashboard with reports display a set of customers properties at the last etl period (this month) and, for these customers, show their properties in the "past" (this month - "n"). I've a fact table with cust_id and t