我的测试,太常见的字会被自动过滤
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on 星期日 8月 30 19:23:08 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
SQL> set pages 5000
SQL> select username from all_users;
USERNAME
------------------------------------------------------------
XS$NULL
APEX_040000
APEX_PUBLIC_USER
FLOWS_FILES
HR
MDSYS
ANONYMOUS
XDB
CTXSYS
OUTLN
SYSTEM
SYS
已选择12行。
SQL> desc dba_roles
名称 是否为空? 类型
----------------------------------------- -------- ----------------------------
ROLE NOT NULL VARCHAR2(30)
PASSWORD_REQUIRED VARCHAR2(8)
AUTHENTICATION_TYPE VARCHAR2(11)
SQL> select role from dba_roles;
ROLE
------------------------------------------------------------
CONNECT
RESOURCE
DBA
SELECT_CATALOG_ROLE
EXECUTE_CATALOG_ROLE
DELETE_CATALOG_ROLE
EXP_FULL_DATABASE
IMP_FULL_DATABASE
LOGSTDBY_ADMINISTRATOR
DBFS_ROLE
AQ_ADMINISTRATOR_ROLE
AQ_USER_ROLE
DATAPUMP_EXP_FULL_DATABASE
DATAPUMP_IMP_FULL_DATABASE
ADM_PARALLEL_EXECUTE_TASK
GATHER_SYSTEM_STATISTICS
XDB_WEBSERVICES_OVER_HTTP
RECOVERY_CATALOG_OWNER
SCHEDULER_ADMIN
HS_ADMIN_SELECT_ROLE
HS_ADMIN_EXECUTE_ROLE
HS_ADMIN_ROLE
OEM_ADVISOR
OEM_MONITOR
PLUSTRACE
CTXAPP
XDBADMIN
XDB_SET_INVOKER
AUTHENTICATEDUSER
XDB_WEBSERVICES
XDB_WEBSERVICES_WITH_PUBLIC
APEX_ADMINISTRATOR_ROLE
已选择32行。
SQL> grant ctxapp to hr;
授权成功。
SQL> grant execute on ctx_ddl to hr;
授权成功。
SQL> conn hr/hr
已连接。
SQL> exec ctx_ddl.create_preference('testlex','BASIC_LEXER');
PL/SQL 过程已成功完成。
SQL> create table text(a int, b varchar(100));
表已创建。
SQL> insert into text values(1,'i am a student, he is a teacher');
已创建 1 行。
SQL> insert into text values(2,'dog has one mouth and two eyes and four legs');
已创建 1 行。
SQL> commit;
提交完成。
SQL> create index idx_text on text(b) indextype is ctxsys.context;
索引已创建。
SQL> select * from text where contains(b,'a')>0;
未选定行
SQL> select * from text where contains(b,'teacher')>0;
A
----------
B
--------------------------------------------------------------------------------
1
i am a student, he is a teacher
SQL> select * from text where contains(b,'e')>0;
未选定行
SQL> select * from text where contains(b,'eys')>0;
未选定行
SQL> select * from text where contains(b,'eyes')>0;
A
----------
B
--------------------------------------------------------------------------------
2
dog has one mouth and two eyes and four legs
SQL>