Trigger calling ctx_ddl.sync_index problem

Dear,
In order to keep my context indexes up-to-date, I'm trying to write a trigger calling this PL/SQL procedure on update/insert/delete statement.
However, there must be a problem in my trigger definition since it gives compilation errors! I don't see what 's wrong!
This is my trigger definition:
=========BEGIN==================
create or replace trigger update_lexicon_expl_nl after insert or delete or update on lexicon begin execute ctx_ddl.sync_index('lexicon_expl_nl'); end;
=========END===================
The compilation error is something like:
"Encountered ctx_ddl when expecting one of the following :=.(@;immediate"
PS. calling 'execute ctx_ddl.sync('myindex') in SQL Plus is workigng OK
Please help.
Dirk

You do not need to trigger that table,there are two way to 'update' index.
1.Alter index your_index_name rebuild.
2.Set up background DML process, which need you work with an DBA or you have ctxsys role.

Similar Messages

  • Calling CTX_DDL.SYNC_INDEX Package but reflected

    Hi All,
    I have a table Customer_Tif_Detail which is having   9383428 rows:
    select count(*) from Customer_Tif_Detail;
    COUNT(*)
    9383428
    And I have a query which taking too much time to execute, below is teh query:
    Select  ZIP_STATUS From Customer_Tif_Detail Ctd Where Ctd.Tif_Name Like '%231079_0068.tif%'
    AND 0= ( select count(*) as CNT From Customer_Document_Detail Cdd Where Cdd.Tif_End Is Null
    And cdd.id = ctd.id AND Cdd.Submit_Flag = 'Y');
    Then I created a Index Type Index, below is the process I did:
    BEGIN
         CTX_DDL.CREATE_PREFERENCE ('tif_details', 'BASIC_LEXER');
        CTX_DDL.SET_ATTRIBUTE ('tif_details', 'PRINTJOINS', '_.');
       END;
    CREATE INDEX idx_customer_tif_name ON Customer_Tif_Detail(tif_name) INDEXTYPE IS CTXSYS.CONTEXT
       PARAMETERS ('LEXER tif_details');
    And I am using below query with using contains, below is query:
    Select  ZIP_STATUS From Customer_Tif_Detail Ctd Where Ctd.Tif_Name contains(tif_name, '%231079_0068.tif%' )
    AND 0= ( select count(*) as CNT From Customer_Document_Detail Cdd Where Cdd.Tif_End Is Null
    And cdd.id = ctd.id AND Cdd.Submit_Flag = 'Y');
    Now its working fine, but when I check from below query them I am gettimg lot of missing data from index:
    select count(*) from dr$IDX_TIF_NAME_CTX$i;
    COUNT(*)
    7953605
    Even I used below CTX_DDL.SYNC_INDEX package to do syncronization even I am getting same records:
       call CTX_DDL.SYNC_INDEX('idx_customer_tif_name', '1073741824');
    what I am missing here to do proper syncronization between index and original data?
    and how miuch memory I need to apply after some insertion goes on Customer_Tif_Detail table to syncronization  index on CTX_DDL.SYNC_INDEX package?
    Thanks

    What is the result of;
    select count(DISTINCT tif_name) from Customer_Tif_Detail;

  • Ctx_ddl.sync_index problem

    Hi,
    When I try to use the ctx_ddl.syn_index procedure to synchronize index I've got the following error:
    ERROR at line 1:
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drekalc
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "CTXSYS.DRIXMD", line 1137
    ORA-01426: numeric overflow
    ORA-06512: at "CTXSYS.DRVXMD", line 206
    ORA-06512: at line 1
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.CTX_DDL", line 649
    ORA-06512: at line 1
    So I turned on the 10046 event to see what exactly the cause of the error. And in the trace file I find the following interesting code:
    PARSING IN CURSOR #6 len=56 dep=1 uid=47 oct=47 lid=47 tim=1254155812380556 hv
    begin ctxsys.drvxmd.AllocateDocids(:1, :2, :3, :4); end;
    END OF STMT
    PARSE #6:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,plh=0,tim=1254155812380556
    BINDS #6:
    Bind#0
    oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
    oacflg=00 fl2=0000 frm=00 csi=00 siz=96 off=0
    kxsbbbfp=00c33b8c bln=22 avl=03 flg=05
    value=3268
    Bind#1
    oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
    oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=24
    kxsbbbfp=00c33ba4 bln=22 avl=01 flg=01
    value=0
    Bind#2
    oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
    oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=48
    kxsbbbfp=00c33bbc bln=22 avl=04 flg=01
    value=152253
    Bind#3
    oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
    oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=72
    kxsbbbfp=00c33bd4 bln=22 avl=00 flg=01
    =====================
    PARSING IN CURSOR #8 len=61 dep=2 uid=48 oct=3 lid=48 tim=1254155812380556 hv=2>
    SELECT IDX_NEXTID FROM DR$INDEX WHERE IDX_ID = :B1 FOR UPDATE
    END OF STMT
    PARSE #8:c=1000,e=0,p=0,cr=0,cu=0,mis=1,r=0,dep=2,og=1,plh=0,tim=12541558123805>
    BINDS #8:
    Bind#0
    oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
    oacflg=03 fl2=1206001 frm=00 csi=00 siz=24 off=0
    kxsbbbfp=00fee97c bln=22 avl=03 flg=05
    value=3268
    EXEC #8:c=2999,e=0,p=1,cr=2,cu=3,mis=1,r=0,dep=2,og=1,plh=2404769607,tim=125415>
    FETCH #8:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=1,dep=2,og=1,plh=2404769607,tim=12541558>
    STAT #8 id=1 cnt=1 pid=0 pos=1 obj=0 op='FOR UPDATE (cr=2 pr=1 pw=0 time=0 us)'
    STAT #8 id=2 cnt=1 pid=1 pos=1 obj=66881 op='TABLE ACCESS BY INDEX ROWID DR$IND>
    STAT #8 id=3 cnt=1 pid=2 pos=1 obj=66882 op='INDEX UNIQUE SCAN DRC$IDX_KEY (cr=>
    CLOSE #8:c=0,e=0,dep=2,type=3,tim=1254155812380556
    EXEC #6:c=13998,e=231027,p=1,cr=2,cu=3,mis=0,r=0,dep=1,og=1,plh=0,tim=125415581>
    ERROR #6:err=6502 tim=1254155812611583
    Then I checked ctxsys.drvxmd.AllocateDocids procedure
    SQL> desc ctxsys.drvxmd
    PROCEDURE ALLOCATEDOCIDS
    Argument Name Type In/Out Default?
    P_IDXID BINARY_INTEGER IN
    P_IXPID BINARY_INTEGER IN
    P_ALLOCSZ BINARY_INTEGER IN
    P_STARTID BINARY_INTEGER OUT
    and executed SELECT IDX_NEXTID FROM DR$INDEX WHERE IDX_ID = 3268 statement to see what this query returned
    SQL> SELECT IDX_NEXTID FROM DR$INDEX WHERE IDX_ID =3268;
    IDX_NEXTID
    2147497630
    I think that a main reason of the error that procedure AllocateDocids tries to return this value through P_STARTID parameter or use this variable to store a value from the above-mentioned query. As appears from documentation the limit of BINARY_INTEGER is 2147483647, so we have exception "numeric overflow".
    Is I am right in conclusions? If yes, is there any workaround to eliminate this error?
    Thanks.

    I would appear you've exceeded the docid limit of 2 billion. That can only happen if you have more than 2 billion rows added or updated in your table.
    Is this likely? Is this a very highly-used table with a huge number of updates?
    The only solution here is to rebuild the index so that allocates new docid values throughout. If the table is large, that obviously could take a while. Is this 11g? If so you can use the "recreate index offline" feature.

  • Will frequent execution of CTX_DDL.SYNC_INDEX causes slow performance

    Hi:
    We currently execute CTX_DDL.SYNC_INDEX every 5 mins (using a DBMS_JOB) to synchronize oracle text indexes on VARCHAR2 columns. We are planning on increasing the frequency to 1 min. It looks like performance will not be impacted based on the information in http://download.oracle.com/docs/html/A95995_01/oraclete.htm.
    My question is has anyone seen database performance problems after increasing the frequency of sync_index.
    Thanks!

    Hi,
    our load is not that big, about 1500 new documents (stored in blob) and about 250 updates on documents. The size varies between 2k and 50MB. Even the biggest one goes fast although "Sync on commit". About 10 seconds to insert and index. BTW running on AIX 5.3 and Oracle 10.2.0.3. What helps in this indexing that we made the parameter for memory for text indexes increased to 128MB.
    Herald ten Dam
    Superconsult.nl

  • Error building procedure with CTX_DDL.SYNC_INDEX

    I am getting the following error when I try to compile a procedure with a call to CTX_DDL.SYNC_INDEX:
    PLS-00201: identifier 'CTX_DDL' must be declared
    The public synonym for CTX_DDL exists and I can run ctx_ddl.sync_index from an anonymous block within SQL*PLUS. I also have other instances where the procedure will compile. The only real difference I can see between the 2 is the one where it will compile has the QUERY REWRITE privilege whereas the one where it will not compile does not. Is there some reason this privilege is required? Or is there something else I need to get this to compile?
    Thank you for any information.

    Hi,
    to see if some records are waiting to be indexed you can query the view CTX_USER_PENDING:
    select * from ctx_user_pending
    where pnd_index_name = 'NOTES_DETAIL4_INDX';If this gives rows, then you need to Synchronize the index. If it give no rows, then all the records are indexed.
    Herald ten Dam
    http://htendam.wordpress.com

  • Caller screen Buttons problem Z10STL100-1

    I have Z10STL100-1 after official update Z10STL100-1/10.3.1.1565 having caller screen Buttons problem these are little above not like it's on 10.2 very below position. I security wipe and restart many times still same position of buttons? See pic attached

    Hello,
    Did you check if there are no objects on that index slide that have a fading transition? You should set the transition for every object to 'No transition'. The transition can be found in the Properties dialog, tab Options.
    Lilybiri

  • HTTP trigger - Calling failed - 9.0.2.10000-71

    Hi,
    I have created a HTTP trigger in Premium licensed UCCX server (9.0.2.10000-71). When I try to call the URL from java application I am getting HTTP error code as “404”. However HTTP trigger calling is working fine in the servers with the version of 8.5.1.11004-25 and 9.0.2.11001-24.
    Do I need to run any patch for the fix?  Please provide suggestion to fix it.
    Thanks
    Rammipriya

    Hi,
    there are multiple issues with this whole setup:
    1. You are getting a 404 status because this script does not return anything. Not a single byte of information. You should probably use a Send HTTP Response step with at least a plain text message.
    2. You cannot use anything from the sun.* packages. There is no exception from this rule. If you were in my team, for writing such code you would be thrown out without any questions asked.
    3. Although I see the point of this application (collect all files from the local file directory referenced by sysprop "uccx.customer.dir" I would not choose a slow and cumbersome protocol like FTP. I mean, if it's already a HTTP application, it would be a lot easier to get the files from the directory, zip them up (remember, both java.util.zip.GZIPOutputStream and java.util.zip.ZipOutputStream are available in JRE at least since 5.0) and send the zipped files over the already established HTTP connection. Fast and easy. 
    G.

  • CTX_DDL.SYNC_INDEX  gives ORA-03113 error

    I am trying to use the CTX_DDL.SYNC_INDEX command in order to update the full Text Index on a table, which contains a word document as a binary object, but I get an ORA-03113 error every time I do this. I get the same error if the table contains an Excel file. It works perfectly OK if the table contains simple text files.

    Hi Barbara - thanks for your response.
    In answer to your questions;
    Oracle version is 9.2.0.1.0
    Table structure is created with following sql;
    CREATE TABLE DOCUMENTFILE
         (DOCUMENTFILEID      NUMBER (10,0) NOT NULL,
         DATA                LONG RAW,
         FILE_SIZE           NUMBER (10,0),
         FILENAME           VARCHAR2 (510),
         ENCRYPTIONKEY           VARCHAR2 (100),
         VALIDATIONKEY           VARCHAR2 (100),
         MIMETYPE           VARCHAR2 (255),
         FILEEXTENSION           CHAR (3),
         DELETED           NUMBER (1,0)
    Index is created with following command
    CREATE INDEX ORGANISATION_TEXT_INDEX
    ON COLLABORATOR.ORGANISATION(ORGANISATION_NAME)
    INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('');
    Resync command is as follows
    EXEC CTX_DDL.SYNC_INDEX('DOCUMENT_TEXT_INDEX');
    I am testing by runing the command via SQL Plus
    In response to question 'Are you using inso_filter or auto_filter? ' - I dont know
    Thanks for your help,
    Peter

  • Is ctx_ddl.sync_index an offline operation?

    Sorry if the answer to this is staring at me in the documentation: I couldn't find it if so.
    We run Standard Edition 11.2.0.1, so RECREATE_INDEX_ONLINE is not available to us.
    Instead, we regularly (about every 2 hours) use ctx_ddl.sync_index to get our Text index to pick up new arrivals in the underlying table.
    My question is where ctx_ddl.sync_index is an online operation or not? Does the table become unsearchable whilst it's happening, in other words? Our resyncs take about 8 seconds to complete, and I haven't been able to test for this because if there is an outage, it's over too quickly to spot. But there's talk about us resyncing more frequently -so if it does make the thing unsearchable for even a few seconds, I think we need to know that!

    See "3.5 Managing DML Operations for a CONTEXT Index"
    at http://download.oracle.com/docs/cd/E11882_01/text.112/e16594/ind.htm#i1007544
    and "SYNC_INDEX"
    at http://download.oracle.com/docs/cd/E11882_01/text.112/e16593/cddlpkg.htm#CCREF0652
    Yes, reading them doesn't make it clear the the existing index is usable, queryable while a Sync is running.
    However, it is apparent that new entries from DML are not visible in the index until the SYNC_INDEX is done. The SYNC_INDEX commits new entries in batches -- so it is concurrent with existing entries being queryable.
    Your Text Indexes may need periodic re-optimization.
    see "OPTIMIZE_INDEX"
    at http://download.oracle.com/docs/cd/E11882_01/text.112/e16593/cddlpkg.htm#i998200
    (OTOH : DROP and CREATE is something which you wouldn't do !)
    Text Indexes aren't really "index structures" in the manner of, say, regular B-Tree indexes. They are actually "Tables" that are seen as Indexes -- somewhat like "Lookup Tables".
    (The last time I worked with Text Indexes was in 8.1.7 , but 11.2 doesn't negate any of my knowledge of Text Indexes).
    Hemant K Chitale

  • CTX_DDL.SYNC_INDEX 'memory' argument

    According to the Oracle Text manual,
    http://download.oracle.com/docs/cd/B28359_01/text.111/b28304/cddlpkg.htm#i998469
    The memory parameter specifies the amount of memory Oracle Text uses for the synchronization operation before flushing the index to disk.
    Does this memory come out of the shared pool, or the PGA?
    I want to allocate as much memory as possible for a one-time index sync following a massive data intake, but I need to know where the memory is coming from.
    Thanks

    According to the Performance FAQ,
    http://www.oracle.com/technology/products/text/x/faqs/imt_perf_faq.html#q21
    It helps to size your SGA downward during an index rebuild to make more room for the indexing process. So the 'memory' referred to in CTX_DDL.SYNC_INDEX must be external to the SGA. That's what I needed to know.

  • Ctx_ddl.sync_index

    The sql below synchronizes all the pending context:
    set echo off
    set heading off
    set feedback off
    set pagesize 50000
    spool c:\sync.sql
    select distinct 'exec ctx_ddl.sync_index(''' || PND_INDEX_OWNER || '.' || PND_INDEX_NAME || ''')' from ctx_pending;
    spool off
    @c:\sync.sql;
    Would it be possible to transform the above code into a procedure?
    So I could run that procedure at regular intervals using dbms_job ?
    Can Anyone translate the above into a procedure ?
    Thanks.

    I've received the procedure from a college:
    create or replace procedure sync_context
    is
    begin
    for s_rec in
    (select distinct pnd_index_owner, pnd_index_name
    from ctx_pending) loop
    execute immediate 'begin ctx_ddl.sync_index('''||s_rec.pnd_index_owner||'.'||s_rec.pnd_index_name||'''); end;';
    end loop;
    end;
    Extra Question:
    As user ctxsys it should be sufficient to execute ctx_dll.sync_index to sync all pending context
    but this does not seem to work properly ??

  • CTX_DDL.SYNC_INDEX gives ORA-03113

    I am trying to use the CTX_DDL.SYNC_INDEX command in order to update the full Text Index on a table, which contains a word document as a binary object, but I get an ORA-03113 error every time I do this. I get the same error if the table contains an Excel file. It works perfectly OIK if the table contains simple text files.
    Message was edited by:
    peterearle

    Please post your question in the Oracle Text forum. This forum is for image, audio video.

  • After a successful home button repair, I've got a buzzing sound when I make or receive calls. No problem with the speaker as I can listen to online radio stations and my music.

    After a successful home button repair on my iPhone 4, I've got a buzzing sound when I make or receive calls. No problem with the speaker as I can listen to online radio stations and my music.

    I guess your definition of a "successful repair" is different from most people's.
    If you got it serviced by Apple, take it back to them.
    If you had it serviced by a 3rd party, Apple won't touch it. Take it back to whoeever fixed it for you.

  • Custom functionality to the telephony buttons which can trigger calls

    Hi everyone,
    I need to add a custom functionality to the telephony buttons which can trigger calls. This will be added to the telephony buttons consult, transfer, warm transfer, dial pad, conference.
    Any idea as to how to proceed with this?
    Thank you in advance.
    Binno Don Thomas

    Hi,
    The buttons are controlled by ToolBar profile in your webclinet profile.
    For creation of the toolbar profile go to
    SPRO >> Customer Relationship Management >> Interaction Center WebClient >> Basic Functions >> Communication Channels >> Define Toolbar Profiles
    If you want to create the button itself for use in the toolbar profile you can go to
    SPRO >> Customer Relationship Management >> Interaction Center WebClient >> Customer-Specific System Modifications >> Define Toolbar Buttons
    Hope this Helps.
    Regards,
    Rajiv

  • Trigger calling procedure, then commit problems

    I am new to this so please forgive my stupidity!
    I have a trigger:
    CREATE OR REPLACE TRIGGER live_account_trigger
       AFTER INSERT
       ON sforce_live_test
       FOR EACH ROW
    BEGIN
       mapsapp.live_account_upsert;
    END live_account_trigger;
    /which calls a procedure:
    CREATE OR REPLACE PROCEDURE live_account_upsert
    AS
       l_page   LONG;
       l_url    VARCHAR2 (1000) := 'http://sfdc-db-d1/~msimonds/live_upsert.php';
    BEGIN
       --COMMIT;
       l_page := UTL_HTTP.request (l_url);
    END;
    /which invokes UTL_HTTP. What this process is supposed to do is set off a trigger to run the script in the procedure which simply inserts new records which are input into the table. Now if I do the following as a test:
    insert into sforce_live_test (customer_name, schedule_id) values ('Fox and the Hound', 8020);
    to kick off the trigger, the information is placed into the table and the script runs (it emails me to tell me it has processed) but the new data is not being sent to salesforce. It seems that it does not perform a COMMIT, becuase if I run the script via my web browser, it runs just fine after I run the script
    What can I do to place a COMMIT into the procedure, because I get an error if I place it on

    Okay that is a little beyond my knowledge at current time, i guess I need to do some research.
    Maybe I need to explain what I am trying to accomplish and you could tell me if the JOB is the best solution before I continue:
    We have an internal sales system which has all our major clients on it. New accounts are created and old accounts are updated from this internal system. Currently there is a view that is updated once every 24 hours from one Oracle DB to my instance of Oracle. I have a series of PHP account scripts that are set on CRON jobs that run once a week to send the new accounts and updated accounts to our instance of Salesforce.com over their API using SOAP
    I created a staging table and the trigger which kicks off once an insert (for now, testing) into the staging table and then the UTL_HTTP to kick off a new account PHP script to send that transaction straight into salesforce. Kind of a live update instead of running the weekly CRON jobs
    So I created this trigger (changed it since then to incorporate the procedure also):
    CREATE OR REPLACE TRIGGER MAPSDATA.live_account_trigger
       AFTER INSERT
       ON sforce_live_test
       FOR EACH ROW
    DECLARE
       l_page   LONG;
       l_url    VARCHAR2 (1000) := 'http://sfdc-db-d1/~msimonds/live_upsert.php';
    BEGIN
       l_page := UTL_HTTP.request (l_url);
    END live_account_trigger;
    /But if I do a test by simply doing something like this:
    insert into sforce_live_test (customer_name, schedule_id) values ('Fred Flinstone', 9060); to kick off the trigger (Mask/Test the creation of a new account), it does not pick up Fred Flinstone when the UTL_HTTP runs, it only updates the current records which are in the table prior to the test insert above.

Maybe you are looking for

  • Session Login and Logout in jsp page

    hi i am developing jsp page i completed except logout.jsp page my login page is in Jsp format and then business Logic in servlet and then get method & set method in bean.java i have login and then it sucess page there i have singout button if i sign

  • Free Good calculation Types

    Hello All, Kindly provide me for the below client requirment..... Client want to give Free Goods to its customers and they want to activate both Type 1 prorata and Type 2 unit wise calculation procedures to the same customers. Please suggest me how c

  • I purchased an app from the App store on my mac, now how do I get it on my iPhone?

    I have several apps that I purchased on my mac from the app store, now I cannot figure out how to get them onto my iphone.  Can anyone help?  Thank you!

  • Custom Table wierd behaviour

    Hi All, I have a custom table. when i view this custom table in SE11, it looks somewhat different than what i see in SE16n. When I see in SE16n, it shows one field to be non-primary, although it shows it that field primary when viewed in SE11. That p

  • New event - default times

    In month view when I double click on a day to create a new event the timings default to 2300 until 0000. I can't find any way to change these timings - can anyone help?