必须声明 oracle 标识符 'ctx_ddl' - 添加 dbms_job

标签 oracle indexing sqlplus database

我已经使用以下命令为我的表添加了一个索引:
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/

相关文章:

c - 根据您的索引从 C 中的链表中删除

sql - 将 Unixtime 转换为日期时间 SQL (Oracle)

oracle - 物化的变化

sql - 使用列的最大值从oracle sql表中过滤行

javascript - 索引 angularjs 应用程序 - Googlebot 模拟与站点 :domain

Mysql Innodb 在大多数空值的列上建立索引

java - 我从一个 JFrame 到另一个 Jframe 的链接不起作用

oracle - 在 SQL*Plus 中描述 - 它是调用包还是运行 SQL? (或者是其他东西?)

sql - 无法像@{file.sql} oracle sqlplus 语法那样从 SQL Server 查询管理器执行 SQL 脚本?

oracle设置多个系统变量