1.创建CTXSYS用户
以SYS用户执行以下脚本:
SQL> connect SYS/password as SYSDBA
SQL> spool text_install.txt
SQL> @?/ctx/admin/catctx.sql change_on_install SYSAUX TEMP NOLOCK
各参数含义:
change_on_install – 设置ctxsys用户密码
SYSAUX – 调置ctxsys用户默认表空间
TEMP – 设置ctxsys用户默认临时表空间
LOCK|NOLOCK – 设置ctxsys用户锁定与不锁定
2.指定默认安装语言
SYS@jzh>conn ctxsys/oracle
Connected.
以ctxsys用户执行如下脚本:
CTXSYS@jzh>@$ORACLE_HOME/ctx/admin/defaults/drdefus.sql
Creating lexer preference...
PL/SQL procedure successfully completed.
Creating wordlist preference...
PL/SQL procedure successfully completed.
Creating stoplist...
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Creating default policy...
PL/SQL procedure successfully completed.
在11.2.0.3版本中,如果不执行以上脚本,那么在执行脚本dr0defin.sql或创建索引时会遇到如下错误:
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: CTXSYS.DEFAULT_LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.CTX_DDL", line 1140
ORA-06512: at line 2
SQL> CREATE INDEX "EXPERIAN2"."IX_COMP_SEARCH"
ON "EBA05M5" ("COMPANY_NAME") INDEXTYPE IS "CTXSYS"."CONTEXT";
*
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: CTXSYS.DEFAULT_LEXER
ORA-06512: at CTXSYS.DRUE, line 160
ORA-06512: at CTXSYS.TEXTINDEXMETHODS, line 364
设置american为默认语言
SYS@jzh>@?/ctx/admin/defaults/dr0defin.sql "AMERICAN";
old 1: SELECT DECODE('&nls_language',
new 1: SELECT DECODE('AMERICAN',
LA
--
us
Creating lexer preference...
PL/SQL procedure successfully completed.
Creating wordlist preference...
PL/SQL procedure successfully completed.
Creating stoplist...
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Creating default policy...
PL/SQL procedure successfully completed.
注意:在一些系统中使用text必须指定相关变量,如下列表:
Platform: Requires path set: ENV variable:
--------------------- --------------------- -------------------
Linux x86-64 YES LD_LIBRARY_PATH
Solaris SPARC64 YES LD_LIBRARY_PATH
IBM AIX YES LIBPATH
HP PA-RISC YES SHLIB_PATH
HP Itanium YES LD_LIBRARY_PATH
- If you have the C Shell (csh or tcsh), enter the following:
$ setenv LD_LIBRARY_PATH $ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
- If you have the Bourne shell (sh), Bash shell (bash), or Korn shell (ksh), enter the following:
$ export LD_LIBRARY_PATH=$ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
Run the following command to check if the LD_LIBRARY_PATH environmental variable is set correctly:
$ echo $LD_LIBRARY_PATH
3. 验证
以sys用户登陆数据库执行如下脚本:
SYS@jzh>select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT';
COMP_NAME STATUS VERSION
---------------------------------------- -------------------- ------------------------------
Oracle Text VALID 11.2.0.3.0
SYS@jzh>select * from ctxsys.ctx_version;
VER_DICT VER_CODE
---------------------------------------- ----------------------------------------
11.2.0.3.0 11.2.0.3.0
SYS@jzh>select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
VER_CODE
----------------------------------------
11.2.0.3.0
SYS@jzh>select count(*) from dba_objects where owner='CTXSYS';
COUNT(*)
----------
388
SYS@jzh>select object_type, count(*) from dba_objects where owner='CTXSYS' group by object_type order by 1;
OBJECT_TYPE COUNT(*)
------------------- ----------
FUNCTION 2
INDEX 63
INDEXTYPE 4
LIBRARY 1
LOB 2
OPERATOR 6
PACKAGE 74
PACKAGE BODY 63
PROCEDURE 2
SEQUENCE 3
TABLE 50
OBJECT_TYPE COUNT(*)
------------------- ----------
TYPE 35
TYPE BODY 6
VIEW 77
14 rows selected.
SYS@jzh>select object_name, object_type, status from dba_objects where owner='CTXSYS' and status != 'VALID' order by object_name;
no rows selected
如果有无效对象,可手动重新编译。
4. 卸载Oracle text
? 以sys用户执行如下脚本
SQL> connect SYS/password as SYSDBA
SQL> spool text_deinstall.log
SQL> @?/ctx/admin/catnoctx.sql
SQL> drop procedure sys.validate_context;
SQL> spool off
以SYS用户执行以下脚本:
SQL> connect SYS/password as SYSDBA
SQL> spool text_install.txt
SQL> @?/ctx/admin/catctx.sql change_on_install SYSAUX TEMP NOLOCK
各参数含义:
change_on_install – 设置ctxsys用户密码
SYSAUX – 调置ctxsys用户默认表空间
TEMP – 设置ctxsys用户默认临时表空间
LOCK|NOLOCK – 设置ctxsys用户锁定与不锁定
2.指定默认安装语言
SYS@jzh>conn ctxsys/oracle
Connected.
以ctxsys用户执行如下脚本:
CTXSYS@jzh>@$ORACLE_HOME/ctx/admin/defaults/drdefus.sql
Creating lexer preference...
PL/SQL procedure successfully completed.
Creating wordlist preference...
PL/SQL procedure successfully completed.
Creating stoplist...
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Creating default policy...
PL/SQL procedure successfully completed.
在11.2.0.3版本中,如果不执行以上脚本,那么在执行脚本dr0defin.sql或创建索引时会遇到如下错误:
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: CTXSYS.DEFAULT_LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.CTX_DDL", line 1140
ORA-06512: at line 2
SQL> CREATE INDEX "EXPERIAN2"."IX_COMP_SEARCH"
ON "EBA05M5" ("COMPANY_NAME") INDEXTYPE IS "CTXSYS"."CONTEXT";
*
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: CTXSYS.DEFAULT_LEXER
ORA-06512: at CTXSYS.DRUE, line 160
ORA-06512: at CTXSYS.TEXTINDEXMETHODS, line 364
设置american为默认语言
SYS@jzh>@?/ctx/admin/defaults/dr0defin.sql "AMERICAN";
old 1: SELECT DECODE('&nls_language',
new 1: SELECT DECODE('AMERICAN',
LA
--
us
Creating lexer preference...
PL/SQL procedure successfully completed.
Creating wordlist preference...
PL/SQL procedure successfully completed.
Creating stoplist...
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Creating default policy...
PL/SQL procedure successfully completed.
注意:在一些系统中使用text必须指定相关变量,如下列表:
Platform: Requires path set: ENV variable:
--------------------- --------------------- -------------------
Linux x86-64 YES LD_LIBRARY_PATH
Solaris SPARC64 YES LD_LIBRARY_PATH
IBM AIX YES LIBPATH
HP PA-RISC YES SHLIB_PATH
HP Itanium YES LD_LIBRARY_PATH
- If you have the C Shell (csh or tcsh), enter the following:
$ setenv LD_LIBRARY_PATH $ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
- If you have the Bourne shell (sh), Bash shell (bash), or Korn shell (ksh), enter the following:
$ export LD_LIBRARY_PATH=$ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
Run the following command to check if the LD_LIBRARY_PATH environmental variable is set correctly:
$ echo $LD_LIBRARY_PATH
3. 验证
以sys用户登陆数据库执行如下脚本:
SYS@jzh>select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT';
COMP_NAME STATUS VERSION
---------------------------------------- -------------------- ------------------------------
Oracle Text VALID 11.2.0.3.0
SYS@jzh>select * from ctxsys.ctx_version;
VER_DICT VER_CODE
---------------------------------------- ----------------------------------------
11.2.0.3.0 11.2.0.3.0
SYS@jzh>select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
VER_CODE
----------------------------------------
11.2.0.3.0
SYS@jzh>select count(*) from dba_objects where owner='CTXSYS';
COUNT(*)
----------
388
SYS@jzh>select object_type, count(*) from dba_objects where owner='CTXSYS' group by object_type order by 1;
OBJECT_TYPE COUNT(*)
------------------- ----------
FUNCTION 2
INDEX 63
INDEXTYPE 4
LIBRARY 1
LOB 2
OPERATOR 6
PACKAGE 74
PACKAGE BODY 63
PROCEDURE 2
SEQUENCE 3
TABLE 50
OBJECT_TYPE COUNT(*)
------------------- ----------
TYPE 35
TYPE BODY 6
VIEW 77
14 rows selected.
SYS@jzh>select object_name, object_type, status from dba_objects where owner='CTXSYS' and status != 'VALID' order by object_name;
no rows selected
如果有无效对象,可手动重新编译。
4. 卸载Oracle text
? 以sys用户执行如下脚本
SQL> connect SYS/password as SYSDBA
SQL> spool text_deinstall.log
SQL> @?/ctx/admin/catnoctx.sql
SQL> drop procedure sys.validate_context;
SQL> spool off
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10271187/viewspace-2128570/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10271187/viewspace-2128570/