SQL> connect SYS/password as SYSDBA
SQL> spool text_install.txt
SQL> @?/ctx/admin/catctx.sql change_on_install SYSAUX TEMP NOLOCK
TEMP ------------------------------用户ctxsys的默认临时表空间
LOCK|NOLOCK ----------------锁定|不锁定用户?
SQL> @?/ctx/admin/defaults/dr0defin.sql "AMERICAN";
SQL> connect SYS/password as SYSDBA
SQL> alter user ctxsys account lock password expire;
SQL> spool off
SQL> @?/ctx/admin/defaults/ drdefus.sql
SQL> alter user ctxsys account lock password expire;
SQL> spool off
DEFINE nls_language = "&1"
COLUMN lang_abbr NEW_VALUE lang_abbr
DEFINE nls_language = "&1"
COLUMN lang_abbr NEW_VALUE lang_abbr
SELECT DECODE('&nls_language',
'AMERICAN', 'us',
.........
lang_abbr FROM dual;
@@drdef&lang_abbr..sql
故:当我们执行dr0defin.sql "AMERICAN"时,脚本中decode的值为us,最终还是执行的@@drdef&lang_abbr..sql=drdefus.sql脚本
注意:在一些系统上使用Text 必须指定相关参数,
下面列出了不同操作系统上ctxhx依赖的共享库路径,这些变量必须指定
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
其中:
C Shell (csh or tcsh),执行:
$ setenv LD_LIBRARY_PATH $ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
Bourne shell (sh), Bash shell (bash), or Korn shell (ksh),执行:
$ export LD_LIBRARY_PATH=$ORACLE_HOME/ctx/lib:$LD_LIBRARY_PATH
执行下面的命令检查设置是否正确
$ echo $LD_LIBRARY_PATH
2。检查确认CTXSYS相关的无效对象,你应该得到"no rows selected".
如果有,那么你可以手动编译每个无效的对象。
connect SYS/password as SYSDBA
set pages 1000
col object_name format a40
col object_type format a20
col comp_name format a30
column library_name format a8
column file_spec format a60 wrap
spool text_install_verification.log
-- check on setup
select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT';
select * from ctxsys.ctx_version;
select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
-- Get a summary count
select object_type, count(*) from dba_objects where wner='CTXSYS' group by object_type;
-- Any invalid objects
select object_name, object_type, status from dba_objects where wner='CTXSYS' and status != 'VALID' order by object_name;
spool off
------------------- cut here ------------------------------
COMP_NAME STATUS VERSION
------------------- -------- ----------
Oracle Text VALID 11.2.0.1.0
SQL> select * from ctxsys.ctx_version;
VER_DICT VER_CODE
---------- ----------
11.2.0.1.0 11.2.0.1.0
SQL> select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
VER_CODE
----------
11.2.0.1.0
SQL> select count(*) from dba_objects where wner='CTXSYS';
COUNT(*)
----------
366
SQL>
SQL> -- Get a summary count
SQL> select object_type, count(*) from dba_objects where wner='CTXSYS' group by object_type;
OBJECT_TYPE COUNT(*)
------------------- ----------
SEQUENCE 3
PROCEDURE 2
OPERATOR 6
PACKAGE 73
PACKAGE BODY 62
LIBRARY 1
LOB 2
TYPE BODY 6
VIEW 71
INDEXTYPE 4
FUNCTION 2
TABLE 47
INDEX 56
TYPE 31
SQL>
SQL> -- Any invalid objects
SQL> select object_name, object_type, status from dba_objects where wner='CTXSYS' and status != 'VALID' order by object_name;
no rows selected
SQL>
COMP_NAME STATUS VERSION
------------------- -------- ----------
Oracle Text VALID 11.2.0.2.0
SQL> select * from ctxsys.ctx_version;
VER_DICT VER_CODE
---------- ----------
11.2.0.2.0 11.2.0.2.0
SQL> select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
VER_CODE
----------
11.2.0.2.0
SQL> select count(*) from dba_objects where wner='CTXSYS';
COUNT(*)
----------
382
SQL>
SQL> -- Get a summary count
SQL> select object_type, count(*) from dba_objects where wner='CTXSYS' group by object_type;
OBJECT_TYPE COUNT(*)
------------------- ----------
SEQUENCE 3
PROCEDURE 2
OPERATOR 6
LOB 2
LIBRARY 1
PACKAGE 74
PACKAGE BODY 63
TYPE BODY 6
TABLE 49
INDEX 59
VIEW 76
FUNCTION 2
INDEXTYPE 4
TYPE 35
SQL>
SQL> -- Any invalid objects
SQL> select object_name, object_type, status from dba_objects where wner='CTXSYS' and status != 'VALID' order by object_name;
no rows selected
SQL>
COMP_NAME STATUS VERSION
------------------- -------- ----------
Oracle Text VALID 11.2.0.3.0
SQL> select * from ctxsys.ctx_version;
VER_DICT VER_CODE
----------- -----------
11.2.0.3.0 11.2.0.3.0
SQL> select substr(ctxsys.dri_version,1,10) VER_CODE from dual;
VER_CODE
----------
11.2.0.3.0
SQL> select count(*) from dba_objects where wner='CTXSYS';
COUNT(*)
----------
388
SQL> select object_type, count(*) from dba_objects where wner='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
TYPE 35
TYPE BODY 6
VIEW 77
14 rows selected.
SQL>
SQL> -- Any invalid objects
SQL> select object_name, object_type, status from dba_objects where wner='CTXSYS' and status != 'VALID' order by object_name;
no rows selected
SQL>
- Before deinstalling Oracle Text, it is best to first drop all Text Indexes built in schemas other than CTXSYS.
- When deinstalling Oracle Text, for example to get rid of an invalid or corrupt Text environment, it should immediately be followed by a reinstallation of Text due to the dependency of other components on Text objects.
Text dictionary is removed by calling following script. from SQL*Plus connected 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/27000195/viewspace-730789/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27000195/viewspace-730789/