Recreating indexes of type: ctxsys.context

For a database on Oracle 10g, I need to output a script that recreates all indexes of type of ctxsys.context type. I can do it running this query:
SELECT owner, index_name, DBMS_METADATA.get_ddl('INDEX', index_name, owner)
FROM all_indexes
WHERE ityp_owner = 'CTXSYS' AND ityp_name = 'CONTEXT';However, if an index has parameters like this:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('sync (every "FREQ=DAILY; BYHOUR=1")')
NOPARALLEL;If I run DBMS_METADATA.get_ddl function, I get this output script:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT;How to include the parameter line?
Edited by: user521219 on 06-nov-2012 9:55

>
For a database on Oracle 10g, I need to output a script that recreates all indexes of type of ctxsys.context type. I can do it running this query:
SELECT owner, index_name, DBMS_METADATA.get_ddl('INDEX', index_name, owner)
FROM all_indexes
WHERE ityp_owner = 'CTXSYS' AND ityp_name = 'CONTEXT';
However, if an index has parameters like this:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('sync (every "FREQ=DAILY; BYHOUR=1")')
NOPARALLEL;
If I run DBMS_METADATA.get_ddl function, I get this output script:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT;
How to include the parameter line?
>
When you post always provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION); 10g is not a version.
Works for me on Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
  CREATE INDEX "SCOTT"."NDX_TEST_CONTEXT" ON "SCOTT"."DEPT" ("DNAME")
   INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('sync (every "FREQ=DAILY; BYHOUR=1")')Post information about which user is running that query and which user owns the index that is giving the problem.
Have you tried the query using a DBA user?

Similar Messages

  • Oracle Text, create index (indextype is ctxsys.context)

    Dear sirs,
    I am a new user of Oracle Text (Oracle 11g release 11.2) and I am unable to create an index of type ctxsys.context). Any suggestions?:
    code:
    drop table mytable;
    drop index myindex force;
    create table mytable(id number primary key, docs clob);
    insert into mytable values(111555,'this text will be indexed');
    insert into mytable values(111556,'this is a default datastore example');
    commit;
    create index myindex on mytable(docs)
    indextype is ctxsys.context
    parameters ('DATASTORE CTXSYS.DEFAULT_DATASTORE');
    +++++++
    error messages:
    create index myindex on mytable(docs)
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366

    Please check for invalid objects. Log on as sys or system and run:
    select owner, object_name, object_type from all_objects where status='INVALID';
    Post the results here and we'll advise the next step.
    If any objects owned by CTXSYS are invalid you may need to recompile the CTXSYS schema.

  • Question: create index indextype is ctxsys.context whith NOLOGGING

    Dear All,
    I would like to ask a question about
    CREATE INDEX <index_name> ON <table_name> ( <index_col> ) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ( ... )maybe you experienced that ctxsys.context index creation takes long time.
    When you create a ctxsys.context index it is obvious to reduce the workload of the RDBMS. In this case I would like to reduce the I/O load with NOLOGGING option.
    Firstly, I try to put the index into a tablespace with no logging option. I don't know why but it is not working. Watching the alert.log file I diagnose that redo log generated simultaneously while index generated (there are no other activity on RDBMS).
    Q1 (optional): Why generating redo on object of NOLOGGING tablaspace ?
    I think there are better solution: use the NOLOGGIN option of the create index command which is very simple to use at column indexes.
    Which unclear to me how should I use in CREATE INDEX .. INDEXTYPE IS CTXSYS.CONTEXT command.
    Fllowing the CREATE INDEX command syntax seems oubvious - but it provides sytax error.
    Maybe this is why CREATE INDEX .. INDEXTYPE IS CTXSYS.CONTEXT needs something different for options: PL/SQL
    example captured (for options):
    begin
    ctx_ddl.create_preference ('mystore', 'BASIC_STORAGE');
    ctx_ddl.set_attribute ('mystore', 'I_INDEX_CLAUSE', 'tablespace users storage (initial 32k) compress 2');
    end;
    CREATE INDEX docs_idx ON my_docs(doc) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('STORAGE mystore');Q: How can I specify NOLOGGING option? In the index command? In the attribute? What is the exact syntax if NOLOGGING is allowed at ctxsys.context?
    Oracle version: 11.1.0.6.0
    Any advice, highly appreciated.
    Istvan

    You have to specify nologging in  storage preference.
    See Avoiding Redo Logging for an Oracle Text Domain Index (Doc ID 432762.1)
    Example:
    begin
    ctx_ddl.drop_preference('my_storage');
    end;
    begin
    ctx_ddl.create_preference('my_storage','BASIC_STORAGE');
    end;
    begin
    ctx_ddl.set_attribute('my_storage', 'i_table_clause','tablespace foo1 storage (initial 5M next 10M pctincrease 0 freelists 24 freelist groups 24) nologging');
    ctx_ddl.set_attribute('my_storage', 'k_table_clause','tablespace foo2 storage (initial 5M next 10M pctincrease 0) nologging');
    ctx_ddl.set_attribute('my_storage', 'r_table_clause','tablespace foo3 storage (initial 5M next 10M pctincrease 0) lob(DATA) store as (nocache nologging) nologging');
    ctx_ddl.set_attribute('my_storage', 'n_table_clause','tablespace foo4 storage (initial 5M next 10M pctincrease 0) nologging');
    ctx_ddl.set_attribute('my_storage', 'p_table_clause','tablespace foo5 storage (initial 5M next 10M pctincrease 0) nologging');
    ctx_ddl.set_attribute('my_storage', 'i_index_clause','tablespace foo6 storage (initial 5M next 10M pctincrease 0) compress 2 nologging');
    end;

  • Ctxsys.context index on registered schema xmltype column

    9iR2
    Is it possible to create a text index (indextype is ctxsys.context) on a schema registered xmltype column?
    I tried it, the index creation works fine.
    After the first insert statement the Oracle process seems to hang. (CPU 100%, increasing memory consumption)

    Yes, I previously entered some data.
    Test case:
    1. register schema
    begin
    DBMS_XMLSCHEMA.REGISTERSCHEMA('http://localhost/JobPositionSeeker-1_1.xsd',
    getDocument('JobPositionSeeker-1_1.xsd'), TRUE, TRUE, FALSE, FALSE
    end;
    2. create table
    CREATE TABLE application_xml of XMLType
    XMLSCHEMA "http://localhost/JobPositionSeeker-1_1.xsd" ELEMENT "JobPositionSeeker"
    3. entered some data
    4. created the index
    create index applicant on application_xml ( SYS_NC_ROWINFO$)
    indextype is ctxsys.context
    5. select using index
    select value(a).getClobVal() from application_xml a
    where contains( value(a),'%ai% INPATH(//PersonalData/PersonName/FamilyName)')>0
    6. insert another record
    -> crash

  • Creating CTXSYS.CONTEXT type index for orddoc

    Hi,
    We tried to create a index for a orddoc datatype , the syntax used was as below
    CREATE INDEX CIX_DLX_ASSET1 ON DLX_ASSET(TEXT_ASSET.source.localdata) INDEXTYPE IS CTXSYS.CONTEXT;
    where DLX_ASSET is the table name and TEXT_ASSET is of the type Orddoc.
    When we tried to create the index we are getting the below error message
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 204
    But the index is being created but it is not proper and contain query doesnot work properly on it
    However we were able to create an index for TEXT_ASSET.comments as below
    CREATE INDEX CIX_TBL_ASSET1 ON TBL_ASSET(TEXT_ASSET.comments) INDEXTYPE IS CTXSYS.CONTEXT;
    The step we had followed are as below
    Granted required permission to the User owning the index.
    GRANT CTXAPP to User
    GRANT EXECUTE ON CTX_CLS TO User;
    GRANT EXECUTE ON CTX_DDL TO User;
    GRANT EXECUTE ON CTX_DOC TO User;
    GRANT EXECUTE ON CTX_OUTPUT TO User;
    GRANT EXECUTE ON CTX_QUERY TO User;
    GRANT EXECUTE ON CTX_REPORT TO User;
    GRANT EXECUTE ON CTX_THES TO User;
    All the package of the ctxsys is complied
    The ctxsrv has been stared as below
    ctxsrv -user ctxsys/ctxsys
    and is up and runing.

    Dear
    Here are the error explanations;
    ORA-06502:     PL/SQL: numeric or value error string
    Cause:     An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
    Action:     Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
    ORA-29855:
         error occurred in the execution of ODCIINDEXCREATE routine
    Cause:      Failed to successfully execute the ODCIIndexCreate routine.
    Action:      Check to see if the routine has been coded correctly.Ogan

  • Cannot create ctxsys.context type index : ORA-29855 ORA-20000 DRG-11206 ...

    Hello everybody,
    I have from time to time to create Intermedia or Oracle text indexes in Oracle databes, most 10g ones.
    Today I did it in a Oracle 10g under Linux RHEL 5, with this few usual commands:
    1) connect SYS/**** as SYSDBA;
    2) CREATE TABLESPACE "DRSYS" LOGGING DATAFILE '/path_to_index_files/drsys.ora' SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;
    3) @$ORACLE_HOME/ctx/admin/catctx.sql ctxsys DRSYS TEMP NOLOCK
    4) connect ctxsys/ctxsys;
    5) @$ORACLE_HOME/ctx/admin/defaults/drdeff.sql;
    6) connect sa/*****;
    7) CREATE INDEX pj_index ON sa.tpiecejointe(pjcontenu) INDEXTYPE IS ctxsys.context parameters ('sync (every "SYSDATE+12/24")');
    My issue occured at the 7th step:
    CREATE INDEX pj_index ON sa.tpiecejointe(pjcontenu) INDEXTYPE IS ctxsys.context parameters ('sync (every "SYSDATE+12/24")')
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-11206: user filter command /dk2/app/oracle/ctx/bin/ctxhx could not be
    executed
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
    /dk2/app/oracle/ctx/bin/ctxhx is ok and may be executed by anyone.
    I found no reason for this problem on the Web.
    If somebody can help, thanks a lot...
    Thomas

    Hi,
    for using the sync parameter, the user needs to be granted to execute a job. Oracle makes a job to do the sync. So issue:
    GRANT CREATE JOB TO SMADMIN;
    from SYS/SYSTEM.
    Herald ten Dam
    superconsult.nl

  • Ctxsys.context index creation :ORA-01031: insufficient privileges on sys.XMLType

    Hi,
    in the following enviroment:
    Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
    With the Partitioning option
    JServer Release 9.0.1.1.1 - Production
    On an MS 2K box
    I experience the following problem:
    if I create a table
    create table test(c type);
    where type is varchar2 o clob I then succesfully issue this
    command:
    create index test_ctx on test(c) indextype is ctxsys.context;
    but if type is sys.XMLType I get :
    ORA-01031: insufficient privileges.
    Any suggestion
    Thanks
    Alex

    Under user sys as sysdba the following happens:
    SQL> create table test(c XMLType);
    Table created.
    SQL> create index test_ctx on test(c) indextype is
    ctxsys.context;
    create index test_ctx on test(c) indextype is ctxsys.context
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE
    routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drixtab.create_index_tables
    ORA-00955: name is already used by an existing object
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 176

  • Indexing pdf documents with indextype ctxsys.context

    I have an application that stores the contents of uploaded documents in BLOB data fields. We provide web pages which search through the uploaded documents based on text entered by the user. We currently upload both MS Word .doc and HTML documents. For the HTML documents, which are made available to the public, we index the table with the following procedure:
    CREATE OR REPLACE procedure WEBADMIN.index_redacted_docs is
    begin
    declare
    cur           PLS_INTEGER;
    exec_int           PLS_INTEGER;
    counter          number;
    begin
    select count(*) into counter
    from user_indexes
    where index_name = 'DOCS_CTX_REDACTED_IDX';
    if (counter = 1) then
    ctx_ddl.sync_index (idx_name => 'docs_ctx_redacted_idx');
    else
    cur := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (cur, 'create index docs_ctx_redacted_idx on documents_ctx_redacted (blob_content) ' ||
         'indextype is ctxsys.context parameters (''filter ctxsys.null_filter'')', DBMS_SQL.NATIVE);
    exec_int := DBMS_SQL.EXECUTE (cur);
    DBMS_SQL.CLOSE_CURSOR (cur);
    end if;
    exception
    when others then
         DBMS_SQL.CLOSE_CURSOR (cur);
         raise;
    end;
    end;
    We run this process after every uploaded HTML file and are able to locate documents which contain any text entered by the user. The portion of the command we use to query the documents_ctx_redacted table (blob_content is the BLOB field in this table) is (using "corn" as a sample query text):
    WHERE (contains (BLOB_CONTENT, 'corn', 10) > 0)
    Our customer is now asking that PDF files be uploaded as well and searched in the same manner. After the PDF files are uploaded (into the same table as the HTML files) and the index updated, with the above command ctx_ddl.sync_index (idx_name => 'docs_ctx_redacted_idx'), since the index already exists, we cannot get any rows returned with the above WHERE (contains .... ) clause. We know the text we're looking for (such as "corn") is contained in the PDF files, but the search does not find them, although it finds the HTML documents just fine. I've also tried dropping the index entirely and recreating it, but that also only finds the HTML documents but not the PDF's.
    What are we doing incorrectly with the PDF files? Thanks.

    We are using Oracle version 10.2 . I looked at the relevant Oracle Text documentation for that version, and the best I could glean was that PDF files are supported by the filter ctxsys.auto_filter (rather than null_filter) when creating the index. I dropped the existing null_filter index and created a new index with the auto_filter parameter, but the end result was the same. I still get no PDF records found when issuing the command (using "corn" as the text query)
    WHERE (contains (BLOB_CONTENT, 'corn', 10) > 0)
    although the HTML records show up fine again.

  • Error in Updating ctxsys.context index using ctxsrv

    Environment :
    Linux 6.2,
    Oracle 8.1.6
    character set : zhs16gbk or zhs16cgb231280
    I can create an ctxsys.context index(using CHINESE_VGRAM_LEXER) on a long column, and i can rebuild this index with no parameters.
    When i want to rebuild this index automatic using ctxsrv, this error occur ---
    DRG-50857 Oracle error in drtldml(dml)
    Ora-2000 error
    anybody can help me?
    null

    the complete error:
    Dml batch: cid=1023
    End batch: return code is 1
    DRG-50857: oracle error in drtldml(dml)
    ORA_20000: interMedia text 4mNs
    DRG-50857: oracle error in drsxsopen
    ORA-01480: STR83V51dA?H1IY?U:sW:
    null

  • Create index ctxsys.context error

    hello,
    I'm trying to set up a text index on oracle 8i and I don't know too much about interMedia. Through SQLPlus i tried:
    create index ix_recordtitle on record(recordtitle) indextype is ctxsys.context;
    and got the error:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-50704: Net8 listener is not running or cannot start external procedures
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512: at line 1
    so my question is, is interMedia a standard package/service that is installed w/ oracle 8i, or does it need to be installed? Or am I missing something else?
    thanks in advance for any help,
    -derek

    That is, you have to have a listener tthat will listen to IPC, with topic 'extproc'. In tnsnames.ora, it looks much like this:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <my host>)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (PROTOCOL_STACK =
    (PRESENTATION = TTC)
    (SESSION = NS)
    (CONNECT_DATA =
    (SERVICE_NAME = <my sid>)
    # blah-blah
    SID_LIST_LISTENER =
    (SID_LIST =
    # other addresses' blah-blah here
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = <oracle home path>)
    (PROGRAM = extproc)
    null

  • Indextype is ctxsys.context

    hi all,
    i've a problem with index with ctxsys.context index
    i created it on a table has a field (description of a certain component)
    the field's type is VARCHAR2(256)
    The query performed is
    select count(*) from Loaded_Table_Test
    where contains(F8,'%Resistor%') > 0;
    it returns many records
    THE PROBLEM IS
    after many days of perfoming the same query it seems like its
    not working :the query returns nothing
    I wounder if anybody can help me,Thanks in advance
    Rasha Fayez

    Does it return an error message? If you're doing this in a application,
    try it in SQL*Plus to see.
    Most likely reason for this is that you're getting "query too complex".
    This could start happening, even though the query used to work, if more records
    have been added to the table and therefore increased the number of
    expansions for '%resistor%'.
    Double truncation like this is not generally a good idea. Even if you don't
    get the 'query too complex error', the query will perform poorly unless you
    have the SUBSTRING_INDEX option in use.
    - Roger

  • Oracle Text, ctxsys.context problem with number column

    Hi,
    DB 11.2.0.3
    Is there any solution to create ctxsys.context index on number column ? Or I have to create other index type ?
    When I try do that (create ctxsys.context index), I get
    09:01:18  ORA-29855: wystąpił błąd przy wykonywaniu podprogramu ODCIINDEXCREATE  (An error has occurred in the performance of the subprogram)
    09:01:18  ORA-20000: Oracle Text - błąd: (- error:)
    09:01:18  DRG-10509: niepoprawna kolumna tekstowa: ITEM_TYPE (invalid text column:)
    09:01:18  ORA-06512: przy "CTXSYS.DRUE", linia 160
    09:01:18  ORA-06512: przy "CTXSYS.TEXTINDEXMETHODS", linia 366Btw, is there possible to search like "*LIKE %123%*" clause any of index (in contains) ?
    Edited by: Ndejo on 2012-11-21 00:53

    The multi_column_datastore says that the text to be indexed should be fetched from the supplied COLUMNS list rather than from the actual column the index is created on.
    So in this case we're fetching the contents of "theNumber" column, converting it to text, and indexing it.
    You don't necessarily need a dummy column, if "a_title" is a varchar column you could create the index on that instead.
    For example:
    SQL> create table mytab( a_id number, a_code number, a_title varchar2(80), a_subtitle varchar2(80), a_info clob );
    Table created.
    SQL> insert into mytab values ( 12, 9812376, 'foo is the title',
      2  'foobar is the subtitle', 'the info column will not be indexed' );
    1 row created.
    SQL> exec ctx_ddl.drop_preference( 'myds' )
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.create_preference( 'myds', 'MULTI_COLUMN_DATASTORE' )
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute( 'myds', 'COLUMNS', 'a_code, a_title, a_subtitle' )
    PL/SQL procedure successfully completed.
    SQL> create index myindex on mytab (a_title) indextype is ctxsys.context
      2  parameters ('datastore myds');
    Index created.
    SQL> select a_id from mytab where contains (a_title, '%123%') > 0;
          A_ID
            12
    SQL> select a_id from mytab where contains (a_title, 'foo') > 0;
          A_ID
            12If you want to be able to search within a particular column, then add "section group CTXSYS.AUTO_SECTION_GROUP" to the parameters clause, and you can then do:
    SQL> select a_id from mytab where contains (a_title, 'foobar WITHIN a_subtitle') > 0;
          A_ID
            12

  • Indexing error in CTXSYS.INSO_FILTER

    hi,
    Do you know, how can i correctly creat the index in oracle text? I have created a text table:
    CREATE TABLE texttable(text_id int PRIMARY KEY not null, titel varchar2(500), author varchar2(20), datum date, text_size int, text_typ varchar2(10), content CLOB)
    I have inserted the documents in content column. text_typ column is the format column (text or binary)help for the filtering. I want to create an index for the column content.
    CREATE INDEX oracle_index ON texttable(content) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('
    DATASTORE CTXSYS.DEFAULT_DATASTORE
    FILTER CTXSYS.INSO_FILTER format column text_typ
    LEXER oracle_lexer_intern
    WORDLIST oracle_wordlist_intern
    I get always the erro message:
    java.sql.SQLException: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-11000: invalid keyword CTXSYS.INSO_FILTER
    ORA-06512: in "CTXSYS.DRUE", line 157
    ORA-06512: in "CTXSYS.TEXTINDEXMETHODS", line 186
    I don't understand why inso_filter is an invalid keyword. I have seen the same example for INSO_FILTER in the documentation Oracle Text Reference Release 9.2.
    How can I solve the problem? Can you give me any suggestions?
    Thank you very much. Greetings from Germany.
    rabbit

    Hi roger,
    thank you for your help. I think, i am not getting any line-feeds or other funny characters included in my "PARAMETERS" string. I have only set the attributs for lexer and wordlist. It is not a problem with CTXSYS.INSO_FILTER.
    For creating the index i have written the following java programm:
    public class OracleText_intern {
    public Connection connect() throws Exception{
    //OCI-Driver is used
    //I have used autocommit
    public String index_vorbereitung (Connection conn) throws Exception{
    CallableStatement cstmt;
    Statement stmt = conn.createStatement();
    cstmt = conn.prepareCall("{call ctx_ddl.drop_preference(?)}");
    cstmt.setString(1, "oracle_lexer_intern");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.create_preference(?, ?)}");
    cstmt.setString(1, "oracle_lexer_intern");
    cstmt.setString(2, "BASIC_LEXER");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_lexer_intern");
    cstmt.setString(2, "base_letter");
    cstmt.setString(3, "yes");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_lexer_intern");
    cstmt.setString(2, "index_stems");
    cstmt.setString(3, "german");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_lexer_intern");
    cstmt.setString(2, "printjoins");
    cstmt.setString(3, "_-");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.drop_preference(?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.create_preference(?, ?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.setString(2, "BASIC_WORDLIST");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.setString(2, "stemmer");
    cstmt.setString(3, "German");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.setString(2, "fuzzy_match");
    cstmt.setString(3, "German");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.setString(2, "substring_index");
    cstmt.setString(3, "true");
    cstmt.execute();
    cstmt = conn.prepareCall("{call ctx_ddl.set_attribute(?, ?, ?)}");
    cstmt.setString(1, "oracle_wordlist_intern");
    cstmt.setString(2, "prefix_index");
    cstmt.setString(3, "true");
    cstmt.execute();
    String index_str = "CREATE INDEX oracle_index_intern ON texttable_intern(content)" +
    "INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('" +
    "DATASTORE CTXSYS.DEFAULT_DATASTORE" +
    "FILTER CTXSYS.INSO_FILTER format column text_typ"+
    "LEXER oracle_lexer_intern" +
    "WORDLIST oracle_wordlist_intern" +
    cstmt.close();
    return index_str;
    public void textmessung(Connection conn, String indexstr) throws Exception {
    for(int i=1; i<12; i++){
    if (i==1) {stmt.execute(indexstr);}
    else {stmt.execute("ALTER INDEX oracle_index_intern REBUILD PARALLEL");}
    public static void main(String[] args) throws Exception{
    String index_str = ortext.index_vorbereitung(con);
    ortext.textmessung(con, index_str);
    I can not find the error. Can you still give me little suggestions?
    Thank you very much and greeting from germany
    rabbit
         

  • CTXSYS.CONTEXT = Deactivate MINUS function

    Hi all,
    I would like to deactivate or to find a workaround to not use the MINUS function in a search based on the following index :
    CREATE INDEX DOCUMENT_IDX ON DOCUMENT
    (BLOB_CONTENT)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('FILTER ctxsys.auto_filter SYNC (ON COMMIT)');
    My table DOCUMENT contains three columns (file_id, file_name, blob_content)
    For example, when i search 'DNG-104', i get all files containing 'NXL' MINUS '104'
    but i would like to get files with 'DNG-104'.
    Is there a workaround to solve my issue?
    Regards,
    Grégory

    Did you try to put curly braces around your search words:
    SELECT contains (blob_content, '{DNG-104}') sc,
           document.*
      FROM document
    WHERE contains (blob_content, '{DNG-104}') > 0

  • DRG-50857 and ORA-12838 error while INDEXTYPE IS CTXSYS.CONTEXT

    Hi Experts,
    I've been encountering an issue while creating INDEX.
    If I execute the below script from SQLDEVELOPER line by line, then the index gets created but the weirdest thing is, if I executed the same as one sql file from SQLPLUS or SQLDEVELOPER, I get the error shared below. As we need to deliver as one sql file to customer, how can we fix this issue?
    Below is the content of my sql file
    ALTER SESSION ENABLE PARALLEL DML;
    ALTER SESSION FORCE PARALLEL QUERY;
    CREATE INDEX APPS.TEST_N1 ON APPS.EMP_TABLE
        EMP_NAME
      INDEXTYPE IS CTXSYS.CONTEXT PARALLEL 32;
    ALTER INDEX APPS.TEST_N1 NOPARALLEL;
    COMMIT;
    Below is the error
    Session altered.
    Elapsed: 00:00:00.00
    Session altered.
    Elapsed: 00:00:00.00
    CREATE INDEX APPS.TEST_N1 ON APPS.EMP_TABLE
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in dripref.set_preferences
    ORA-12838: cannot read/modify an object after modifying it in parallel
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366
    Elapsed: 00:00:02.82
    Index altered.
    Elapsed: 00:00:00.01
    Commit complete.

    I get the same error in 11g, as shown below, but not in 12c, as shown below that.  So, it looks like there has been a change in the way that Oracle Text does things between versions.  When you create an Oracle Text Context index, it creates some domain index tables.  Apparently there is some change involved behind the scenes in the dripref.set_preferences procedure that perhaps does an append or some such thing.  If you post this question in the Text space/sub-forum, with a link to this thread, you may get a more detailed explanation and perhaps a workaround from Oracle Text product manager Roger Ford or others.  Or, perhaps some moderator will move this thread there.
    SCOTT@orcl> SELECT banner FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0    Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl> CREATE TABLE emp_table AS SELECT ename emp_name FROM emp;
    Table created.
    SCOTT@orcl> ALTER SESSION ENABLE PARALLEL DML;
    Session altered.
    SCOTT@orcl> ALTER SESSION FORCE PARALLEL QUERY;
    Session altered.
    SCOTT@orcl> CREATE INDEX SCOTT.TEST_N1 ON SCOTT.EMP_TABLE
      2    (
      3       EMP_NAME
      4    )
      5    INDEXTYPE IS CTXSYS.CONTEXT PARALLEL 32;
    CREATE INDEX SCOTT.TEST_N1 ON SCOTT.EMP_TABLE
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in dripref.set_preferences
    ORA-12838: cannot read/modify an object after modifying it in parallel
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366
    SCOTT@orcl> ALTER INDEX SCOTT.TEST_N1 NOPARALLEL;
    Index altered.
    SCOTT@orcl> COMMIT;
    Commit complete.
    SCOTT@orcl12c> SELECT banner FROM v$version;
    BANNER
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    PL/SQL Release 12.1.0.1.0 - Production
    CORE    12.1.0.1.0    Production
    TNS for 64-bit Windows: Version 12.1.0.1.0 - Production
    NLSRTL Version 12.1.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl12c> CREATE TABLE emp_table AS SELECT ename emp_name FROM emp;
    Table created.
    SCOTT@orcl12c> ALTER SESSION ENABLE PARALLEL DML;
    Session altered.
    SCOTT@orcl12c> ALTER SESSION FORCE PARALLEL QUERY;
    Session altered.
    SCOTT@orcl12c> CREATE INDEX SCOTT.TEST_N1 ON SCOTT.EMP_TABLE
      2    (
      3       EMP_NAME
      4    )
      5    INDEXTYPE IS CTXSYS.CONTEXT PARALLEL 32;
    Index created.
    SCOTT@orcl12c> ALTER INDEX SCOTT.TEST_N1 NOPARALLEL;
    Index altered.
    SCOTT@orcl12c> COMMIT;
    Commit complete.

Maybe you are looking for