Skip to main content
Question

Change user on scheduled task

  • November 3, 2020
  • 5 replies
  • 473 views

Forum|alt.badge.img+14

If a user is deactivated, then scheduled tasks created by this user is also deactivated when the task hits execution time.

Can the ‘scheduled by’ user be changed?

 

5 replies

  • Superhero (Employee)
  • 1487 replies
  • November 3, 2020

If a user is deactivated, then scheduled tasks created by this user is also deactivated when the task hits execution time.

Can the ‘scheduled by’ user be changed?

 

I believe the only two options you have is to either create the schedule again with another user (preferably one that isn’t a real person that might leave) or update the db.

UPDATE batch_schedule_tab
SET username = 'IFSAPP’
WHERE schedule_id = <schedule_id>

You may need to deactivate and reactivate the jobs after update.

 

 


Forum|alt.badge.img+14
  • Author
  • Hero (Partner)
  • 241 replies
  • November 3, 2020

I just copied the tasks. The copy changed the user to the active one and nothing else I believe.

Not a big deal after all.


Forum|alt.badge.img+28
  • Superhero (Customer)
  • 1482 replies
  • November 3, 2020

@Hans Andersen 

Ahhh, you found the answer I was just going to mention, we had to do this quite a bit at the last upgrade, it really isn’t a ton of time.


Harley
Hero (Customer)
Forum|alt.badge.img+9
  • Hero (Customer)
  • 27 replies
  • August 4, 2021

It is interesting that there is a procedure batch_schedule_api.modify_username, but seemingly not possible to invoke from the client.

The following would loop all scheduled tasks for a given user and use the procedure to update Scheduled By to IFSAPP.

begin
for r in (select *
from ifsapp.batch_schedule
where username = '*FROM_USER*'and BATCH_SCHEDULE_TYPE_DB = 'TASK') loop

ifsapp.batch_schedule_api.Modify_Username(schedule_id_ => r.schedule_id,
username_ => 'IFSAPP');
end loop;
end;

 


Forum|alt.badge.img+10
  • Sidekick (Customer)
  • 178 replies
  • October 6, 2022

It is interesting that there is a procedure batch_schedule_api.modify_username, but seemingly not possible to invoke from the client.

The following would loop all scheduled tasks for a given user and use the procedure to update Scheduled By to IFSAPP.

begin
for r in (select *
from ifsapp.batch_schedule
where username = '*FROM_USER*'and BATCH_SCHEDULE_TYPE_DB = 'TASK') loop

ifsapp.batch_schedule_api.Modify_Username(schedule_id_ => r.schedule_id,
username_ => 'IFSAPP');
end loop;
end;

 

Ran this in SQl Developer and purred like a kitten.

 

As I’m leaving for pastures new - I’ve had to change over a number of tasks that I lazily created in my name.

 

I could have just left them - but that would have been cruel.