Ora 20001 error in oracle dbms scheduler

oracleoracle-11g-r2plsqlplsql-developer

i have written a test job like

begin
DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'test_job'
,job_type =>'plsql_block'
,job_action => 'null'
,enabled => true
);
end;
/

after a while when the check the status

select * from user_scheduler_job_run_details where job_name='TEST_JOB';

the status is failed ,i see these two lines

ORA-20001: You are not allowed to logon from this terminal!!!
ORA-06512: at line 39

how can i resolve this error.
and
how to find the job id of a scheduled job(created using dbms_scheduler)

Best Answer

Your question contain 2 items that must have been looked at before question itself arose:

  1. Have you looked at API of DBMS_SCHEDULER (any programmer should do that before knowing how to use built-in [package]) ; another words have you RTFM?
  2. Oracle (most of the time) is in-fact very good with "responses" - error signaling back to "client". Have you googled ora - 20001 ?

To your question:

  • Your job action is NULL; you need to have some procedure that does something AND also is not named as Oracle keyword or PLSQl block that must have at bare minimum begin and end - docs

  • Oracle error 20001 is custom error and if you want to see the code you need to contact DBA's.

  • Based on the message , seems that your schema also missing some grants (you obviously logged in to the database , so message itself is deceiving , but the exact error can only be identified by going thru the code or checking with DBA's directly - see above )
  • why do you need job id? your job name is providing your with information already! check API's!!