In the following use case, as sysdba I am trying to remove the job that belongs to another user – ‘AMS2000’ that results in error – ORA-23421.

As a sysdba, when you try removing job belonging to another user, you will get ORA-23421

SQL> BEGIN DBMS_JOB.remove(4002);
2 END;
3 /
BEGIN DBMS_JOB.remove(4002);
ERROR at line 1:
ORA-23421: job number 4002 is not a job in the job queue
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_IJOB", line 781
ORA-06512: at "SYS.DBMS_JOB", line 180
ORA-06512: at line 1

Using dbms_ijob.remove one can remove job belonging to another schema

SQL> exec dbms_ijob.remove(4002);
PL/SQL procedure successfully completed.