prev next

PLS-00201: identifier 'DBMS_LOB' must be declared error while installing Oracle Text

Repeatedly i get tasks to install Oracle Text manually in 10g databases. Metalink note 280713.1 is something that is intended for this task. Everytime after installation, i get my Oracle Text component as invalid in database.

SQL> select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT';
COMP_NAME
STATUS VERSION
-------------------------------------------------------------- ----------
Oracle Text INVALID 10.2.0.4.0

Reason being,

SQL> select object_name, object_type, status from dba_objects
where owner='CTXSYS' and status != 'VALID'
order by object_name;
2 3
OBJECT_NAME OBJECT_TYPE STATUS
--------------------------------------------------------------------------------
CTX_DOC PACKAGE BODY INVALID

CTX_REPORT PACKAGE BODY INVALID

DRIDOC PACKAGE BODY INVALID

DRIREP PACKAGE BODY INVALID

DRVDOC PACKAGE BODY INVALID

DRVIMR PACKAGE BODY INVALID

Tried this to fix,

SQL> show user
USER is "SYS"
QL> alter package ctxsys.CTX_DOC compile body;
Warning: Package Body altered with compilation errors.
SQL> show err
No errors.
SQL> connect ctxsys/*****
Connected.
SQL> alter package CTX_DOC compile body;
Warning: Package Body altered with compilation errors.
SQL> show err
Errors for PACKAGE BODY CTX_DOC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
389/7 PL/SQL: Statement ignored
389/7 PLS-00201: identifier 'DBMS_LOB' must be declared
SQL> connect / as sysdba
Connected.
SQL> grant execute on sys.DBMS_LOB to ctxsys;
Grant succeeded.
SQL> connect ctxsys/winter08
Connected.
SQL> alter package CTX_DOC compile body;
Package body altered.
SQL> show err
No errors.
SQL> select object_name, object_type, status from dba_objects
where owner='CTXSYS' and status != 'VALID'
order by object_name;
no rows selected

Compiled all the invalid objects but still...

SQL> select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT'; 2
COMP_NAME
STATUS VERSION
-------------------------------------------------------------- ----------
Oracle Text INVALID 10.2.0.4.0

Fix
1) De-install Oracle Text using the same metalink note (
280713.1).
2) Execute the following statement from another session immediately after firing the Oracle text installation script (
@?/ctx/admin/catctx.sql CTXSYS SYSAUX TEMP NOLOCK)

SQL> grant execute on sys.DBMS_LOB to ctxsys;

Grant succeeded.
This would assign the required privilege to CTXSYS user immediately after oracle text creation script and by the time script finishes, it already has the privilege and objects won't get invalidated.

Another method to fix it is
The instalalltion script (
@?/ctx/admin/catctx.sql) calls another script (@?/ctx/admin/ctxsys.sql) to create CTXSYS user for Oracle Text installation. This (ctxsys.sql) script creates CTXSYS user and assign the required privileges for installation. Just at the start of script where this script assigns privileges to CTXSYS user, add the following line (to ctxsys.sql script)

SQL> grant execute on sys.DBMS_LOB to ctxsys;

Once done,install Oracle Text. This installation will not invalidate the package bodies and the instalallation would be valid.

SQL> select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT'; 2
COMP_NAME
STATUS VERSION
-------------------------------------------------------------- ----------
Oracle Text VALID 10.2.0.4.0


Cheers...!!!

--Rishi

4 comments:

  1. Thanks! This did exactly what I was hoping it would! Kristin - Minneapolis, MN (US)

    ReplyDelete
  2. Rishi..Thank You for the detail explanation.

    ReplyDelete

Review my blog

Hits since creation