需ctxapp权限及创建clob类型字段上的全文索引,最后还需设置对全文索引进行定时更新。全文索引例子:Connect as SYS or SYSTEM and execute following script ------------------- cut here ------------------------------
-- Create a user to work with interMedia Text
create user textuser identified by textuser
default tablespace users
temporary tablespace temp;-- You must grant 'ctxapp' role to textuser
grant connect, resource, ctxapp to ctxtest;drop table quick;create table quick (
quick_id number
constraint quick_pk primary key,
text varchar2(80) );insert into quick ( quick_id, text )
values ( 1, 'The cat sat on the mat' );
insert into quick ( quick_id, text )
values ( 2, 'The quick brown fox jumps over the lazy dog' );
insert into quick
values (3, 'The dog barked like a dog' );
commit;create index quick_text on quick ( text )
indextype is ctxsys.context;col text format a45
col s format 999
select text, score(42) s from quick
where contains ( text, 'dog', 42 ) >= 0
order by s desc;
关于全文索引的定时更新,我参考的这篇文章:
http://www.powerba.com/develop/database/oracle/article/20010808002.htm
-- Create a user to work with interMedia Text
create user textuser identified by textuser
default tablespace users
temporary tablespace temp;-- You must grant 'ctxapp' role to textuser
grant connect, resource, ctxapp to ctxtest;drop table quick;create table quick (
quick_id number
constraint quick_pk primary key,
text varchar2(80) );insert into quick ( quick_id, text )
values ( 1, 'The cat sat on the mat' );
insert into quick ( quick_id, text )
values ( 2, 'The quick brown fox jumps over the lazy dog' );
insert into quick
values (3, 'The dog barked like a dog' );
commit;create index quick_text on quick ( text )
indextype is ctxsys.context;col text format a45
col s format 999
select text, score(42) s from quick
where contains ( text, 'dog', 42 ) >= 0
order by s desc;
关于全文索引的定时更新,我参考的这篇文章:
http://www.powerba.com/develop/database/oracle/article/20010808002.htm
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货