We help IT Professionals succeed at work.

Oracle Scheduler times

Jblue R
Jblue R asked
In Oracle Scheduler  does trunc(sysdate +1) +2/24  mean tomorrow at 2:00 AM?
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
trunc on a date field without additional parameters sets the time portion to zeros.

24 hours in a day.  2/24 is 2AM.

You can see that with:
select 
   to_char(trunc(sysdate +1) +2/24,'MM/DD/YYYY HH24:MI:SS'), 
   to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') 
from dual;

Also, when you mention scheduler, that implies dbms_scheduler.  That doesn't use that type of dates anymore.  Those are reserved for the old dbms_job.

If you aren't using dbms_scheduler, you should be.  It is much easier to control run times.

Author

Commented:
Thank you --
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
No problem.

I was adding to my post when you accepted this, so make sure you see the additional information I posted.

Author

Commented:
Thank you -- Actually, it is a refresh NEXT clause on an Oracle MV..
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
You can always create you own MV scheduler instead of letting Oracle do it for you.

Author

Commented:
Roger -- this was created eons ago, just anted to check the timing of NEXT..  is working fine..

Thank you