ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 手动安装、验证、卸载11g R2 oracle text

手动安装、验证、卸载11g R2 oracle text

原创 Linux操作系统 作者:jx_yu 时间:2012-05-24 09:43:18 0 删除 编辑
适用版本:11.2.0.1 to 11.2.0.3   任意平台
 
安装步骤:
1、  调用数据库脚本【$ORACLE_HOME/ctx/admin/catctx.sql
    来创建相关的schema---CTXSYS(用户)

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 ----------------锁定|不锁定用户?
 
2、指定默认的安装语言
NOTE:ORACLE_HOME/ctx/admin/defaults/下有text支持的语言对应脚本,脚本的名称:drdefXX.sql;
dr0defin.sql是一个包含了所有的能支持的语言,只不过执行的时候需传给参数,然后脚本中会调用参数对应的当前目录下的脚本来执行而已:
例:下面我们指定American作为默认语言,那么执行:
SQL> connect "CTXSYS"/"change_on_install"
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> connect "CTXSYS"/"change_on_install"
SQL> @?/ctx/admin/defaults/ drdefus.sql
SQL> connect SYS/password as SYSDBA
SQL> alter user ctxsys account lock password expire;
SQL> spool off
 
评:上面的dr0defin.sql的内容如下:

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

 
+++++++++++++++++++++++++++++++++++++++++++++
oracle text有效性的验证
1、检查确认所有的text对象CTXSYS模式创建安装的版本是否正确
2。检查确认CTXSYS相关的无效对象,你应该得到"no rows selected".
如果有,那么你可以手动编译每个无效的对象
------------------- cut here ------------------------------
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;

select count(*) from dba_objects where wner='CTXSYS';

-- 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 ------------------------------

有效的11.2.0.1.0 Text检查结果:
SQL> 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.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>

有效的11.2.0.2.0 Text检查结果:
SQL> 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.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>

有效的11.2.0.3.0  Text检查结果:
SQL> 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

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>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
卸载oracle text组件
*** Note ***
- 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> 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/27000195/viewspace-730789/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2012-05-23

  • 博文量
    80
  • 访问量
    808761