手動安裝、驗證、解除安裝11g R2 oracle text

jx_yu發表於2012-05-24
適用版本: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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章