|Oracle® Text Application Developer's Guide
10g Release 1 (10.1)
Part Number B10729-01
This chapter covers issues relating to migrating your applications from previous releases of Oracle Text. It also contains a note on migrating back from the current release.
In previous versions of Oracle Text,
CTXSYS had DBA privileges. To tighten security and protect the database in the case of unauthorized access,
CTXSYS now has only
RESOURCE roles, and only limited, necessary direct grants on some system views and packages. Some applications using Oracle Text may therefore require minor changes in order to work properly with this security change. Here are the major effects of the security improvements, their possible effects on Oracle Text applications, and the steps needed to ensure proper operation in Oracle Database 10g.
CTXSYS no longer has DBA permissions. This may affect indexes using
PROCEDURE_FILTER, or USER_LEXER objects. For example, suppose that you have an index using a USER_DATASTORE whose procedure is
CTXSYS.PROC, and that that procedure refers to other schemas' objects:
create procedure proc(r in rowid, d in out nocopy clob) is begin select text into l_data from scott.example ...
Previously, this user datastore would have worked properly because
CTXSYS was able to select from any table—namely,
SCOTT.EXAMPLE. However, in Oracle Database 10g,
CTXSYS does not have DBA privileges and is not allowed to select from
SCOTT.EXAMPLE. This makes the procedure PROC invalid, which leads to errors when indexing or sync is done for this index.
To resolve this problem, Oracle recommends migrating all user datastores, procedure filters, and user lexers from
CTXSYS-owned procedures to index-owner-owned procedures (see "Migrating CTXSYS-Owned Procedures").
Here are the steps to migrate an index using a
CTXSYS-owned procedure to use an index-owner-owned procedure:
Create a procedure owned by the index owner that is equivalent to the
CTXSYS-owned procedure. If your application's
CTXSYS-owned procedure simply calls another procedure owned by the index owner, use that procedure for step 2. Otherwise, copy the code from the
CTXSYS-owned procedure into a new procedure owned by the index owner, making any needed changes for the change in schema.
Create a new user datastore, procedure filter, or user lexer preference that uses the index-owner-owned procedure. Alternatively, you can modify the existing preference using
CTX_DDL.SET_ATTRIBUTE, if the preference used to create the index still exists.
Replace the existing datastore or filter or lexer with the new, updated preference using the new
REPLACE METADATA command. For instance, to replace a user datastore:
alter index <myindex> rebuild parameters ('replace metadata datastore <new_datastore_preference>');
REPLACE METADATA does not rebuild the index, so this command will not affect existing index data.
See Also:"Migrating Back to Previous Releases"
In previous versions of Oracle Text, the effective user during indexing or sync was
CTXSYS. As a result,
CTXSYS required execute permission on all BFILE directories, execute permission on any procedures called from user datastores, procedure filters, or user lexers, and the
TEMP tablespace was used during indexing. In Oracle Database 10g, the effective user during indexing is the index owner, which eliminates these caveats.
Previously, procedures used in user datastores, procedure filters, and user lexers had to be owned by
CTXSYS. In Oracle Database 10g, these procedures can be owned by any schema, so long as the index owner has execute privileges on them.
This principally affects creation of preferences. In previous releases of Oracle Text, a user datastore created with:
would have used the procedure
CTXSYS.PROC. However, in Oracle Database 10g, standard Oracle Database rules are applied to the input "PROC," and this resolves to
USER.PROC. Any application code that creates user datastores, procedure filters, or user lexers should either create the preferences as the owner of the procedure, or prepend the correct owner name to the procedure name. For example:
In previous versions of Oracle Text, only the owner of the index and
CTXSYS were allowed to sync or optimize an index through
CTX_DDL.OPTIMIZE_INDEX. In Oracle Database 10g, any user with the
ALTER ANY INDEX system privilege is also allowed to sync or optimize any index.
Most public CTX packages, such as
CTX_REPORT, are now invoker's rights packages.
In Oracle Database 10g, if a text index is created by one user for another user, or if the create index statement is issued from a PL/SQL block, the index owner must be granted the
CREATE TABLE privilege in order for the indexing to succeed. Even if the index owner has the
CREATE TABLE must be specifically granted.
During the upgrade to Oracle Database 10g, Oracle Text drops a number of procedures belonging to
CTXSYS. (These procedures are invalid under Oracle Database 10g and have the name format
$U.) If you migrate back to a pre-10g release of Oracle Database, you must re-create these procedures in order for DML to work. To do this, after the backward migration—once all the pre-10g packages have been reinstalled—rename each
CTXCAT index; the rename code will re-create that procedure. (You can rename the procedures back if you want to retain the original names).