Oracle 11g中创建索引时权限不足
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2325328/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Insufficient privilege when creating an index in Oracle 11g
提问by Nishan
I am trying to create an index in Oracle, my ddl :
我正在尝试在 Oracle 中创建索引,我的 ddl :
create index OMD_DOCTEXT2_CTX on table_name(col_name)
indextype is ctxsys.context local
parameters ('datastore CTXSYS.FILE_DATASTORE filter ctxsys.null_filter lexer E2LEX wordlist E2WORDLIST stoplist E2STOP section group E2GROUP') parallel 4;
I am getting error :
我收到错误:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10758: index owner does not have the privilege to use file or URL datastore
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366
Any ideas?
有任何想法吗?
回答by APC
From the Oracle Text Documentation:
File and URL datastores enable access to files on the actual database disk. This may be undesirable when security is an issue since any user can browse the file system that is accessible to the Oracle user. The FILE_ACCESS_ROLE system parameter can be used to set the name of a database role that is authorized to create an index using FILE or URL datastores. If set, any user attempting to create an index using FILE or URL datastores must have this role, or the index creation will fail.
For example, the following statement sets the name of the database role:
ctx_adm.set_parameter('FILE_ACCESS_ROLE','TOPCAT');
where TOPCAT is the role that is authorized to create an index on a file or URL datastore. The CREATE INDEX operation will fail when a user that does not have an authorized role tries to create an index on a file or URL datastore.
文件和 URL 数据存储允许访问实际数据库磁盘上的文件。当安全是一个问题时,这可能是不可取的,因为任何用户都可以浏览 Oracle 用户可以访问的文件系统。FILE_ACCESS_ROLE 系统参数可用于设置有权使用 FILE 或 URL 数据存储创建索引的数据库角色的名称。如果设置,则任何尝试使用 FILE 或 URL 数据存储区创建索引的用户都必须具有此角色,否则索引创建将失败。
例如,以下语句设置数据库角色的名称:
ctx_adm.set_parameter('FILE_ACCESS_ROLE','TOPCAT');
其中 TOPCAT 是被授权在文件或 URL 数据存储上创建索引的角色。当没有授权角色的用户尝试在文件或 URL 数据存储上创建索引时,CREATE INDEX 操作将失败。
So, does your user have the necessary role?
那么,您的用户是否具有必要的角色?