Oracle 文本在单个索引上调度同步
我需要同步 Oracle 文本索引。但作业无法创建:
declare
v_job_id number(19,0);
begin
dbms_job.submit(
JOB => v_job_id,
WHAT => 'alter index NAME_IDX rebuild parameters (''sync'');',
NEXT_DATE => SYSDATE + (1/24),
INTERVAL => 'SYSDATE + (1/24) + 7'
);
end;
/
或运行:
declare
v_job_id number(19,0);
begin
dbms_job.submit(
JOB => v_job_id,
WHAT => 'CTX_DDL(''NAME_IDX'');',
NEXT_DATE => SYSDATE + (1/24),
INTERVAL => 'SYSDATE + (1/24) + 7'
);
end;
/
但如果我运行其中任何一个作品:
alter index NAME_IDX rebuild parameters ('sync');
call CTX_DDL('NAME_IDX');
知道正确的语法吗?
谢谢。
PD:我一直在寻找,但我找到的唯一答案不符合我的要求。我也为我的英语道歉。
I need to sync an oracle text index. But job fails to create:
declare
v_job_id number(19,0);
begin
dbms_job.submit(
JOB => v_job_id,
WHAT => 'alter index NAME_IDX rebuild parameters (''sync'');',
NEXT_DATE => SYSDATE + (1/24),
INTERVAL => 'SYSDATE + (1/24) + 7'
);
end;
/
Or to run:
declare
v_job_id number(19,0);
begin
dbms_job.submit(
JOB => v_job_id,
WHAT => 'CTX_DDL(''NAME_IDX'');',
NEXT_DATE => SYSDATE + (1/24),
INTERVAL => 'SYSDATE + (1/24) + 7'
);
end;
/
But if I run any of those works:
alter index NAME_IDX rebuild parameters ('sync');
call CTX_DDL('NAME_IDX');
Any idea of the correct syntax?
Thank you.
PD: Ive been searching, but the only answer I found doesnt fit my requirements. I also apologize for my english.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以运行匿名块,CALL不在PL/SQL中,ALTER INDEX是DDL,并且你需要在CTX_DDL中指定要运行哪个过程:
但是,我个人更喜欢将其封装在过程中(或者,甚至更好) ,一个包)并从作业中调用该过程:
另外,我很确定您实际上不需要重建索引 - 您只需要调用
CTX_DDL.sync_index
从任何DML 摆在桌面上。You can run an anonymous block, CALL is not in PL/SQL, ALTER INDEX is DDL, and you need to specify which procedure in CTX_DDL you want to run:
However, personally I prefer to encapsulate it in a procedure (or, even better, a package) and call the procedure from the job:
Also, I'm pretty sure you don't actually need to rebuild the index - you only need to call
CTX_DDL.sync_index
to refresh it from any DML on the table.