?
Solved

DBMS_JOB interval....

Posted on 1999-07-14
3
Medium Priority
?
1,111 Views
Last Modified: 2008-01-09
*** DBMS_JOB.SUBMIT(........, SYSDATE, SYDATE+1);

sets the next execution time next day and the time is whenever I'm submitting in SYSDATE.


How do I specify it to run everyday @5:00 AM

Thanks a lot.
0
Comment
Question by:iqbalj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
meowsh earned 100 total points
ID: 1087452
The dbms_output.submit has four clauses (see below)

DBMS_OUTPUT.SUBMIT (jobno_parameter  OUT number,
                    jobprocedure     IN varchar2
                    job_first_run    IN DATE (default is sysdate)
                    job_interval     IN VARCHAR2 (default is null I think)


Hence to set one up for 5 am everyday make the third clause todays date (including time) and set the interval to 1.

I.e use

dbms_job.submit
(
<jobno_return_variable>,
<procedure_name> ,
'14-Jul-99 05:00:00','dd-mon-yy hh24:mi:ss ,
1);

and there you go


Hope this is the sort of info you are looking for


Meowsh
0
 
LVL 4

Expert Comment

by:dda
ID: 1087453
I'm not shure, but try this:

variable jobno number;
alter session set nls_date_language='american';
alter session set nls_date_format='dd.mm.yyyy hh24:mi:ss';
begin
dbms_job.submit(:jobno,
     'dbms_ddl.analyze_object(''table'',
        ''myschema'', ''mytable'',
        ''estimate'', null, 50);',
      to_date(to_char(sysdate,'dd.mm.yyyy') || '05:00', 'dd.mm.yyyy hh24:mi'),
      'to_date(to_char(sysdate+1,''dd.mm.yyyy'') || ''05:00'', ''dd.mm.yyyy hh24:mi'')');
end;
/

0
 

Author Comment

by:iqbalj
ID: 1087454
meowsh,

Thanks for the answer, but you had some syntax error.

See the comment from 'dda'; you need 'to_date' function and
interval 'SYSDATE +1'.

Thanks again.

0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question