Want job to execute at 00 , 30 mins every hour using dbms_job.

Hi All
Oracle 9.2 , Solaris 8
I want to schedule a job every 30 mins using dbms_job. it should run exactly as
12:00 then
12:30
22:00 and so on.
So the interval should be 30 mins , but it should run sharp at beginning of an hour and half past that hour.
Can you provide me the logic for interval.
Thanks in advance

SQL> select sysdate,trunc(sysdate)+ceil((sysdate-trunc(sysdate))*60*24/30)/2/24 from dual;
SYSDATE             TRUNC(SYSDATE)+CEIL
06/12/2010 15:50:16 06/12/2010 16:00:00
SQL> select sysdate,trunc(sysdate)+ceil((sysdate-trunc(sysdate))*60*24/30)/2/24 from dual;
SYSDATE             TRUNC(SYSDATE)+CEIL
06/12/2010 16:07:06 06/12/2010 16:30:00Nicolas.

Similar Messages

  • I have a MBPro mid 2013 with 1 Thunderbolt port. Just bought a Mac monitor and want to daisy chain a PC monitor to it. Use a Mini DVI to VGA adapter from MBP to PC monitor. How do I daisy chain the 2 monitors?

    I have a MBPro mid 2013 with 1 Thunderbolt port. Just bought a Mac monitor and want to daisy chain a PC monitor to it. Use a Mini DVI to VGA adapter from MBP to PC monitor. How do I daisy chain the 2 monitors?

    Hall Palm Desert,
    if your Mac monitor has Thunderbolt ports, and the PC monitor is on the end of the daisy chain, then you might be able to do it by connecting your PC monitor’s VGA cable to a Mini DisplayPort-to-VGA adapter (e.g. Apple, NewerTech), connecting that cable’s Mini DisplayPort end to one of the Mac monitor’s Thunderbolt ports, and then connecting a Thunderbolt cable between the other port on the Mac monitor and your MacBook Pro.

  • Creating a Job to execute a .sh file

    Hi,
    I have an important issue creating a Job to execute a .sh file,
    the .sh (start_execution.sh) contains a lot of random calls like this:
    #!/bin/bash
    . /home/crm/.bash_profile
    . /home/crm/argentina/crm/crmdw/clusters/mt/mt_pull_push/start.sh
    . /home/crm/argentina/crm/crmdw/clusters/ota/ota/start.sh
    sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "MT"
    sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "OTA"
    sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dm.sql "DAILY_DOWNLOADS"then creating the next job
    Begin
    dbms_scheduler.create_job
    (job_name=>'job_AR',
    job_action=>'/home/crm/crmdw/AR/start_execution.sh',
    number_of_arguments=>1,
    job_type=>'executable',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=20',
    enabled=>false,
    auto_drop => TRUE,
    comments=> 'Run shell-script test_dbms_scheduler.sh');
    dbms_scheduler.set_job_argument_value(job_name =>'job_AR', argument_position => 1, argument_value => 'Parameter passed from Oracle to Unix');
    dbms_scheduler.enable('job_AR');
    end;
    /the system executes all process at the same time instead of one to one,
    Is necessary the system executes one to one becouse is a Hierarchy of process with
    corresponding dependencies.
    what could I do to resolve the issue??
    any ideas??
    Thanks in advanced...

    the problem is the content of the .sh file(start_execution.sh) is generated ramdomly and automatically and the code is :
    FUNCTION F_GET_EXECUTION_PLAN
        CONN_STRING_TRG VARCHAR2--'dwa/arg@arg'
      , EXEC_TEMP_DIR VARCHAR2--'/home/crm/crmdw/AR/'
      ) RETURN CLOB AS
      BEGIN
      DECLARE
        v_conn_string_trg VARCHAR2(255);
        v_exec_temp_dir VARCHAR2(255);
        v_select_aux VARCHAR2(32767);
        v_select CLOB := ' ';
        v_process_type VARCHAR2(5);
        v_process_name VARCHAR2(50);
        v_location VARCHAR2(255);
        v_result NUMBER := 0;   
        TYPE t_array IS TABLE OF VARCHAR2(255);
        TYPE t_cursor IS REF CURSOR;
        v_array t_array := t_array();
        c1 t_cursor;   
      BEGIN 
        v_conn_string_trg := CONN_STRING_TRG;
        v_exec_temp_dir := EXEC_TEMP_DIR;
        DBMS_LOB.TRIM(v_select, 0);
        DBMS_LOB.APPEND(v_select, '#!/bin/bash' || chr(13) || chr(10));
        DBMS_LOB.APPEND(v_select, BASH_PROFILE || chr(13) || chr(10));
        DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
        v_select_aux := '
          SELECT A.process_type, b.process_name, b.LOCATION
          FROM
            SELECT process_type, process_id, LEVEL level2
            FROM
              SELECT process_type, process_id, dep_process_type, dep_process_id
              FROM crmdw_master_dependencies
              WHERE dependency_type <> ''PREVIOUS_DATE''
              UNION ALL
              SELECT process_type, process_id, NULL, NULL
              FROM
                SELECT ''STG'' process_type, ID process_id
                FROM crmdw_master_stg
                UNION ALL
                SELECT ''DW'', ID
                FROM crmdw_master_dw
                UNION ALL
                SELECT ''DM'', ID
                FROM crmdw_master_dm
                MINUS
                SELECT d.process_type, d.process_id
                FROM crmdw_master_dependencies d
            START WITH dep_process_type IS NULL
            CONNECT BY PRIOR process_type = dep_process_type
            AND PRIOR process_id = dep_process_id
          ) a
          INNER JOIN
            SELECT 1 ordinal, ''STG'' process_type, s.ID process_id, s.process process_name, c.location, s.active 
            FROM crmdw_master_stg s
            INNER JOIN crmdw_master_clusters c ON (c.id = s.id_cluster)
            UNION ALL
            SELECT 2, ''DW'', ID, process, ''' || v_exec_temp_dir || ''', active
            FROM crmdw_master_dw
            UNION ALL
            SELECT 3, ''DM'', ID, process, ''' || v_exec_temp_dir || ''', active
            FROM crmdw_master_dm
          ) b ON (A.process_type = b.process_type AND A.process_id = b.process_id)
          WHERE b.active = 1
          ORDER BY b.ordinal, a.level2
        BEGIN
          OPEN c1 FOR v_select_aux;
          LOOP
            FETCH c1 INTO v_process_type, v_process_name, v_location;
            EXIT WHEN c1%NOTFOUND;
            v_result := F_CHECK_NEED_TO_EXECUTE (
                            v_process_type
                          , v_process_name
            IF (v_result = 1) THEN        
              IF (v_process_type = 'STG') THEN
                v_select_aux := '. '  || nvl(v_location, '/') || lower(v_process_name) || '/start.sh';
              ELSIF (v_process_type = 'DW') THEN
                v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dw.sql "' || v_process_name || '"';
              ELSIF (v_process_type = 'DM') THEN
                v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dm.sql "' || v_process_name || '"';
              ELSE
                v_select_aux := '';
              END IF;
              IF (v_array.COUNT > 0) THEN
                FOR i IN v_array.FIRST .. v_array.LAST LOOP
                  IF ((v_array.EXISTS(i)) AND (v_array(i) = v_select_aux)) THEN
                      v_array.DELETE(i);
                      EXIT;
                  END IF;
                END LOOP;
              END IF;
              v_array.EXTEND;       
              v_array(v_array.LAST) := v_select_aux;     
            END IF;
          END LOOP;
          CLOSE c1;
          FOR i IN v_array.FIRST .. v_array.LAST LOOP
            IF (v_array.EXISTS(i)) THEN
              DBMS_LOB.APPEND(v_select, v_array(i) || chr(13) || chr(10));
            END IF;
          END LOOP;     
        EXCEPTION
          WHEN OTHERS THEN
            DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
        END;       
        RETURN v_select;
      END;
      END F_GET_EXECUTION_PLAN; 

  • Don't want jobs with a past date to run on Database import

    I can't get a good straight answer from our DBA on how to accomplish what I need. Here is the scenario...
    I have a number of scheduled jobs in our Oracle 9i installation that run each night from 12:00 a.m. on. Over the past few months we have had some infrastructure issues that caused corruption in the Oracle databases and necessitated a restore from backup. Sometimes a full import from a dmp file. My problem is that if the database had been down before and after the scheduled jobs Oracle sees that there is a job that needed to be run in the past but has not yet run. So, when the database is brought back up all of those latent jobs run immediately.
    The problem is that I don't want them to run when the database is recovered and need to control this process manually.
    What is the best way to bring Oracle back up and flag it to not run any jobs that were scheduled in the past?
    Thanks for any help.

    Easy.
    Set job_queue_processes to 0 before doing the import. After the import, delete jobs you don't want (or change their next run date using dbms_job). Then set job_queue_processes back to the value you want.
    The fact that the DBA team considers an export as a backup is probably the reason you couldn't get an answer to this simple question. That is a topic for another thread.

  • Whenever I try to download a new application, my parent's apple id shows up instead of mine which is on my computer. My mom doesn't want to put down her credit card information because I use gift cards. How do I change the ID on my ipod to my apple ID?

    Whenever I try to download a new application, my parent's apple id shows up instead of mine which is on my computer. My mom doesn't want to put down her credit card information because I use gift cards. How do I change the ID on my ipod to my apple ID?

    thank you so much lllaass. im an idiot for not finding that out.

  • My wife and I each have an iPhone and an iPad Mini.  We have separate iTunes accounts.  She just finished reading a book on her iPad Mini.  Now I want to read it on my iPad Mini.  How can I get the book on my iPad Mini?

    My wife and I each have an iPhone 4s and an iPad Mini.  We have separate iTunes accounts.  She just finished reading a book on her iPad Mini.  Now I want to read it on my iPad Mini.  How can I get the book on my iPad Mini?

    Thank you for your reply Domingo.  Your suggestion worked as far as sending me a link to buy the book at iTunes.  But it did not allow me to download the book from my wife's account.  I did finally get an answer from Apple.  It took an entire day of emailing back and forth and the final answer was relatively easy once Apple finally decided to give up the solution.  Basically, you have to open ibooks and sign out.  Then you have to sign into ibooks using the book purchaser's Apple ID and password.  Then you can download the book onto your device.  Not too bad, huh?  It only took a whole day of Apple people sending me wrong instructions before they figured it out.  Geez.  What a disappointing experience.

  • Create A JOB  must execute in every 20 minutes from 8:00 AM to 8:00 PM

    Hi,
    Can any one a write a script to create a job suppose “ERP_CONS_POST_JOB” in a database.
    This job must execute in every 20 minutes from 8:00 AM to 8:00 PM.
    Thanks in advance.Please reply me its urgent.

    bpat wrote:
    Go through the below link
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_job.htm
    http://psoug.org/reference/dbms_job.html
    It will provide a better understanding.
    Look at the INTERVAL procedure.That's not really correct.
    The dbms_job package is the "old" way of scheduling jobs.
    Since 10g the dbms_scheduler package has superceded that and is the preferred option, as well as it offering greater flexibility. dbms_job is only kept for backwards compatibility.

  • Help: do i really want an Apple TV or a Mac Mini?

    Hi,
    I have an iMac and Airport Extreme base station upstairs in the den. Downstairs in the rec room I have a 46" LCD HDTV.
    I'd like three things.
    1. I'd like to rent movies from iTMS (can't in Canada); and buy/rent American TV shows from iTMS (can't in Canada)
    2. I'd like to be able to watch video files in the rec room that are on my iMac. (Currently I burn them to a DVD and watch them on my DIVX-capable DVD player, but the image quality ain't great.)
    3. I'd like to be able to browse the web from my rec room
    Trying to decide if I want an Apple TV or something else (like a Mac Mini). Here's my thinking:
    Apple TV, PROs: awesome interface, HDMI out, can stream video files from my iMac or a hard drive on my Airport Extreme base station.
    Apple TV, CONs: no movie rentals in Canada yet, no American TV shows in iTunes store in Canada yet, have to convert DIVX files to Apple TV compatible format, cannot browse the web with it
    Mac Mini, PROs: can use Front Row to watch video files, can use Safari to browse the web in my rec room
    Mac Mini, CONs: more expensive, no HDTV and 5.1 audio out
    So my questions are:
    Q1. is there any chance that Apple TV will provide me with access to the Safari web browser any time soon?
    Q2. is the video output on a Mac Mini to my 46" LCD good enough; or is it crap compared to the HDMI out on Apple TV?
    Q3. will iTunes store sell America TV shows in Canada soon?
    Q4. will iTunes store rent movies in Canada soon?
    Q5. will Apple TV support DIVX files soon?
    Q6. if I buy an Apple TV will I regret getting the 40Gig version?
    Q7. if I buy an Apple TV will I regret it because there's going to be a new PVR version of Apple TV next year?
    ANY HELP OR OPINIONS ARE GREATLY APPRECIATED! THANKS,
    slegge
    Message was edited by: slegge
    Message was edited by: slegge

    Here are my stabs at answers
    1) Probably not. This can be done but you'd have to hack it which isn't suggested.
    2) It's the same output. The only difference between HDMI and DVI is that HDMI carries audio as well. A mini outputting at 1920*1080 will look as good as an ATV outputting over HDMI.
    3 + 4) Who knows. My guess - unlikely.
    5) Not likely. You'll need to pick up something such as Visual Hub to convert files to ATV format. On the other hand, a mini can play these files already.
    6) That depends on how often your computer is on. In my case I own the 40 and don't mind it a bit - my mac mini is always on so it can stream anything from my mini to my Apple TV over my network. Streaming movies takes about five seconds to get started but after that I've had no trouble.
    7) That's a possibility given that they've submitted patents for an idea such as that - but remember many patents never turn into anything.
    Basically I think the mini vs. Apple TV comes down to $$$ and how badly you want to rent HD movies. A mini (via Front Row) can do anything an Apple TV can do plus a whole lot more (play many more formats, higher resolutions, etc.). The only thing it can't do is rent HD movies. I would have sprung for another mini if I could have afforded it.

  • SSIS package works in development environment but fails when job scheduler executes, file path invalid

    SIS package works in development environment but fails when job scheduler executes, file path invalid
    Relatively simple package to get OLE-DB connection to MS FoxPro 9.0 DB
    The failure in the job log states that the path is invalid its a network path (\\192.168.1.xxx\foldername) this has been run several ways with the remote computer being mapped as a network drive and through the \\ notation described above.
    Thinking it was a security issue between the SQL agent account and my account I tested by subsitution myself as a proxy account for the agent when running this job, again same result failed on network path.
    One issue I see is that the remote computer is running Server 2000 (legacy software incompatable with newer versions) 
    Is it possible that this is a security issue, since if i understand correctly the current MS domain security model didn't exist until Server 2003.

    Hi REIData,
    Have you got the issue resolved? Based on your description, please make sure the target folder is shared properly. If the computer on which the SQL Server Agent job runs doesn’t join the domain as the server that hosts the shared folder, you have to share
    the folder with everyone by adding “Everyone” to the people list on the File Sharing page of the folder and assign "Read/Write" permission to it.
    Regards,
    Mike Yin
    TechNet Community Support

  • Can a dbms_job.run execute a job that execute another dbms_job.run?

    Hi,
    I'm using Oracle9iR2 database.
    I create a package procedure that loop through a list of jobs from user_jobs table and run it using dbms_job.run(jobid).
    Then I schedule this package procedure as a job (say JobA) itself to execute the above procedure every 15 minutes.
    However, it always fail. When I execute JobA manually from sqlplus, I get the folllowing error. Any idea what's wrong?
    SQL> exec dbms_job.run(55805);
    BEGIN dbms_job.run(55805); END;
    ERROR at line 1:
    ORA-12011: execution of 1 jobs failed
    ORA-06512: at "SYS.DBMS_IJOB", line 406
    ORA-06512: at "SYS.DBMS_JOB", line 272
    ORA-06512: at line 1
    Please advise.
    Thank you.
    Message was edited by:
    bchurn

    Hi,
    I am bchurn's colleague who is currently also looking into this problem. The code that we have is similiar to yours except there's a cursor looping through all the failed jobs and executing them.
    I am not sure what is the actual difference but it is actually a job running a procedure instead of through SQL Plus.
    However, we found out that a job cannot run another job. But it seems to be alright with your settings :-/
    What we have is actually a job created for every email to be sent out to our users (jobA). But many a times, the emails were not sent out because of unknown problems (during that time - I think it's the ORA-00600 error).
    The last time we created the second job (jobB) for the purpose of re-executing failed jobA jobs. The errors are that a job cannot execute another job.
    Then, we worked around to change jobB to re-adjust the execution time for all the jobA jobs instead of directly reexecuting them. While some failed jobA jobs are executed successfully because of it, some still remains. We found out that the errors from failed execution of jobA jobs as following:
    ORA-00600: internal error code, arguments: [kgassg_2], [], [], [], [], [], [], []
    ORA-29279: SMTP permanent error: 555 5.5.4 <fieldNameHere> parameter unrecognized
    The second error very seldom. First one most common. The jobs eventually being executed successfully after many re-execution (sometimes about 3 to 4 times, some over 20 or 60 times). Anyone can give suggestions or inputs on the first error? The error log file and its trace files do not give much information on the errors with something like the following:
    Error log file:
    Errors in file /opt/app/oracle/products/920/admin/testapp/bdump/somefilename.trc:
    ORA-00600: internal error code, arguments: [kgassg_2], [], [], [], [], [], [], []
    And when I go and search for the somefilename.trc, it does not exist.
    Any idea on how to solve this or identifying the actual problem?
    Thank you in advance.

  • Trigger a background job after executing tcode MMPV

    Hi All,
    I would like to trigger a background job after executing tcode MMPV. In MMPV, after closing a particular period and entering
    new period, the transaction will be saved. After saving, the background job should be triggered. How to do it?
    Regards,
    Vinod

    Depending what system you are on your best bet would be to create an enhancement point inside a form, that is called after the save has been performed, and raise an event within that form.
    Events can be used to trigger background jobs are maintained in transaction SM62.
    Cheers.

  • Scheduled SAP Job not executed as per restrictions

    Hi All,
    A job was scheduled to execute every Saturday (Job Frequency - weekly). Also in the Start time -  Restrictions, the check box for "Execute only on Workdays" is checked.
    Last saturday 27/08 was a holiday (displayed properly in the factory calendar), So the job should not have got executed.
    But it got executed. I cannot find any reason for this.
    Is there any other conditions that need to be provided so that it don't get executed on non-working days?

    - Check in job definition if the factory calendar of the job is the good one (TBTCO-CALENDARID for the job that executed saturday), check also if job definition was changed  (TBTCO-LASTCHDATE, LASTCHTIME and LASTCHNAME for next scheduled job) (or "Job details" on SM37)
    - Check in the factory calendat, if the holiday was changed after saterday (SCAL, Extras, Display change docs.)
    Regards,
    Raymond

  • Unable to find appropriate driver for my mcbook air using a ricoh aficio mp36501SP network printer.  had similar problem with another ricoh copier/printer, but was able to resolve that problem entering ip address.  this one wants job code

    unable to find appropriate driver for my mcbook air using a ricoh aficio mp36501SP network printer.  had similar problem with another ricoh copier/printer, but was able to resolve that problem entering ip address.  this one wants job code.  i don't believe mac allows for input on job code or printer code for permission to print

    I'm having similar problems with an HP OfficeJet 6500. One suggestion that improved the situation, but did not totally solve the problem, was to select "OfficeJet Pro L7700" for its drivers.
    One other suggestion is to turn off the printer, then simultaneously hold down the "#" and "9" keys and turn the printer back on. This hot key seems to reset the printer to factory defaults, allowing you to set things up anew.
    Finally, kvetch to HP. Their networking software clearly has problems in its relationship to OSX, but nobody on either side seems motivated to bring in a good therapist.

  • When I schedule a Job, the job is executed twice.

    Post Author: sachinddalal
    CA Forum: Data Integration
    Hello,
    I am using Data Integrator Ver 11.0.2.22. I have scheduled the job through Admin Console. When the job is executed it seems that the job is executed twice.
    On the Status tab onDI Administrator, it shows that both the jobs started at same time. The end time of bot the job is different.
    Any one have any idea how this happens?
    Also any way to ensure that the job are not executed twice.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: bhofmans
    CA Forum: Data Integration
    If you get this issue for a scheduled job only, I might be that the schedule is created twice in the OS scheduler. You could check the windows task scheduler (or cron on UNIX) to check for duplicate schedules.
    If you see this issue also for jobs you execute manually (via webadmin or Designer), you can have this kind of problems if the same jobserver is registered multiple times in a repository. You can check the AL_MACHINE_INFO in your repository. It should have one line for each jobserver and one line for each administrator the repo is connected too. I suspect you have some duplicates there (you can just remove them - this table gets populated when adding a repo in the web admin and when adding a repo to a jobserver in the server manager).

  • Windows Vista home addition want let Icloud execute. I went into the DEP program but I can not find the Apple exe file to add as ok. What is the file name?

    Windows Vista home additon want let Iclud execute. I went into the DEP program but I can not find the Apple exe file to add as ok. What is the file name?

    Hey,
    if you know the name(s) of the root folder(s) you want to access (eg. by making a note on the Windows side) then you can make them appear by just doing Shift-Command-G in Finder ("Go to Folder…"), and entering the full path to the required folders.  You can then navigate all the contents as normal.
    HTH,
    S.

Maybe you are looking for

  • A complaint: Apple can't seem to fix rbuffering problems!

    Hi Google the word "rebuffering" and you will get more hits about iTunes than anything else. Somthing's fishy. ITunes is my preferred music player. I use iTunes and when working, listening to internet radio through my PC. It occurs on this computer,

  • XML Structure Conversion using JAVA Mapping

    Hi Experts, I am having a requirement in which i want to convert the contents of source xml structure into a string and map it to the target field. Source Structure: <SRC> <Node1>ABCD</Node> <Node2>XYZ</Node2> <Node3>1234</Node> </SRC> Target Structu

  • EDIT MASK in Script

    Hello, I want to display all dates in my Purchase order Print preview in the same format in which user has set his date (SU3). Purchase Order is using script MEDRUCK to display the data. Please help.

  • IPS Auto Update 5525X

    Hello, I have two IPS ASA5525-IPS "module" of 5525-X Firewall. I set the proxy connection in DNS/Proxy Settings for update the signatures, but, i receive an error above: Auto Update Statistics    lastDirectoryReadAttempt = 11:03:09 GMT-03:00 Wed Jan

  • HP6940 power interupted...now prints lots of boxes across printed page

    HPDeskjet 6940 I've owned 3 of these and love the printer but think I just scrambled the printer's motherboard!? i was printing a 3 page Word document when i accidentally disconnected the cord between the printer and the pc. I immediately reconnected