Database 同步上下文索引时出错
我有一个全文数据库应用程序,它有一个简单的过程,可以将值插入表中:Database 同步上下文索引时出错,database,oracle,admin,grant,full-text-indexing,Database,Oracle,Admin,Grant,Full Text Indexing,我有一个全文数据库应用程序,它有一个简单的过程,可以将值插入表中: create or replace PROCEDURE put_file ( p_file_name IN my_doc.file_name%TYPE, p_upload_date IN my_doc.upload_date%TYPE, p_filesize IN my_doc.filesize%TYPE, p_filetype IN my_doc
create or replace PROCEDURE put_file
(
p_file_name IN my_doc.file_name%TYPE,
p_upload_date IN my_doc.upload_date%TYPE,
p_filesize IN my_doc.filesize%TYPE,
p_filetype IN my_doc.filetype%TYPE,
p_creation_date IN my_doc.creation_date%TYPE,
p_modification_date IN my_doc.modification_date%TYPE,
p_accessed_date IN my_doc.accessed_date%TYPE
) AS
dummy pls_integer;
BEGIN
select count(*) into dummy from my_doc where file_name = p_file_name;
if dummy = 0
then
INSERT INTO my_doc (id, file_name, upload_date, filesize, filetype, content, creation_date, modification_date, accessed_date)
VALUES (my_doc_seq.NEXTVAL, p_file_name, p_upload_date, p_filesize, p_filetype, BFILENAME('DOCUMENTS',p_file_name), p_creation_date, p_modification_date, p_accessed_date);
end if;
ctx_ddl.sync_index; -- the error occurs here
COMMIT;
END;
为了成功执行此过程,我向当前用户提供了所有必要的权限:
grant resource, connect, ctxapp to my_user;
/
grant execute on ctxsys.ctx_adm to my_user;
grant execute on ctxsys.ctx_cls to my_user;
grant execute on ctxsys.ctx_ddl to my_user;
grant execute on ctxsys.ctx_doc to my_user;
grant execute on ctxsys.ctx_output to my_user;
grant execute on ctxsys.ctx_query to my_user;
grant execute on ctxsys.ctx_report to my_user;
grant execute on ctxsys.ctx_thes to my_user;
grant execute on ctxsys.ctx_ulexer to my_user;
。。。但是,不幸的是,当我执行该过程时,我收到以下错误:
从命令中的第1行开始出错:执行put_文件('text.txt',sysdate,12',.txt',sysdate,sysdate,sysdate)
错误报告: ORA-20000:Oracle文本错误:DRG-10017:您必须是CTXSYS才能执行此操作 此:同步
ORA-06512:在“CTXSYS.DRUE”第160行
ORA-06512:at “CTXSYS.CTX_DDL”,第847行
ORA-06512:在“我的用户.放置文件”行 24
ORA-06512:在第1行
*原因:调用了存储过程“raise\u application\u error”,导致生成此错误。
*操作:按照错误消息中所述更正问题,或联系应用程序管理员或DBA以获取更多信息
谢谢,我想我显示的问题是您正在呼叫
ctx\u ddl.sync\u index
。你没有传递任何参数。这是允许的,但:
当idx_name为null时,所有具有挂起更改的上下文、CTXRULE和CTXXPATH索引都将同步。您必须以ctxsys身份连接才能执行此操作
因此,解决方案是您需要在调用中包含索引的名称