Which query is the job running ?

Dear all,
Normally when you want to see the currently running query by a session, you can just query the V$Session table and get the SQL_ID of a particular session. Then use SQL_ID to query V$SQL.
However when a PL/SQL procedure is submitted via a job. You can see in the V$Session that the job runs as a dedicated server session and the SQL_ID is always null. Although I do see always that the session waits for "DB sequential file read". So it means that some query might be getting executed.
How can I see which query is being run by the job (dedicated server session)?
Version : 10.1.0.5
Thanks in advance

You can try :-
SELECT sql_id,sql_text FROM v$open_cursor WHERE sid = :1
http://www.ContractOracle.com

Similar Messages

  • T code to check the job run status

    Hi Gurus,
    I am filling the setup tables for inventory, but i didn't run in background. I clicked on execute button, but suddenly i got disconnected from net and my server also.
    Now i have to check the job run status whether it is running or not.
    Request you to provide the suggessions.
    Thanks & Regards,
    Saketh

    Hi,
    if you ran job in background you can see at SM37.use proper time ,date and use id to get your job.
    if you ran on frond end then you won't see job.if your job was completed then you can see data at SE11 by using setup table name or you can see at t code NPRT by using name of the run.
    if you won't find your job then just delete your setup tables again and fill it.
    No issues.
    Thanks

  • Ho do i check bcz of which query's the dead locks happend in 11g

    Hi,
    I am working on 11g database and recently dead locks happend and it's released it's fine. But i need to know becz of which query's the dead locks happend and who fired those query's.
    i hope we can get these info from trace file i opend trace file but am fully confusing how do i know all these details. Can any one help me on this...
    Thanks in advance
    Regards

    Check
    How to find where is deadlock?

  • I have a Mac Pro Mid2009,do i need a antivirus installed?.Never had a trouble till now though!,but just to get things clariffied.If got to install,which is one recommended and preferably a freeware which can do the job.

    Hello,
    I have a MacBook Pro mid 2009 version.Have got no Antivirus installed so far all these years and its been fine till this moment.
    Just to satisfy my curiosity,would i require to install one,to be on the safe side or doing so would that slow do my system,like browsing and my operations?.
    Please advice if it's preferred to have a antivirus installed and if so which one would the experts recommend,preferably a freeware if that could do the required job.
    Would appreciate any sincere advice on this topic,
    Cheers!.
    Aishsri

    Firstly thank you so much for your reply.
    As stated in my query earlier,i do not have or feel any specific issue is ongoing right now with my Mac pro,but at times i feel a sort of slowness in my Firefox browser opening up and at various times,have the beach ball popping up after a command is given and takes a while to set in.
    All these sometimes make me think,if i am getting into trouble,and hence thought should i install a Antivirus?.
    Ok,is there anyway i can check if my Mac pro is free of any Viruses or Malware or any sort of these things?.
    Would appreciate your reply.
    Thanks

  • Exit or badi for tcode F110, which called during the payment run.

    Hi All,
    We have a requirement to create a txt file in the application folder, while doing the payment run.
    right we are copying the standard program RFFOEDI1, but we dont know in which part of code , we can find the values from REGUP and REGUH tables, so that we can code based that.
    so if someone can get the exit name for this purpose or where to find the REGUP values, it will be great.
    Regards,
    Shobana.K

    In program RFFOEDI1 subroutine EDI has logic of creating edi messages.
    If you are replacing edi functionality with custom file creation then replace call to this form with you own form.
    Program use logical database and FIELD-GROUPS to retreive and process data. I would recommend get familarise youself with FIELD-GROUPS.

  • How to pick which node a dbms_scheduler job runs on

    I saw a stickiness attribute that will pick the least used node. I want to pick my RAC node. is there a way to do this?

    Do you mean you want to specify the instance where your job runs on? and not let Oracle manage this based on the load?
    You can do this using database services. Define a database service as prefered on one instance and available on another instance. create your job class for the service. This way if the instance was to fail for some reason, the database service will automatically start on the other instance and the job will point to the new instance.

  • Which query is faster to run

    I want to use Oracle locator to find customers in a specified area. Which of the ideas on this page is a faster query? The idea where you add the SDO_Geometry column with long and lat to each address record or the index based function idea where no column needs to be added but a table with long and lats is used? thanks.

    user8602786 wrote:
    I want to use Oracle locator to find customers in a specified area. Which of the ideas on this page is a faster query? The idea where you add the SDO_Geometry column with long and lat to each address record or the index based function idea where no column needs to be added but a table with long and lats is used? thanks.Why don't you try them both out and let us know?

  • I want to find out which user cancelled the Job

    I m looking at job log in SM37 but no matter how much I searched, I could not find the user id of the user who cancelled that job. Is there some way I can find out who did it? Will give points for the rights answer. Thanks for reading.

    use the FM's
    BAPI_XBP_JOBLIST_STATUS_GET
    BP_JOB_SELECT
    Message was edited by:
            Eswar Kanakanti

  • How to get the list of batch jobs running in a specific application server

    Hi Team,
    I am trying to check in SM37 if there is any specific condition to get the list of batch jobs assigned to a specific target server but cant find any.
    Is there is way to find the list of batch jobs assigned to run in one specific application server.( Target server specified in SM36 while job creation)

    Hello,
    This is what you can do in SM37.
    Execute the list of batch jobs, when the result appears on the screen edit the ALV grid via CTRL+F7.
    Now add the following columns "TargetServ" and "Executing server".
    You will now have two extra columns in your result list.
    TargetServr contains the value of the application server where the job should run when you have explicitely filled it in.
    Often this is empty, this means that at runtime SAP will determine itself on which application server the job will run (depending of course where the BGD processes are defined).
    Executing server is filled in always for all executed jobs, this is the actual application server where the job has run.
    You can also add these two fields in your initial selection screen of SM37 by using the "Extended job selection" button.
    I hope this isusefull.
    Wim

  • Running the jobs sequentially instead of parallel

    Hi All,
    My script runs multiple jobs by iterating in a loop one by one. They are getting executed in parallel where as i want them to run sequentially one only after another has finished execution. For ensuring this i have added this logic in my code:
    [Code for Job name reading, parameters setting goes here]
    jcsSession.persist();
    while (((infoJob.getStatus().toString().matches("Scheduled")) || (infoJob.getStatus().toString().matches("Running"))) {
      jcsOut.println("infojob still running"+infoJob.getStatus().toString());
    This should run after each job's persist statement.
    Ideally the loop should end as soon as the job attains 'Error' or 'Completed' state i.e. the job ends but when i am running the script
    this while loop is running infinitely thus causing an infinite loop.
    Because of which the first job ends but the script does not move forward to next job.
    Please help me what i am doing wrong here or if there is any other way to make the jobs run sequentially through Redwood.
    Thanks,
    Archana

    Hi Archana,
    How about jcsSession.waitForJob(infoJob);
    Regards,
    HP

  • Prevent Jobs Running Twice at the same time

    Hi all, I would like to know if they are any ways to prevent a release job to run twice at the same time. For exemple, if  I create a job to run every 5 minutes and the job did not finish after 5 minutes, the scheduler will start the same job agains.  This situation causing us bad issues.
    I double check the job start conditions in sm37 but I found nothing special.
    Thanks for help

    Hi Marc,
    We use a workaround. We have asked our abap developpers to write a small utility report which checks if the job it is part of is already running and aborts the job if it is the case.
    When we need a job which must absolutely run only once at the same time, we just add this utility as first step.
    Regards,
    Olivier

  • Error is thrown ONLY when the job is run doe delivery creation

    Dear SDNres,
    I am facing a tricky issue.
    I have a job that creates Sales order , Delivery, Billing.
    When the sales order contains line items <=8 then the job runs fine and creates delivery successfully
    When the sales order contains line items more than 8, then the job fails on delivery creation and the BDC captures error "customised error''
    Doubt:
    steps in manual creation:
    1)I create a Sales order with line items > 8
    2)then i create delivery manually .
    After the above 2 steps i dont get the error at all in case of manual creation
    But the same steps when the job does for a Sales order with line items >8 then the error comes and job fails.
    Kindly suggest me as to where i need to look for the error.
    Regards,
    SuryaD.

    Thanks for your response Dave.
    Yes i am doing a BDC Call Transaction.
    there is no BAPI.
    Trickier part is when i execute the job through debugging then i do not get the error.
    What could be the reason for this error.
    Is it some error in teh coding?
    regards,
    SuryaD.

  • Which upgrade will do the job?

    I need to rotate the videos I have taken with my camera by 90%. I have been advised to upgrade to Elements 8.0.  But there are 3 versions..please advise which will do the job I want done?

    If you use a windows PC you could try the bundled program Windows Movie Maker.
    If you intend to purchase software I suggest you go for a free trial to make sure it meets your needs.
    Adobe Premier Elements is the movie software and the sister package to Photoshop Elements. You can download a free trial version.
    The problem of frame rotation is discussed at Elements Village and you should find the following thread of interest.
    http://www.elementsvillage.com/forums/showthread.php?t=52298

  • Check The Job Status

    Hi SAPsimhas,
    My requirement is as below.
    I will loop through an internal table and create some files with background processing method.(JOB_OPEN,SUBMIT & JOB_CLOSE)
    Now once this job is triggered I need to check the status for that job after maximum 10 mins. Its not neccessary that each job will take 10 mins. only,It can be finished in 2 mins also.
    Once the job is finished then I will XCOM that file.
    So my question is how to code such timer which will check the job status for that job? I have a FM BP_JOB_READ which returns the job status.
    Reply is highly appriciated.

    Try this way
      do.
        call function 'SHOW_JOBSTATE'
          exporting
            jobcount         = p_jobc
            jobname          = p_jobn
          importing
            aborted          = v_aborted
            finished         = v_finished
            ready            = v_ready
            running          = v_running
            scheduled        = v_scheduled
          exceptions
            jobcount_missing = 1
            jobname_missing  = 2
            job_notex        = 3
            others           = 4.
        if v_aborted eq 'X'.
          exit.
        endif.
        if v_finished eq 'X'.
          select single * from tbtcp into wa_tbtcp1
                     where jobname eq p_jobn
                       and jobcount eq p_jobc.
          if sy-subrc eq 0.
            move wa_tbtcp1-listident to p_spono.
          endif.
          exit.
        endif.
        if v_count le 10.
          call function 'ENQUE_SLEEP'
            exporting
              seconds = 60.
          v_count = v_count + 1.
        endif.
      enddo.

  • How to make a job run on a appointed node

    I have a problem. The database is Oracle 10g, RAC, two nodes
    There are some job which run on everyday night. Now, something happened, the job run on Node A can't work as normal, but if run on node B, It will work well.
    so I just want to submit the jobs on Node B, I submited the jobs on Node B, but the jobs always run on Node A.
    I want to know how to make a job run on a appointed node.

    the Job just transfer some procedure to add partitions for some table, to merge the records from some tables to one table and so on.
    the problem is when the job run on Node A, it is very very slow, the procedure would run hours and not success end, but if on Node B it will successfully end in seconds.
    restart the Node A would be a way for the problem, but may it will leave a hidden trouble. I want save the scene to find out the problem
    so can you help me

Maybe you are looking for