我已经使用以下命令为我的表添加了一个索引:
CREATE INDEX patient_index ON radiology_record(patient_name) INDEXTYPE IS CTXSYS.CONTEXT;
我正在尝试添加一个 DBMS_JOB 以使其保持最新状态。
我运行此脚本的方式是从 SQLPLUS 调用“@myscript.sql”
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;
/
产生的错误是 PLS-00201: identifier 'CTX_DDL' must be declared
通过我的搜索,我发现有人有类似的问题和他的 solution是
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 means 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
很遗憾,我无法使用它来授予自己特权,因为是的,这是家庭作业,我没有权限将对 ctx_ddl 的执行授予我自己。
有没有人知道我该如何解决这个问题?否则我会等到这周晚些时候再咨询助教。
谢谢
最佳答案
自 documentation of DBMS_JOB
以来,我认为没有解决方法明确指定此限制:
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.
关于必须声明 oracle 标识符 'ctx_ddl' - 添加 dbms_job,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5455675/