开发者

oracle identifier 'ctx_ddl' must be declared - adding a dbms_job

I've added an index to my table with the command:

CREATE INDEX patient_index ON radiology_record(patient_name) INDEXTYPE IS CTXSYS.CONTEXT;

And I'm trying to add a DBMS_JOB which will keep it up to date.

The way I've been running this script is by calling "@myscript.sql" from SQLPLUS

set serveroutput on 
declare
   job number; 
begin
   dbms_job.submit(job, 'ctx_ddl.sync_index(''patient_index'');',
                  interval=>'SYSDATE+1/1440');   
   commit;
   dbms_output.put_line('job '||job||'has been submitted.'); 
 end;
 /

The resulting error is PLS-00201: identifier 'CTX_DDL' must be declared

Through my searching I've found someone with a similar problem and his solution was

I spent enough time debugging this that I thought it merited sharing what i learned. It turns out that dbms_jobs only inherit your schema user's default privileges, not any privileges it might inherit from roles granted to that user. This mea开发者_StackOverflow社区ns that the job will not run with the ctxsys privilege that you should have granted to your schema user. So what does this mean? It means that you have to run the job as the ctxsys user

I unfortunately cannot use this to grant myself privileges since yes, this is homework, and I don't have permissions to grant execute on ctx_ddl to myself.

Does anyone have clues as to how I can resolve this issue? Otherwise I will wait until later this week and consult the TA's.

Thanks


I don't think there's a workaround since the documentation of DBMS_JOB explicitly specifies this restriction:

You can execute procedures that are owned by the user or for which the user is explicitly granted EXECUTE. However, procedures for which the user is granted the execute privilege through roles cannot be executed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜