Query to track the holder and waiter info

Hi All,
I have framed the following query to get the blocker and holder info.
I intend to use this query in a auto-generated mail which executes every 15 mins
I have put an outer join on the holder because the holder DML might have completed its execution (v$sqlarea might not have info about this holder DML) at the time the auto mail configuration fires this query
I am not a dba and was apprehensive if there is some mistake in the logic of my query.
I was also expecting to join v$sql_bind_capture using sql_hash_value and sql_address just the way in which I have joined v$sqlarea
Looking forward to your kind help in vetting the below query
Select distinct waiting_session,
dba_waiters.holding_session,
decode(to_char(session_waiting_info.STATE),'0','waiter is currently waiting','-2','duration of last wait by waiter is unknown','-1','waiter waited for a short time',' waiter waited long time') "waiters waiting state",
decode(session_waiting_info.WAIT_TIME,0,'waiter waiting') "waiters last wait time",
decode(to_char(session_holding_info.STATE),'0','holder is currently waiting','-2','duration of last wait by holder is unknown','-1','holder waited for a short time','holder waited long time') "holders waiting state",
decode(session_holding_info.WAIT_TIME,0,'waiter waiting') "holders last wait time",
sql_waiting_info.sql_text "query of the waiter",
sql_holding_info.sql_text "query of the holder",
session_waiting_info.STATUS "waiting STATUS",
session_holding_info.STATUS "holding STATUS",
session_waiting_info.process "waiting process",
session_waiting_info.PROGRAM "waiting PROGRAM",
session_holding_info.process "holding process",
session_holding_info.PROGRAM "holding PROGRAM",
session_waiting_info.ROW_WAIT_OBJ# "waiting object",
session_waiting_info.ROW_WAIT_ROW# "waiting row",
session_holding_info.ROW_WAIT_OBJ# "holding object",
session_holding_info.ROW_WAIT_ROW# "holding row",
session_waiting_info.BLOCKING_SESSION_STATUS "waiting session status",
session_holding_info.BLOCKING_SESSION_STATUS "holding session status",
session_waiting_info.username "holding os username",
session_holding_info.username "waiting os username",
session_waiting_info.MACHINE "waiting MACHINE",
session_waiting_info.TERMINAL "waiting TERMINAL",
session_holding_info.MACHINE "holding MACHINE",
session_holding_info.TERMINAL "holding TERMINAL",
session_waiting_info.TYPE "waiting TYPE",
session_holding_info.TYPE "holding TYPE"
from dba_waiters,
v$session session_holding_info,
v$session session_waiting_info,
v$sqlarea sql_waiting_info,
v$sqlarea sql_holding_info
Where dba_waiters.waiting_Session = session_waiting_info.sid
and dba_waiters.holding_Session = session_holding_info.sid
And session_waiting_info.sql_hash_value = sql_waiting_info.hash_value
And session_waiting_info.sql_address = sql_waiting_info.address
and session_holding_info.sql_hash_value = sql_holding_info.hash_value(+)
And session_holding_info.sql_address = sql_holding_info.address(+)
and dba_waiters.mode_held 'None'
Regards,
Vishal

Hi Jonathan,
I have tried to incorporate your suggestions in the below query. Please let me know about the problems that the below query suffers from
select session_waiting_info.BLOCKING_SESSION,
     waiter.sid waiting_session,
     waiter.SECONDS_IN_WAIT,
     decode(session_holding_info.STATE,'WAITED SHORT TIME','Holder did not wait and is currently '||session_holding_info.STATUS,'WAITING','Holder is also waiting for the past '||session_holding_info.SECONDS_IN_WAIT ||' seconds','WAITED UNKNOWN TIME','Duration of last wait of holder is unknown','WAITED KNOWN TIME','Duration of last wait by the holder is:'||session_holding_info.STATE || ' and is currently '||session_holding_info.STATUS) "State of holder",
     sql_waiter_info.SQL_TEXT,
     bind_values.NAME,
     bind_values.VALUE_STRING,
     session_waiting_info.STATUS "waiting STATUS",
session_waiting_info.username "holding os username",
session_holding_info.username "waiting os username",
session_waiting_info.STATUS "waiting STATUS",
session_waiting_info.process "waiting process",
session_holding_info.process "holding process",
session_waiting_info.PROGRAM "waiting PROGRAM",
session_holding_info.PROGRAM "holding PROGRAM",
session_waiting_info.ROW_WAIT_OBJ# "waiting object",
session_waiting_info.ROW_WAIT_ROW# "waiting row",
session_holding_info.ROW_WAIT_OBJ# "holding object",
session_holding_info.ROW_WAIT_ROW# "holding row",
     session_waiting_info.sql_id,
     session_waiting_info.SQL_CHILD_NUMBER
from V$SESSION_WAIT waiter,
     V$SESSION session_holding_info,
     V$SESSION session_waiting_info,
     V$SQLSTATS sql_waiter_info,
     V$SQL_BIND_CAPTURE bind_values
where waiter.sid = session_waiting_info.sid
and session_waiting_info.BLOCKING_SESSION = session_holding_info.sid
and session_waiting_info.sql_id = sql_waiter_info.sql_id
and session_waiting_info.sql_id = bind_values.sql_id(+)
and session_waiting_info.SQL_CHILD_NUMBER = bind_values.CHILD_NUMBER(+)
and waiter.WAIT_TIME = 0
Regrds,
Vishal

Similar Messages

  • Query to get the blocker and holder info

    Hi All,
    I have framed the following query to get the blocker and holder info.I intend to use this query in a auto-generated mail which executes every 15 mins
    I have put an outer join on the holder because the holder query might have been executed at the time the auto mail configuration fires this query
    I am not a dba and was apprehensive is there is some mistake in the logic of my query. I was also expecting to join v$sql_bind_capture using sql_hash_value and sql_address just the way in which I have joined v$sqlarea
    Looking forward to your kind help in vetting the below query
    Select distinct waiting_session,
    dba_waiters.holding_session,
    decode(to_char(session_waiting_info.STATE),'0','waiter is currently waiting','-2','duration of last wait by waiter is unknown','-1','waiter waited for a short time',' waiter waited long time') "waiters waiting state",
    decode(session_waiting_info.WAIT_TIME,0,'waiter waiting') "waiters last wait time",
    decode(to_char(session_holding_info.STATE),'0','holder is currently waiting','-2','duration of last wait by holder is unknown','-1','holder waited for a short time','holder waited long time') "holders waiting state",
    decode(session_holding_info.WAIT_TIME,0,'waiter waiting') "holders last wait time",
    sql_waiting_info.sql_text "query of the waiter",
    sql_holding_info.sql_text "query of the holder",
    session_waiting_info.STATUS "waiting STATUS",
    session_holding_info.STATUS "holding STATUS",
    session_waiting_info.process "waiting process",
    session_waiting_info.PROGRAM "waiting PROGRAM",
    session_holding_info.process "holding process",
    session_holding_info.PROGRAM "holding PROGRAM",
    session_waiting_info.ROW_WAIT_OBJ# "waiting object",
    session_waiting_info.ROW_WAIT_ROW# "waiting row",
    session_holding_info.ROW_WAIT_OBJ# "holding object",
    session_holding_info.ROW_WAIT_ROW# "holding row",
    session_waiting_info.BLOCKING_SESSION_STATUS "waiting session status",
    session_holding_info.BLOCKING_SESSION_STATUS "holding session status",
    session_waiting_info.username "holding os username",
    session_holding_info.username "waiting os username",
    session_waiting_info.MACHINE "waiting MACHINE",
    session_waiting_info.TERMINAL "waiting TERMINAL",
    session_holding_info.MACHINE "holding MACHINE",
    session_holding_info.TERMINAL "holding TERMINAL",
    session_waiting_info.TYPE "waiting TYPE",
    session_holding_info.TYPE "holding TYPE"
    from dba_waiters,
    v$session session_holding_info,
    v$session session_waiting_info,
    v$sqlarea sql_waiting_info,
    v$sqlarea sql_holding_info
    Where dba_waiters.waiting_Session = session_waiting_info.sid
    and dba_waiters.holding_Session = session_holding_info.sid
    And session_waiting_info.sql_hash_value = sql_waiting_info.hash_value
    And session_waiting_info.sql_address = sql_waiting_info.address
    and session_holding_info.sql_hash_value = sql_holding_info.hash_value(+)
    And session_holding_info.sql_address = sql_holding_info.address(+)
    and dba_waiters.mode_held <> 'None'
    Regards,
    Vishal
    Edited by: user11924113 on Feb 18, 2011 2:39 AM

    Query to track the holder and waiter info
    People who reach this place for a similar problem can use the above link to find their answer
    Regards,
    Vishal

  • When receiving an call waiting can't push the hold and answer button.Because: it will put on hold the first caller, answer to the second, but you can't hear the second until you end the first call !!! Anyone has the same problem ? Did anyone know why ?

    When receiving an call waiting can't push the hold and answer button.Because: it will put on hold the first caller, answer to the second, but you can't hear the second until you end the first call !!! Anyone has the same problem ? Did anyone know why ?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Itunes erased all the album and artist info when reloading library!!!

    My problem is a big one. I've got 8600+ songs (800+ albums) on my hard drive. These are all from physical CDs; I ripped them in wav, then converted them to mp3. When I did this, I kept both the wav AND mp3 files in each respective album folder; about 400G of wav and 80G of mp3.
    OK, so a couple weeks ago I got hit with a virus. It messed up my XP OS to the point where I needed to do a reformat and reinstall. All of my music files are on an external hard drive, so no big deal there. I finish the reinstall, re-download itunes, and tell it where to find my music, and to import it into the library.
    This is where things go horribly wrong. Itunes imports all the mp3 files in as separate folders/albums, just like before, with all the track and artist info intact. However, for some reason, it took all the wav files and dumped them into one giant Unknown Artist/Unknown Album folder. In doing so, it appears to have stripped the artist AND album info from every single one of the 8600+ tracks! I don't know why it did this, as the wav files in the itunes folder all had the exact same track info as the mp3s.
    My question now is: is there any way I can get this info BACK, any program that can look at the individual tracks and figure out what artist and album they go with? Or is there something within itunes that can do it that I haven't found yet? There's no way I can go through and do this track by track; I can't even begin to calculate how long that'd take. My only OTHER option would be to re-rip all the CDs, but again, that took months the first time and I don't want to do it again. However, these files are pretty much useless as they are, in a giant pile that seems only to be organized by the songs' respective track numbers.
    I am screaming HELP in capital letters here. Even if I could find a program or solution that would find MOST of the tracks' info, I'd be happy. I'd also be interested in knowing why itunes did this in the first place, for future reference.
    And just to head off one solution I expect to be offered, no, I did not have the files backed up anywhere else; reimporting an un-reorganized version of the library isn't an option. I had just finished ripping them and hadn't picked up a second hard drive yet. I know, first thing I should have done.
    In any event, any help would be appreciated. Please feel free to email me. Thanks.

    I just remembered some older posts talking about some software from musicbrainz.org.
    It might be able to make some sense out of all those WAV files, if you decide to spend the time on it. Honestly I'd prefer to rip my CDs than go through something like that, because I'm a control freak and would not trust the program to really find the right info....but that's just me. It might be easy to set up and a snap to use, for all I know.
    http://forums.musicbrainz.org/viewtopic.php?id=1730

  • BizTalk Tracking Profile Editor not tracking the data and how to implement the Orchestration as wcf service over SSL

    Hi Ashwinprabhu,
    thank you very much for your answer.
    i have one more query, I have orchestration published as wcf service in IIS and internally orchestration calling one more service , it means orchestration sending a request and getting response back from the service.
    actually we are implementing the copy of that called service through biztalk orchestration for system automatic and tracking failed messages and n/w failures.
    But tracking profiler not tracking the Data.
    And we need to develop the http service as https(Over SSL), we implemented in iis using self 
    signed certificate, it is working just browser for wsdl(in browser), we are not able to test the service in wcf test client, it is giving wsdl error, in wsdl schema reference showing with HTTP only,
    please help me how to resolve the issue.
    Teegala

    First things first, I think it's best to publish only schemas as WCF service for dependency management reasons. That said - WSDL availability is covered in the WCF adapter under the behaviors. If you're using HTTPBasic this may be hard to modify, but using
    WCFCustom allows you to add the WSDL behavior and specify that it should be available via HTTPS.
    As to the BAM, are you using TPE within the orchestration or at the port level?  I'd imagine your TPE tracks the start and end events of your orchestration using the Orchestration Schedule.  If you're fairly confident that the TPE is correct and
    yet don't see BAM data 1) make sure your SQL Agent is running healthy and all jobs look OK and 2) check the TDDS tables in both the message box and the BAMPrimaryImport databases.  These will show you if there has been some sort of sync issue. There's
    even a TDDS errors tables - so check that out.
    Kind Regards,
    -Dan
    If this answers your question, please Mark as Answer

  • My email only shows the "to" and "from" info but not the content of the email. Please help. Thanks

    My email only shows the "to" and "from" info. There is no information at all in the body of my email messages. Please help. Thanks.

    Close the mail app and reboot the iPad.
    Tap the home button once. Then tap the home button twice and the recents tray will appear at the bottom of the screen. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the mail icon. Tap the home button twice.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Ability log and track the time and expense reports of the sales employees

    Hello Experts
    Ability to log and track the time and expense reports of the sales employees.
    Can we do this through WEB UI
    Please revert.
    Regards

    Hello
    Thanks for the reply
    I thought of storing time zone in the time and use session variable to pick up user's log in info along with time zone that he is associated with.
    However, if it has to be maintained by a table, then it should be manually updated right? I don't think that's what I want to do because a lot of our users travel a lot for short time, so they may not have their time zone info updated in the DB table when they are traveling somewhere else for a brief period while accessing OBIEE.
    So my question is, how can I pick up user's locale time zone setting and make sure that the data, such as hour conversation are converted along with the displayed time stamp?
    Thanks

  • My daughter used her friends apple account to login on her ipad and then the mother of her friend thought it was being hacked and consequently tracked the ipad and my daughter lost all her photos.  Can we get these back?

    My daughter used her friends apple account to login on her ipad and then the mother of her friend thought it was being hacked and consequently tracked the ipad and my daughter lost all her photos.  Can we get these back?

    Your iOS device backup only includes data and settings stored on your device. It doesn’t include data already stored in iCloud, for example contacts, calendars, bookmarks, mail messages, notes, shared photo albums, iCloud Photo Library beta, My Photo Stream, and documents you save in iCloud using iOS apps and Mac apps.

  • Adobe crashes on printing - unless I open the file and wait for 10 seconds

    We are having printing issues with Adobe Acrobat X or Xi Standard and or Professional on client PCs running Windows 7 32 Bit OS.
    If we open a PDF file and request a printed copy Adobe crashes. If we open the documnet and wait 10 seconds before printing the document it prints perfectly well and Adobe does not crash.
    What is causing this problem?  I haved tried to uninstall and reinstall Adobe Pro but this does not fix the problem.
    I've tried changing the printer type to direct IP printing but this has not helped.

    Hello youlichika,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that you are not able to power on your desktop, and I would be happy to assist you in this endeavor! 
    In following the document for Troubleshooting Power Supply Issues, were you able to follow steps 3-9? If so, what were the results?
    If you have come to the end of the document, and you still have to drain the power from the computer to power it on, you can find a replacement part (5188-2627) through one of the sites available by following this link.
    I hope this helps!
    Best Regards   
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • I need to raise LC for import PO . Need to track the LC and its maturity da

    Hello ,
    I have this scenario where I need to raise LC for import PO . Need to track the LC and its maturity date .
    How to do this. Please guide .
    Regards
    subbu

    HI,
    I had raised the same issue few days back i got the same reply.From  SD side it can be mapped not
    from MM side.Raise an OSS note to SAP,get their reply and give it to the client.This is the only way out
    murugan

  • My husband and I each have iphones, how can we share the contact and calender info we have have in our iclouds with each other?

    My husband and I each have an iphone 4S, how can we share the contact and calender info we have in our iclouds with each other?

    You can make one or more calendars of one iphone sharable and the other user will be able to have those sharable calanders synced.  Unfortunately, you can't do that with contacts.  But you could go to the computer account used by you or your husband, perform a backup of the contacts (see the file menu), copy the file to the other account used to sync the other iphone, and restore.  It's a manual process that has to be performed periodically, but doable.
    The other method is for each of you to use the same iCloud ID and have both iphones synced to be identical.  But I don't recommend that otherwise you'll each get the same text messages and who knows what else.

  • Query to find the Views and synonyms that are accessing through db_link

    HI all,
    Oracle 10g
    I need a Query to find the Views and synonyms that are accessing through db_link.
    ie.
    database A have the db_link to database B through a schema A
    now i need to find what are the Synonyms and views that are accessing through db_link either directly or indirectly..
    regards,
    Deepak
    Edited by: Deepak_DBA on Dec 10, 2010 5:38 PM

    On the second database (B) use this query to find the SQL which used by the schema A (DB LINK USER). Check the SQL_FULLTEXT column.
    select sql_fulltext,sql_id,module,parsing_schema_name,parsing_user_id,first_load_time,loads,users_executing,rows_processed,plsql_exec_time,sorts,fetches,invalidations,parse_calls,cpu_time,elapsed_time,disk_reads,buffer_gets
    from V$sqlarea
    where parsing_schema_name = 'A' --and to_char(first_load_time,'dd/mm/yyyy') like  '%11/08/2007'
    order by first_load_time desc;
    Regards
    Asif Kabir

  • How can you start up your ipod if holding the hold and home button does not work?

    how can you start up your ipod if holding the hold and home button does not work?

    Remi,
    How long did you hold these buttons for? Did you try more than once?  Have you tried letting it charge for a bit and trying again?
    If nothing else, see this article for more troubleshooting assistance.
    http://support.apple.com/kb/TS2771
    B-rock

  • My credit card was stolen,since i cancelled the card and waiting for a new one i cant update any of my apps because of the billing info is incorrect,how can i update without my new card?

    my credit card was stolen,since i cncelled and waiting for a replacement i cant update any apps or dl any apps because the billing info says its incorrect now,how can i update and dl while waiting for my new card?

    It would be best for you to open iTunes, sign in and view your account. If all the purchases were paid already instead of entering your new card information, it will give you an option for "NONE" as a payment method. Again this is not applicable of you have a pending charges with iTUnes

  • Insert and update query to calculate the opening and closing balance

    create table purchase(productid number(5) ,dateofpurchase date,
    qty number(5));
    create table inventory(invid number(5),productid number(5),
    idate date,openingqty number(5),closingqty number(5));
    Records in inventory:
    1,1,'01-jan-2009', 10, 20
    2,1,'03-jan-2009', 20, 30
    3,1,'04-jan-2009', 40, 50
    when I enter the purchase invoice for 15 qty on 02-jan-2009
    after say '15-jan-09' , a new record should get inserted
    with opening balance = (closing balance before 02-jan-2009)
    and all the opening and closing balance for that product should
    get affected.
    If the invoice for 20 qty is entered for the existing date say
    '03-jan-2009' in inventory , then the closing balance
    for 03-jan-2009 should get updated and all the following records
    should get affected.
    I need the insert for the first one and update query for the
    second one.
    Vinodh

    <strike>You can do this in one statement by using the merge statement</strike>
    Hmm, maybe I spoke too soon.
    Edited by: Boneist on 25-Sep-2009 13:56
    Thinking about it, why do you want to design your system like this?
    Why not simply have your purchases table hold the required information and then either work out the inventory on the fly, or have a job that calls a procedure to add a row for the previous day?
    If you continue with this design, you're opening yourself up to a world of pain - what happens when the data doesn't match the purchases table? Also when is the inventory cut-off to reset the opening/closing balances? Monthly? Annually? Weekly? If it's set to one of those, what happens when the business request the inventory for a particular week?
    Edited by: Boneist on 25-Sep-2009 13:59

Maybe you are looking for