Monday, December 15, 2008

installation of Oracle Text on 10g

This article lists the steps for manual installation of Oracle Text 10gR1 and 10gR2, verification and uninstalling Oracle Text installation.If you create an Oracle database using the Database Configuration Assistant (DBCA) Text is installed by default and you do not need to perform the installation steps described in the Manual installation section.

Instead installation you need to grant permission to the oracle user that use oracle text.

Create User:

CREATE USER myuser IDENTIFIED BY myuser_password.

Grant Roles:

GRANT RESOURCE, CONNECT, CTXAPP TO MYUSER;

Grant EXECUTE Privileges on CTX PL/SQL Packages:

There are ten Oracle Text packages that enable you to perform actions ranging from synchronizing an Oracle Text index to highlighting documents. For example, the CTX_DDL.SYNC_INDEX package enables you to synchronize your index.

GRANT EXECUTE ON CTX_CLS TO myuser;
GRANT EXECUTE ON CTX_DDL TO myuser;
GRANT EXECUTE ON CTX_DOC TO myuser;
GRANT EXECUTE ON CTX_OUTPUT TO myuser;
GRANT EXECUTE ON CTX_QUERY TO myuser;
GRANT EXECUTE ON CTX_REPORT TO myuser;
GRANT EXECUTE ON CTX_THES TO myuser;

Oracle Text is available for no extra Licensing in all four database editions:
  1. Oracle Database Standard Edition One.
  2. Oracle Database Standard Edition (SE).
  3. Oracle Database Enterprise Edition (EE).
  4. Oracle Database Personal Edition.

Manual installation of Text 10gR1 (10.1.0.x) and 10gR2 (10.2.0.x)

  1. You must install Oracle Data Mining (ODM), feature available in Oracle Database Enterprise Edition (EE), before you install Oracle Text in order to use the SVM classifier and the KMEANS clustering. All other functions should work without ODM installed, including RULE classifier and TEXTK clustering.
  2. Oracle Text makes use of a "Knowledge Base" for English and French, which is loaded from different files provided on the second CD, known as the "Oracle Database 10g Companion CD". The Knowledge Base is required to use any of the theme-based features in Oracle Text. Therefore, if you install from the main CD only, theme functionality will not be available. For information about how to install products from the Companion CD, refer to the "Installing Oracle Database 10g Products from the Companion CD" section.

If you created your database manually or you want to install Text later, then follow these steps.


Note: In SQL*Plus we use '?' instead of $ORACLE_HOME

1. Text dictionary, schema name CTXSYS, is created by calling following script from SQL*Plus connected as SYSDBA:

SQL> connect SYS/password as SYSDBA
SQL> spool text_install.txt
SQL> @?/ctx/admin/catctx.sql CTXSYS SYSAUX TEMP NOLOCK

Where:
CTXSYS - is the ctxsys user password
SYSAUX - is the default tablespace for ctxsys
TEMP - is the temporary tablespace for ctxsys
LOCK|NOLOCK - ctxsys user account will be locked or not

2. The next step is to install appropriate language-specific default preferences. There is script which creates language-specific default preferences for every language Oracle text supports in /ctx/admin/defaults directory, such as English(US), Danish(DK), Dutch(NL), Finnish(SF), French(F), German(D), Italian(IT), Portuguese(PT), Spanish(E), and Swedish(S). They are named in the form drdefXX.sql, where XX is the international license plate code.
To manually install US default preferences, for example, log into sqlplus as CTXSYS, and run 'drdefus.sql' as described below:

SQL> connect CTXSYS/password@tns_alias
SQL> @?/ctx/admin/defaults/drdefus.sql
SQL> spool off

If you have installed Oracle Data Mining (ODM) before Text you will see in the text_install.txt logfile ORA-955 errors for public synonyms, e.g. dm_svm_build, which can be ignored. We have a dummy package that mimics the API in CTXSYS schema, and we attempt to create public synonyms to it. Now, if ODM has been installed, these public synonym creates fail and the public synonyms point to ODM objects, which is what we want.


Text 10gR1 (10.1.0.x) and Text 10gR2 (10.2.0.x) Installation verification


1. Check to make sure that all Text objects were created in CTXSYS schema and correct version is installed
2. Check to make sure that there are not invalid objects for CTXSYS.
You should get: "no rows selected". If there are then you can compile each invalid object manually.


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

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 owner='CTXSYS';

-- Get a summary count
select object_type, count(*) from dba_objects where owner='CTXSYS' group by object_type;

-- Any invalid objects
select object_name, object_type, status from dba_objects where owner='CTXSYS' and status != 'VALID' order by object_name;

spool off


Steps to Deinstall Oracle Text Manually


Before deinstalling Oracle Text, it is best to first drop all Text Indexes built in schemas other than CTXSYS. Text dictionary, schema name CTXSYS, 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

Review the output file text_deinstall.log for errors.
Deinstallation of Oracle Text is complete.

*** Note ***
ORA-04043 for dropping sys.validate_context can be ignored, as in base release version this procedure was owned by ctxsys and needs to be owned by sys.

Related Posts:
  1. Introduction of ORACLE TEXT
  2. Find Text index size

2 comments:

Anonymous said...

Thanks. Really helpful scripts. worked a treat to help me diagnose and fix a missing text indexing component on 11gr2

Damir Vadas said...

Good info!