This discussion is archived
1 Reply Latest reply: Jun 13, 2013 8:12 AM by spajdy RSS

get the name of my current scheduler job

Guess2 Newbie
Currently Being Moderated

Oracle 11.2.0.3

 

If I am running  package from a scheduler job. How do I get the name of the job that is running me?

 

When I look at sys_context. I see BG_JOB_ID and FG_JOB_ID. I think BG_JOB_ID is for oracle like, SMON, but having a sys_context for that doesnt make sense. Do I use these?

 

Basically, I need to go to DBA_SCHEDULER_JOB_RUN_DETAILS and get the time that my last job ran. I use that in my package. I'd rather not add my own table to store this since it would be redundant. I don't want to hard code the job name, because that is denormalized and the job name could change and I forget to change my package. This would lead to a run time bug.