How to run a background job with the cloud_scheduler package

Hi,
Is the cloud_scheduler package able to run background jobs as documented? When you try to run a job in another session using:
cloud_scheduler.run_job(job_name=>'MYJOB', use_current_session=>false);
The call fails with:
ORA-20002: Cannot run job MYJOB. Adhoc background execution is disallowed. Please enable the job instead.
If you try to use cloud_scheduler.enable to run the job then the job does not run when scheduled.
Rod West

Hi Rod,
Yes, I believe so. Here's a test case that I just ran successfully from SQL Workshop in my database trial service:
create table myjob_test (aa timestamp with time zone);
begin
    cloud_scheduler.create_job (
        job_name        => 'MYJOB',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'begin insert into myjob_test values (systimestamp); commit; end;',
        repeat_interval => 'freq=minutely; interval=3' );
end;
begin
    cloud_scheduler.enable ( name => 'MYJOB' );
end;
select job_name, state, run_count, failure_count, last_start_date, next_run_date, systimestamp from sys.user_scheduler_jobs;
select * from myjob_test order by aa;Is the next_run_date in the past for your job? If it is, try disabling/enabling the job to "reinitialize" the job's schedule.
-- Vlad

Similar Messages

  • How to run long background jobs in ADF applications

    Hi,
    I'm looking for some guidance on how to run an asynchronous job within an ADF application with proper progress notification in the current page.
    Let's assume we have some long running task (e.g. generating notification emails from a bunch of rows in my view object and send them) with the corresponding classes implemented in the DataModel as part of the business logic (e.g. a class that sends a mail to a given recipient).
    Let's assume all the relevant methods can be exposed in the appmodule's client interface so they can be invoked from the ViewController if needed.
    In my jspx page I have implemented the standard af:poll+af:progressIndicator mechanism to give feedback about the running task, backed by a custom BoundedRangeModel
    with methods getValue() and getMaximum(). This works.
    However, all the examples I've found on the net are very very simplistic and only deal with simple counters or countdowns.
    But how to actually implement the whole mechanism in a real life scenario? How do I run the job itself and make it give feedback to my BoundedRangeModel class
    (which in turn is used by the progressIndicator on the page)?
    Is there a recommended way to do this within ADF apps? I've tried to search something about asynchronous method execution in ADF but there seems to be nothing out there.
    Do I need to use standard Java techniques such as a separate Thread running a Runnable worker? Should I use an observer/observable pattern to notify BoundedRangeModel
    and update its internal variables (current value and maximum)? Would this work across a Datacontrol interface?
    Is anything of this allowed within the ADF framework or I'm just gonna break the whole framework model because do-it-yourself concurrent programming isn't allowed in a multithreaded pooled environment?
    Some explanation about the current recommended best practices and/or some practical examples or articles about that would be great.
    (BTW: I'm using version 11.1.1.2.0 and yes, I've checked the contextual events thing too, but that's just an inter-page communication mechanism so it has has nothing to do with what I need to do.)

    Hi
    I have implement a "Runner" class to generate a pdf to every customer of a mailmerge file, which was uploaded. Its simply easy to do something like this. Just add a button, bound the button with a methode out of you applicationModule and start your implementing Thread in this methode.
    public class Runner implements Runnable {
        private String docFileName;
        private String csvFileName;
        private byte[] csvData;
        private byte[] docData;
        private FtpClient client;
        private String category;
        public Runner(String category, String docFileName, byte[] docData,
                      String csvFileName, byte[] csvData, FtpClient client) {
            this.category = category;
            this.docFileName = docFileName;
            this.docData = docData;
            this.csvFileName = csvFileName;
            this.csvData = csvData;
            this.client = client;
        public void run() {
    }In your applicationModule, you can start your Runner like this:
            Runner runner =
                new Runner(category, docFileName, docData, csvFileName, csvData, client);
            new Thread(runner).start();And to the problem with your progressBar. I would create a managedBean with a HashMap<String, HashMap<String, String>>. Every thread you start, add a HashMap<String, String> to this hashmap with the id of the username/session/whatever (must be bound to the user, which starts the thread). This added HashMap<String, String> should be used by your thread to put some status-information into. Now you can try to bind this info to your progressBar.
    I dont know if this will work, it is just an idea ;-)
    Regards
    Majo

  • How to schedule a background job using the Event concept..?

    Hi Folks,
    I have a requirement that, I need a schedule a background job.
    Once after the previous job successful only, new job should get triggered. How to go ahead with this..?
    For Eg, I am scheduling a job called ZTEST periodically for 1 minute. If the job is not get completing with in 1 minute, I dont want to start my new job. Only after the success of my old job, I want my new job to run.
    Waiting for ur replies.
    Regards,
    Savi.

    Hi,
    You can use events that have already been defined, or you can create new events for scheduling background jobs.
    If you wish to use new events, do the following to implement the event scheduling:
    Define and transport the event as a user event with transaction SM62.
    You must define only event IDs; event arguments are not defined in the R/3 System. Instead, you specify event arguments when you schedule a job to wait for an event and when you trigger the event.
    If you define a new event, you must also transport it to your production systems. The event transaction does not have a connection to the transport system. Instead, you must create a transport request for the event yourself.
    Do this to transport an event:
    Create a transport request.
    Start the editor in the transport request and enter the following:
    R3TR TABU <table name> where table name is BTCSEV for a system event ID, BTCUEV for a user event ID.
    Press F2 with the cursor on the table name to call up the screen for specifying the table entries to transport. In this screen, enter the event ID’s that you have created.
    Save and release the transport request. Ensure that it is imported into your production system(s).
    To trigger an event, add:
    – the function module BP_EVENT_RAISE to your ABAP program, or
    – the program SAPEVT to your external script, batch file, or program.
    When your programs execute these keywords, an event will be triggered in the R/3 background processing system. The event-based scheduler is started immediately. It in turn starts all jobs that were waiting upon the event, subject to normal background processing restrictions, such as the requirement that the job has been released to start.
    Schedule the jobs that are to run when your events are triggered.
    You can schedule jobs for one-time start or to be started whenever an event is triggered.
    Regards,
    Raj.

  • How to run a SQL manually with the same SQL_ID

    I want to know how to run a SQL which comes from application side manually so that same SQL_ID is generated. I am aware that even if there is a small change in the sql(even a space) the sql_id gets changed. CURSOR_SHARING_PARAMETER is similar in my DB.
    Thanks
    Rudresh

    I think you really want is the execution plan (plan_hash_value), what about outlines ?
    HTH
    Antonio NAVARRO

  • How to run webi report automatically with the current date/system date in webi report

    Hi Friends,
    I have a webi report which has a date prompt now. Based on the selection that user makes while running a report, he will get the related data for that particular date selection. Now I want to make that date prompt automated that is the report should run automatically based on the system date daily on scheduling.
    I want it to run current day automatically without have to go in and pick the date in webi report. I will be scheduling the webi report. Can you please let me know how to achieve this functionality of running a webi report automatically with a system date.
    Please let me know if I couldn't make you understand so that I will write with an example.
    Waiting for your valuable solutions.
    Thanks in advance.
    Regards,
    Bhaskar

    Hello Bhasakar,
    1.Create sysdate object in the universe
    2.Create another query in webi and select only sysdate object
    3.In the original query drag the Day object in the filter pane and choose the "List of values" from another query.and select the sysdate object from the second query.
    So your report always will run for sysdate...
    regards,
    Naveen D

  • How to pull the job with the latest effective date in PSFT?

    Hello,
    I am running the PSFT 9.1.1 connector workforcefullsync.
    I ran into a problem when the user has multiple job records. Each time that the user job is updated, a new job record is created. So, when the data comes from PSFT, for a user, we have multiple jobs records with different effective date (For example <EFFDT IsChanged="Y">1996-10-21</EFFDT>). OIM is only interested in the latest EFFDT.
    Question 1: is it something that we can set on the PeopleSoft side, so that only the job with the highest EFFDT is sent to OIM?
    Question 1b: is this is not easy to accomplish from the PSFT side, can I use transformation in the connector to only pull the job record with the highest effective date?
    Question 2: if the EFFDT shows a date in the future (HR wants to disable a person in the future), does OIM ignore this change until the sysdate is after that EFFDT date?
    Thanks
    PS: workforcefullsync worked fine if the file contains only 1 job per employee. When the xml files contain multiple job records, I got the error:
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - oracle.iam.connectors.psft.common.handler.impl.PSFTWorkForceSyncReconMessageHandlerImpl : handleMessage
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - Description : 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - java.lang.ArrayIndexOutOfBoundsException: 1
    Edited by: user12049102 on Mar 22, 2010 12:06 PM

    Hello,
    When the PSFT team sends a message over to OIM to disable a user with today's date, the user got disabled fine in OIM. A reconciliation event is created.
    When the PSFT team sends a message over to OIM to disable a user with a future date for EFFDT, let's say 3/31/2010, no reconciliation event was created.
    Does OIM store this information somewhere so that it will process it later on?
    It's a good thing that OIM does not disable the user who has an EFFDT in the future, but we don't want that record to be forgotten.
    Please help.
    Thanks

  • Running background job with class type "A"

    Hi All,
    Can anyone let me know is it possible to run an background job in R/3 with class type "A" with respect to a specific info package. Thanks.
    Regards,
    Ashok

    I do not think this is possible (ie unless you think of modifying SAP code).

  • How to authorise more than one machine (1 tablet Android and one PC running Windows XP Pro) with the same Adobe ID ?

    How to authorise more than one machine (1 tablet Android and one PC running Windows XP Pro) with the same Adobe ID ?

    Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
    -Windows or Mac does not matter... 2 on the same operating system, or 1 on each

  • How to schedule a background Job based on events

    Hi,
    We are on 4.6 C.
    We have a background job that has two ABAP programs.
    We need to start the 2nd ABAP program only after the first one has run successfully.
    If the second ABAP program does not run, the the job should have a status "FINISHED".
    Help appreciated.
    Thanks
    Mala

    Hi,
    How to schedule a background Job based on events,please refer to the follow SAP help:
    You can use events that have already been defined, or you can create new events for scheduling background jobs.
    If you wish to use new events, do the following to implement the event scheduling:
    Define and transport the event as a user event with transaction SM62.
    You must define only event IDs; event arguments are not defined in the R/3 System. Instead, you specify event arguments when you schedule a job to wait for an event and when you trigger the event.
    If you define a new event, you must also transport it to your production systems. The event transaction does not have a connection to the transport system. Instead, you must create a transport request for the event yourself.
    Do this to transport an event:
    Create a transport request.
    Start the editor in the transport request and enter the following:
    R3TR TABU <table name> where table name is BTCSEV for a system event ID, BTCUEV for a user event ID.
    Press F2 with the cursor on the table name to call up the screen for specifying the table entries to transport. In this screen, enter the event ID’s that you have created.
    Save and release the transport request. Ensure that it is imported into your production system(s).
    To trigger an event, add:
    – the function module BP_EVENT_RAISE to your ABAP program, or
    – the program SAPEVT to your external script, batch file, or program.
    When your programs execute these keywords, an event will be triggered in the R/3 background processing system. The event-based scheduler is started immediately. It in turn starts all jobs that were waiting upon the event, subject to normal background processing restrictions, such as the requirement that the job has been released to start.
    Schedule the jobs that are to run when your events are triggered.
    You can schedule jobs for one-time start or to be started whenever an event is triggered.
    Regards,
    collysun

  • How to Schedule SAP background job at OS Level

    Hi All,
    Can Anyone tell me how to Schedule SAP background job at OS Level (unix).
    Regards,
    Anil

    Hi Anil,
    I donu2019t know your requirements, anyway itu2019s possible to setup your SAP job in order to start after an event, and after that you can get the event triggered from the Operating System in the following way:
    - log into you Operating System with the SIDadm user id (at the Operating System level) and go to directory /usr/sap/SID/SYS/exe/run
    - Run the SAPEVT executable as follows:
    sapevt YOUR_EVENT -t pf=/usr/sap/SID/SYS/profile/DEV_DVEBMGS00_server001 nr=01
    This will raise the event, and cause the job scheduled within SAP to execute.
    You can periodically execute this job with crontab.
    Thanks,
    Federico Biavati

  • Office intergration - run as background job

    Hi,
      I have a word template merged with data using "Desktop Office Integration".
      Currently word template will be opened before data merging is done.
      Is it possible to run as background job, which word template can merge with data in backend? If possible, how should i work on it?
    Kindly advise.
    Thanks,
    Ginnie

    Hi,
      Thanks for your prompt reply.
      Is there any other methods which i can pull my data from table and merge to a word document?
      Or is it possible to generate PDF in this case?
      I need it to be a backend job.
      Any suggestion? Kindly advise.
    thanks,
    ginnie

  • ME05 How to schedule source list job with steps?

    Can someone please give me instructions on how to create source list ME05 in background using "Steps"? I know how to create a background job in ME05 but need to have several jobs run back to back in the middle of the night. I am reluctant to shedule them at different times and would prefer to use the "Steps" function. Thanks for your input!

    Hello
    Steps:
    First create variant for the report in normal execution mode (to provide input selection parameters in backgrpund)
    1. Transaion code SM36
    Give Job name you want created (Give some meaningful name) and Press enter
    2. Give the ABAP program name
    3. Select variant and save the selections
    4. Come back to initial screen , select the Start condition button and provide the interval as per requirement to schedule the job and save.
    5. Save the job.
    Check the Job in SM37 and relase the Job.
    warm regards
    Rama

  • How to schedule a background job in realtime

    Hi,
    Can you tell me how to schedule a background job in realtime.
    give some example scenerios in scheduling the background jobs in realtime.
    Thanks.
    sam.

    And also.....
    There are two ways for you to handle,
    one manually setting up the job through SM36 which is better and convinient,
    secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.
    Find below steps in doing both:
    Procedure 1:
    1. Goto Trans -> SM36
    2. Define a job with the program and variant if any
    3. Click on start condition in application tool bar
    4. In the pop-up window, click on Date/Time
    5. Below you can see a check box "Periodic Job"
    6. Next click on Period Values
    7. Select "Other Period"
    8. Now give '15' for Minutes
    9. Save the job
    Procedure 2 via Program:
    Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
    L_RELEASE(1) TYPE c.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = 'ZTEMP2'
    IMPORTING
    JOBCOUNT = P_JOBCNT
    EXCEPTIONS
    CANT_CREATE_JOB = 1
    INVALID_JOB_DATA = 2
    JOBNAME_MISSING = 3
    OTHERS = 4.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
    TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    WITH DESTINATION = 'HPMISPRT'
    WITH IMMEDIATELY = SPACE
    WITH KEEP_IN_SPOOL = 'X' AND RETURN.
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    JOBCOUNT = P_JOBCNT
    JOBNAME = 'ZTEMP2'
    STRTIMMED = 'X'
    PRDMINS = 15
    IMPORTING
    JOB_WAS_RELEASED = L_RELEASE
    EXCEPTIONS
    CANT_START_IMMEDIATE = 1
    INVALID_STARTDATE = 2
    JOBNAME_MISSING = 3
    JOB_CLOSE_FAILED = 4
    JOB_NOSTEPS = 5
    JOB_NOTEX = 6
    LOCK_FAILED = 7
    INVALID_TARGET = 8
    OTHERS = 9.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Hope the above helps you.
    ***********reward points,if found useful

  • ABAP program to run in Background job

    Hi,
    We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground).  Is it possible to convert it to something that can run thru background job?
    Please help.
    Thanks.

    Hi Deo ,
    Unfortunately cl_gui_frontend_services will not work in background.
    Please have a look at following information about cl_gui_frontend_services :
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
    Regards,
    Nikhil

  • Regarding email attachement while running a background job

    Dear Experts,
    When i am running a background job for any ALV report (standard or custom report) <b>automatically</b> the output is going to an e-mail address as a HTML file attachment. I want to change it to EXCEL file attachment.
    Please help me on this issue..
    Kind Regards,
    Tom

    Hi Prasanna,
    Thank you for your reply.  I am not using any code for sending the mail to the recipient E-mail address, system is taking care automatically.
    Few settings were done in SCOT transaction from basis, but no where they mentioned file type is .HTM.
    From my end i have done the following steps.
    1. go to SM36, give a job name.
    2. press on step push button , give the ABAP program name ( any ALV program, i mean standard report or Z report), give the variant and save.
    3. Come back . press on Spool list recipient push button give the e-mail address, press copy button on the  pop up window.
    4. press on start condition button , press on Immediate option and save.
    5. again press on Save button in the screen.
    now here job will be scheduled immediately, go to SM37 check your job status, if it is completed, automatically system is sending an e-mail with the ".HTM" attachment file output to the recipient e-mail address.
    i am not doing any coding part here.
    my concern is system should send the e-mail with ".XLS" file output attachment.
    please advise on this.
    Regards,
    Tom.

Maybe you are looking for

  • Mini DVI - VGA Issue

    I purchased a Mini DVI-VGA adaptor from Apple over a year ago. I've used it only to connect my Macbook to a projector. Once connected, the screen will flash briefly and then the resolution will change and I will be able to switch back and forth from

  • No idea what to do, please help me

    Hey guys. I have the original white Macbook from 2006. It is running 10.6.8. I'm having a big problem here. There are a lot of things I cannot do because my Macbook tells me that I need to have at least 10.7 Lion. Every time I try to download a newer

  • Java.sql.types and oracletypes

    There appear to be difference in the way the constants are mapped in java.sql.types vs oracletypes(). For example date is '91' in oracletypes and '93' in java.sql.types. The DatabaseMetaData.getColumns() function reports data_type as a java.sql.type.

  • Your current security settings do not allow this file....

    Trying to download the latest version of iTunes and get the message "Your current security settings do not allow this file to be downloaded." I have made no changes at all, previous to attempting to download this update and have never had a download

  • IPhone 6 trade in

    I participated in the iPhone 6 trade in program offering an iPhone 6 for free when you trade in your iPhone 4 or newer. I mailed in my iphone and the appraised value (promotion value) was $200.00 as expected. However, i received an email saying my ph