日期:2014-05-16  浏览次数:20379 次

【引用】Oracle全文检索方面的研究(全5)

3.5 Storage 属性

Oracle 全文检索通常会生成一系列的辅助表,生成规则是dr$+索引名+$+表用途标识,

由于这些表是oracle 自动生成的,通常没有办法为这些表指定存储空间。为构造text 索引所

生成的辅助表指定表空间、存储参数(use the storage preference to specify tablespace and

creation parameters for tables associated with a text index),oracle 提供了单一的存储类型

basic_storage。??

在mytable1 表中建立了全文索检索myindex,系统中会自动产生如下5 个表:

DR$MYINDEX$I,DR$MYINDEX$K,DR$MYINDEX$R,DR$MYINDEX$X,MYTABLE1

?

?

?

参考脚本

--建立basic storage

Begin

Ctx_ddl.create_preference('mystore', 'basic_storage'); --建立storage

Ctx_ddl.set_attribute('mystore', --设置参数

'i_table_clause',

'tablespace foo storage (initial 1k)');

Ctx_ddl.set_attribute('mystore',

'k_table_clause',

'tablespace foo storage (initial 1k)');

Ctx_ddl.set_attribute('mystore',

'r_table_clause',

'tablespace users storage (initial 1k) lob

?

(data) store as (disable storage in row cache)');

Ctx_ddl.set_attribute('mystore',

'n_table_clause',

'tablespace foo storage (initial 1k)');

Ctx_ddl.set_attribute('mystore',

'i_index_clause',

'tablespace foo storage (initial 1k) compress 2');

Ctx_ddl.set_attribute('mystore',

'p_table_clause',

'tablespace foo storage (initial 1k)');

End;

--建立索引

Create index indx_m_word on my_word(docs) indextype is ctxsys.context

parameters('storage mystore');

?

?