"Who ran me" - how to determine the name of the dbms_scheduler job that ran me

Hi Community
I can see plenty of examples out on the interweb which shows how you can use dbms_utility.format_call_stack to find the hierarchy of procs, functions and packages that got me to a particular point in my code.
For example, if proc (procedure) A calls proc B, which in turn calls proc C, in the code for proc C, I can query the call stack to find out that proc C was called by proc B which in turn was called by proc A
However, I want to extend this further.
For example, using the example above, if proc A in turn was started by a dbms_scheduler job, I want to determine (within proc C) the name of the dbms_scheduler job which started the whole process off.
The reason I want to do this is that I have inherited a (massive) system which is undocumented. In many places within the code, email alerts are sent out using a custom "MAIL" package to designated users (now including me) when certain long-running processes reach certain milestones and/or complete.
I have added to the custom "MAIL" package a trailer on the mails to show the call stack. I also want to show the name of the dbms_scheduler job which started it all.
Over time, this info may help me in building the "map" of how the whole undocumented system hangs together and in the meantime, to assist in troubleshooting problems
Looking forward to hearing from you
Alan

Use USER_SCHEDULER_RUNNING_JOBS or DBA_SCHEDULER_RUNNING_JOBS there is column SESSION_ID and when you know your session ID build query is very simple.
select owner, job_name
into ...
from dba_scheduler_runnig_jobs
where session_id=sys_context('USERENV','SESSIONID');
You must declare local variables in PL/SQL procedure to read owner and job_name into them. Second thing, you must handle possible exception no_data_found than can be raised when procedure is not run from job.

Similar Messages

  • How to determine InfoCube name within the update rule start routine?

    We are attempting to delete all the records where all key figure values are zeroes. We have about 15% of such records and we really don't need them.
    We have yearly InfoCubes. We copy the InfoCube and update rules at the end of every year. So, we don't want to hard code any field names within the update rules.
    If I could determine the target InfoCube name within the update rule start routine, I can find out all the key figures dynamically. But, I don't see a way of finding out the InfoCube name.
    If you would share any ideas, I would really appreciate.
    Thanks.
    Sudhi Karkada.

    Hi Sudhi,
    I dont know if this is what you are looking for.
    if you want to delete a record from being inserted when all the Key figure values are ZERO then you can use a Update Routine for some characteristic in the below way
    If looking for the InfoCube:
    if COMM_STRUCTURE-KF1 = 0 and COMM_STRUCTURE-KF2 AND....
      RETURNCODE = 4.
    else
      RESULT = COMM_STRUCTURE-ChanracteristicObject.
    endif.
    If it is to an ODS / InfoCube in the start routine.
      DELETE DATAPACKAGE where KF1=0 and kf2=0 and .....
    Hope it helps.
    Regards,
    Praveen.
    ENDLOOP.
    Message was edited by: Praveen

  • Script to find concurrent job that ran long within a time range

    Oracle Apps:12.1.1
    DB:11.1.0.7
    OS:Linux RedHat 86x64
    All,
    Could anyone please share the Script to find concurrent job that ran long in a particular day say between 3pm - 4pm in an hour's time range specifically.
    Thanks for your time!
    Regards,

    try
    SELECT request_id,     
           to_char(actual_start_date, 'dd-MON-yy hh24:mi:ss') begin_dt,
           to_char(actual_completion_date, 'dd-MON-yy hh24:mi:ss') end_dt,
           substr(to_number(((actual_completion_date - actual_start_date) * 24) * 60),
                  1,
                  5) time_in_min,
           program      
      FROM fnd_conc_req_summary_v a
    WHERE (
           actual_start_date >  to_date('30-11-2011 08:00', 'dd-mm-yyyy hh24:mi')
              and
           actual_start_date <  to_date('30-11-2011 08:00', 'dd-mm-yyyy hh24:mi'))
           )

  • For those who have problems RE: My iPhone 4 on connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??

    For those who have problems RE: My iPhone 4 connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??
    SOLUTION:
    Iam pointing t0 windows7 os.
    1) go to control panel
    2) open hardware and sound
    3) In that open Devices and printers
    4)In that u can find Apple Iphone.
    5) now right click on this --> Hardware --> Properties --> General --> Uninstall --> ok.
    6) now unplug and plug in ur iphone again.There u go u iphone name changes to its original name.

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

  • Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    *Ralph Johns* writes:
    "Your options are:
    Get a trial account form @mac which will work as an iChat name after the 60 days run out but not be a email account that is valid (And is free)"
    Do you mean a trial account from .Mac? (DotMac)
    "Get an AIM Screen name and set it to Display what you want as you set it up.
    The Screen name can be whatever yu want but you can also set it to display something else as well."
    I had thought about this, but it seems other people have already chosen the screen name "pinksharkmark" and virtually every variation of it I can think of. So that isn't an option for me. As for getting it to display something else as well, do you mean that if I were to get an AIM screen name like "CromulentCat" I could somehow log in to iChat under the AIM account "CromulentCat" yet get iChat to represent me to my Buddies as "PinkSharkMark"? Because I have to admit I don't see how that can be done. It appears as if iChat displays to anyone chatting with you precisely the account name you logged in under and nothing else. So if you logged in using a .Mac account, then you are displayed as "[email protected]" while if you logged in under an AIM account, you are displayed as "CromulentCat". But that's it that's all... there is no way to change CromulentCat to PinkSharkMark.
    Thanks very much for taking the time to reply, though.

  • How can I capture the name of the person running a SharePoint Designer workflow?

    I have an InfoPath form that requires the signature of several approvers.  To save time the approvers don't actually go into the form to approve.  Instead they get an email that contains data from the form that pertains to them.  They click
    on a link and start the approval workflow which needs to capture who they are in order to display it as the signature in the form.  
    ...so the questions are...
    How do I get a SharePoint Designer to capture the name of the person running it and write it to a column in the Form Library so that the form can capture it?  
    I've been trying to use Modified By, assuming it captures the name of the person who last ran the workflow (modified the item); but this doesn't seem to work.  It captures the name of the person who modified the form before running the workflow, not
    after.  
    Any help would be greatly appreciated.  Thanks for taking the time to read this!!  

      the below links may help you !
    http://claytoncobb.wordpress.com/2009/06/21/userprofileservice-extended/  
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/64fa2f61-0ff0-4076-810d-fdf209efa551/can-the-from-in-workflow-email-be-set-to-the-person-logged-in?forum=sharepointcustomizationlegacy 
    Sivabalan

  • Installed office for mac (trial version). now I got 2 excel files, which cannot be deleted. I googled the names of the sheets and found chinese websites I never visited. Are those dialers? How can I get rid of them? system is mac lion(with win 7 parallel)

    now I got 2 excel files, which cannot be deleted on my desktop. I can't open them, either. I googled the names of the sheets and found chinese websites I never visited. Are those dialers? How can I get rid of them? system is mac lion (with win 7 parallel)

    The people who make that stuff have their own forums you can also search/ask in:
    http://answers.microsoft.com/en-us/mac/forum

  • How can I find out the name of the folder my java program is in?

    Hi, I'm trying to make a little utitlity that makes a bunch of url shortcuts based on the name of the folder I run the java from.
    i.e.
    I have my executable jar in C:/Someplace/My Folder Name/
    I'd like to be able to double click on the jar and it creates the url shortcuts for me using "My Folder Name" as a parameter.
    I've done the shortcuts bit but can't figure out (=find a tut) how to read the folder name.
    Thanks to anyone who can help!

    import java.io.*;
    import java.net.*;
    import java.security.*;
    public class Attempt {
        public static void main(String[] args) throws IOException {
            System.out.println(new Attempt().getFolder());
        public File getFolder() throws IOException {
            ProtectionDomain domain = getClass().getProtectionDomain();
            CodeSource source = domain.getCodeSource();
            URL url = source.getLocation();
            if (!"file".equals(url.getProtocol())){
                throw new IOException("Code source location not a file:" + url);
            String path = url.getPath();
            //remove xxx.jar from path:
            return new File(path.substring(0, path.lastIndexOf('/')));
    }

  • How to set dynamic name of the mail attachment according to source file ?

    Hi,gurus:
    Our scenario is like below:
    Sending files from an FTP server to another FTP server without using the integraiton repositary,and the file name is not changed .Now, we want to also send the file to some with by mail adapter.The scenario  now works by using two business services in receiver determination.But the name of the attachment is "untitled.xml".We know how to set the file name staticly,but how to set the name dynamicly according to the source file name ?
    I have checked miachel's blog "XI: Dynamic name in the mail attachment - pseudo "variable substitution"(/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution),but how can I get the source file name?
    And another question:Must we restart the adapter or j2ee engine to make the user defined module work?

    Hi,
    >>>but how can I get the source file name?
    form dynamicconfiguration (ASMA)
    >>>And another question:Must we restart the adapter or j2ee engine to make the user defined module work?
    no need for a restart
    Regards,
    Michal Krawczyk

  • Determining the name of the jar file running from JAVA

    Hi everyone,
    This is probably a silly question, but how do you determine the name of the jar file running from within the jar file.
    E.g. If I'm running the jar file "Test.jar", then how can I get the String value "Test.jar" from within my program?
    Any help would be appreciated! Thanks:)

    I think that you can use the solution above to get the jar file resources associated with a particular jar file, and then use the JarFile class to get a manifest of whats in there, and then find your class?
    This is only off of the top of my head, and I haven't tested it. Let me know if it works

  • How to find the Name of the BSP Application Being Invoked?

    Hi ,
    Is there any FM or method that would return the name of the BSP Application being invoked?
    Say i have a method A which is being invoked by 2 BSP Application B and C. How do we determine which BSP is invoking the method A?
    Any input on this regard will be of great help.
    Thanks and Regards,
    Pavithra

    Hi,
    this methods are not 100% efective but you may try it:
    On runtime:
    set an external breakpoint in your method A and run your application. When it stops, the debugger has many folders, so press the one marked with "Standard" and in section ABAP stack you see the different call steps that have been executed, including the application that is calling the method.
    For this you must activate the new debugger (Utilities --> settings --> ABAP editor --> Debugging)
    On development time:
    Click on method A and press button Where-used list. In the incomming window press BSP applications.
    Hope it helps.

  • How to retrieve the path and the name of the destination file in a link annotation

    Hi,
    In C++:
    How to retrieve the path and the name of the destination file in a link annotation and a Launch action.
    Sample of my code:
    //Determine if the annotation is a Link annotation
    if (PDAnnotGetSubtype(annot) == ASAtomFromString("Link")) {
    //Determine if the action is a Launch action
    if (PDActionGetSubtype(action) == ASAtomFromString("Launch")) {
    // What is the method ?
    Regards
    David G

    In general, get the annotation as a Cos object and examine it, in
    accordance with the PDF Reference.
    Aandi Inston

  • I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in?

    I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in without closing and reopening?

    No. Frequently the apps take up more storage space on the iPod that the file download size.

  • How can I change the name of the administrator that shows on Home Icon?

    Hello
    I've bought this laptop from a reliable source, went to the Apple Store (Regent St) with the box and they registered it in my name, address and so on. No problems, the mac works fine.
    However, the Home/Icon and administrator is in the name of the old owner. Obviously, he gave me the password. But, I really want to have my name on it.
    I've the box, the discs and all the books. Everything is in really good conditions.
    I read the manuals, the instructions are straight forward but on the net and forum related mac, I can see that are lots of people having problems when they reboot and are unable to login and so on...
    The genius bar at the Apple Store is okay, but the staff main objective is to sell and they are not very patient and neither have much time for you. Normally I end up leaving the store with software that I don't have a clue how to use and the problem unsolved. And it stresses me out.
    Can someone help me please.
    Thank you
    Best regards

    1. Yes, just the Shortname will be changed.
    2. Not easier, but you can do that if you wish.
    since I'm in the official Mac support forum should I expect to receive a reply from a Mac expert staff or it is unlikely to happen?
    Just other Users here like you, trying to help other users. For a real Apple answer I think you have to call AppleCare, but rarely an Apple Host pops in... wouldn't expect it in this case though.
    I do thank you for the info about your software and obviously will make a donation if everything works fine.
    Not mine, but a worhy piece of SW just the same.

  • Existing cross Reference: how to change the name of the file it refers to?

    Hi everybody,
    I am a professional translator.
    One client of mine sent me a complete FrameMaker 9 book file for translation.
    I translated the content via a CAT-Tool and now am in the process of checking if cross references and markers are ok directly into the file.
    I noticed that many cross references are linked to another file of the book. But in the process of translating each file separately, I gave them a slightly different name (I added the language at the end) so as to be able to recognise them eventually.
    Now I have this problem: I cannot find in the cross reference interface where to change the name of the file into the new one the cross reference is supposed to refer to.
    Am I right in wanting to change the file reference? If so, how do I do that?
    Or is it better to avoid this task and rename the translated file into their original names ? Would it work then?
    Thanks for your help.

    ... book file ...
    ...  each file separately, I gave  them a slightly different name (I added the language at the end) ...
    I'm guessing that you renamed the component files by means other than using the Edit > Rename File from the Book menu.
    If so, do over. Rename from the Book menu. It automatically revises all the cross-references in all the component files.
    In a Book, the only thing that's safe to rename with the file manager is the .book file itself.

Maybe you are looking for

  • Header Fields in HTTP Adapter

    Hi, Can anyone please explain meaning of "Header fields in HTTP adapter" ? It has "Name" and "Value" fields in the receiver HTTP channel. If I enter values like: Name                         Value Source                        XYZ Destination        

  • Iphoto library folder question.

    Don't quite know how to word this one but here goes. If i go to Finder and click on the Pictures icon, i see an iPhoto Library icon. If i highlight that then click on the small wheel cog thing drop down menu above it and go to "Open With" i see sever

  • Kb 2842111

    I applied hotfix kb 2842111 for my remote desktop server 2012, but I still get warning {Delayed Write Failed} in Event Viewer and it caused my application to hang. Is there a registry I can tweak to fix this problem or is there a new hotfix from Micr

  • Another user has changed the row with primary key -Table changed externally

    Hello, I am facing the error: "Another user has changed the row with primary key oracle.jbo.Key[94 ]." during the delete operation. User case scenario: 1. Added new row in the table. 2. Once new row is added to the the table, another application will

  • Bootcamp and Windows 7 without a disk.

    My school has the option to download for free either the 64 bit or 32 bit Windows 7 package. I downloaded the 64 but package into 2 parts, along with a product key. Shown in the picture. I must really be dumbd at this. The second file wouldnt let me