select *from dba_scheduler_jobs a where a.owner=''
BEGIN
DBMS_SCHEDULER.DROP_JOB('DRQUICK_TEXTJ');
END;
/
begin
dbms_scheduler.create_job(
job_name => '"DRQUICK_TEXTJ"',
job_type => 'PLSQL_BLOCK',
job_action => 'ctxsys.drvdml.auto_sync_index(''QUICK_TEXT'', 12582912, NULL, NULL,NULL, 0);',
--ctxsys.drvdml.auto_sync_index('"xxxx_DI1"', 536870912, NULL, NULL, NULL, 0);
start_date => (sysdate+(1)),
repeat_interval => 'FREQ=DAILY;INTERVAL=1',
end_date => (sysdate+2),
comments => 'Testing');
end;
/
All Users
Summary
Created an Oracle Text index with SYNC EVERY option. This option will automatically schedule a job to sync the index.
For example:
create index quick_text on quick ( text )
indextype is ctxsys.context
parameters ('sync (every "SYSDATE+15/1440" )');
However, the index currently fails to drop with the following errors:
drop index QUICK_TEXT;
ORA-29856: error occurred in the execution of ODCIINDEXDROP routine
ORA-20000: Oracle Text error:
DRG-50857: oracle error in drvddl.IndexDrop
ORA-27475: "QUICK.DRQUICK_TEXTJ" must be a job
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 608
Solution
To implement the solution, please execute the following steps:
- For the index that fails to drop, create a "dummy" job to mimic the job created automatically when the index was originally created. For example:
begin
dbms_scheduler.create_job(
job_name => '"DRQUICK_TEXTJ"',
job_type => 'PLSQL_BLOCK',
job_action => 'ctxsys.drvdml.auto_sync_index(''QUICK_TEXT'', 12582912, NULL, NULL,
NULL, 0);',
start_date => (sysdate+(1)),
repeat_interval => 'FREQ=DAILY;INTERVAL=1',
end_date => (sysdate+2),
comments => 'Testing');
end;
/
- Once the "dummy" job has been scheduled, drop the index:
drop index quick_text;
Attachments :
Cause
The job automatically scheduled when the index was initially created was manually dropped:
exec DBMS_SCHEDULER.drop_job (job_name => 'DRQUICK_TEXTJ');
The following query sample could be used to view the job automatically scheduled (due to sync every option used). The job will be named DRINDEX_NAMEJ:
Select JOB_NAME, STATE,JOB_TYPE, JOB_ACTION, REPEAT_INTERVAL,
LAST_START_DATE, NEXT_RUN_DATE from DBA_SCHEDULER_JOBS
where JOB_NAME like '%QUICK_TEXT%';
When a Text index is created with the sync every option, a job is automatically scheduled for the index sync routine specified in the create statement. When that index is dropped, internal recursive SQL will locate and drop that associated job automatically. If the job is missing, the drop index statement will fail.