[Oracle] Full text index

博客首页 » Oracle Full text index

发布于 04 Jan 2015 03:31
标签 blog
Oracle full text index

就像这里介绍的,Oracle的全文索引非常容易。
http://www.cnblogs.com/xiaobo/archive/2010/12/24/1915483.html
http://www.cnblogs.com/mybook/archive/2012/12/17/2822299.html

connect / as sysdba
@?/ctx/admin/catctx.sql ctxsys Idx_ctxsys temp nolock

connect ctxsys/ctxsys
@?/ctx/admin/defaults/drdefus.sql
grant execute on ctxsys.ctx_ddl to sgpm with grant option;

connect sgpm/sgpm
exec ctx_ddl.drop_preference('chinalexer');
exec ctx_ddl.create_preference('chinalexer','chinese_lexer');

exec ctx_ddl.drop_preference('idx_c_store');

begin
ctx_ddl.create_preference('idx_c_store','BASIC_STORAGE');
ctx_ddl.set_attribut('idx_c_store','I_TABLE_CLAUSE','tablespaces Idx_ctxsy');
ctx_ddl.set_attribute('idx_c_store','I_INDEX_CLAUSE','tablespace Idx_ctxsy compress 2');
end;
/

create index sgpm.idx_c_cons_name on sgpm.c_cons(cons_name) indextype is ctxsys.context parameters('lexer chinalexer storage idx_c_store');

variable jobno number;

begin
dbms_job.submit(:jobno,'exec ctx_ddl.sync_index(''idx_c_cons_name'');',sysdate,'trunc(sysdate)+19/24+1');
end;
/

exec ctx_ddl.sync_index('idx_c_cons_name');

preference的信息可以在ctx_preferences视图中查到。
select * from ctx_preferences;

需要注意的是,如果指定了storage,那么需要指定被覆盖掉的默认属性,比如COMPRESS 2。
http://docs.oracle.com/cd/B28359_01/text.111/b28304/cdatadic.htm#CCREF2028

Parameter clause for dr$indexname$X index creation. Specify storage and tablespace clauses to add to the end of the internal CREATE INDEX statement. The default clause is: 'COMPRESS 2' which instructs Oracle Text to compress this index table.

If you choose to override the default, Oracle recommends including COMPRESS 2 in your parameter clause to compress this table, because such compression saves disk space and helps query performance.

另外,杨挺昆同志介绍的section group也非常详细。
http://blog.itpub.net/4227/viewspace-68958/


本页面的文字允许在知识共享 署名-相同方式共享 3.0协议和GNU自由文档许可证下修改和再使用,仅有一个特殊要求,请用链接方式注明文章引用出处及作者。请协助维护作者合法权益。


系列文章

文章列表

  • Oracle Full text index

这篇文章对你有帮助吗,投个票吧?

rating: 0+x

留下你的评论

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License