Thoughts on why I'm getting an error creating an index - oracle

I'm trying to create an index in Oracle 12c and I keep getting an error
I have ensured that DOCUSER has Create Sequence and Create Table, I've also tried creating this index logged in as SYS. I've also check tomake sure that there was a column named "TRACK_DT" in the PDF_TRACKER table
CREATE INDEX DOCUSER.TRACK_DT_TRACKER ON DOCUSER.PDF_TRACKER (TRACK_DT) INDEXTYPE IS CTXSYS.CONTEXT;
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error: DRG-10509: invalid text column: TRACK_DT
ORA-06512: at "CTXSYS.DRUE", line 171 ORA-06512: at
"CTXSYS.TEXTINDEXMETHODS", line 316

Related

Why do I get ORA-20000 when I run dbms_stats.gather_table_stats on a table in SSB Schema?

I wanted to generate some CPU load on my ADB-S database. I tried to collect the optimizer statistics on a table from the sample schema SSB, but I got this error, even if I am connected as ADMIN user:
exec dbms_stats.gather_table_stats('SSB','CUSTOMER');
BEGIN dbms_stats.gather_table_stats('SSB','CUSTOMER'); END;
Error report -
ORA-20000: Unable to analyze TABLE "SSB"."CUSTOMER", insufficient privileges or does not exist
ORA-06512: at "SYS.DBMS_STATS", line 40921
ORA-06512: at "SYS.DBMS_STATS", line 40193
ORA-06512: at "SYS.DBMS_STATS", line 40352
ORA-06512: at "SYS.DBMS_STATS", line 40902
ORA-06512: at line 1
20000. 00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
Not being able to change anything on SSB (or any sample schema for that matter) is intentional. Those are purely read-only schemas and the stats on them are controlled by Oracle.
Oracle documentation mentions that sample schemas are read-only:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-sample-data.html#GUID-4BB2B49B-0C20-4E38-BCC7-A61D3F45390B

error when collecting tokens from a full text database

I want to test Oracle's CTX_DOC.TOKENS procedure in order to count the number of occurrence of a string into a document.
For this, I have:
create table documents (id number primary key, text bfile);
insert into documents values (1, bfilename('MY_DIR','12things_about_122.pdf'));
create index documents_idx on documents (text) indextype is ctxsys.context;
declare
the_tokens ctx_doc.token_tab;
begin
ctx_doc.set_key_type ('PRIMARY_KEY');
ctx_doc.tokens('documents_idx','1',the_tokens);
dbms_output.put_line('Number of tokens: '|| the_tokens.count);
end;
When I test this, the PLSQL part fails with:
Error report:
ORA-20000: Oracle Text error:
DRG-10001: can not access result table the_tokens
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.CTX_DOC", line 862 ORA-06512: at line 5
00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
Can you help me to understand what is needed much more in order to work correctly, please?
Thank you,
it seems that the answer was too easy to be seen from the 1st time:
It was necessary to referenciate the ctx_doc.token_tab; with schema name, too.
Instead of the_tokens ctx_doc.token_tab, I had to do the_tokens ctxsys.ctx_doc.token_tab;

Failed to successfully execute the ODCIIndexCreate routine. - Oracle Spatial Indexing

I have two oracle spatial tables, namely, restaurants and persons. The structures of these two tables are:
CREATE TABLE restaurants(
id NUMBER PRIMARY KEY,
name VARCHAR2(32),
shape SDO_GEOMETRY
);
CREATE TABLE persons(
p_id NUMBER PRIMARY KEY,
p_name VARCHAR2(32),
p_shape SDO_GEOMETRY
);
Then, after populating each table I wanted to create spatial index for each table. The following instruction for restaurants table executed successfully.
CREATE INDEX restaurants_spatial_idx
ON restaurants(shape)
INDEXTYPE IS mdsys.spatial_index;
But, when I wrote for persons table:
CREATE INDEX persons_spatial_idx
ON persons(p_shape)
INDEXTYPE IS mdsys.spatial_index;
This gave me the following error in sql developer 3.2.20:
Error starting at line 340 in command:
CREATE INDEX persons_spatial_idx
ON persons(p_shape)
INDEXTYPE IS mdsys.spatial_index
Error at Command Line:340 Column:14
Error report:
SQL Error: ORA-00955: name is already used by an existing object
00955. 00000 - "name is already used by an existing object"
Cause:
Action:
As this was saying that I have already and index named persons_spatial_idx, I deleted this index using: DROP INDEX persons_spatial_idx; Then when I tried to create the index again, it produced the following error:
Error starting at line 340 in command:
CREATE INDEX persons_spatial_idx
ON persons(p_shape)
INDEXTYPE IS mdsys.spatial_index
Error at Command Line:340 Column:14
Error report:
SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in spatial index: [mdrcrtxfergm]
ORA-13249: Error in spatial index: [mdpridxtxfergm]
ORA-13200: internal error [ROWID:AAAFGnAABAAALHpAAA] in spatial indexing.
ORA-13206: internal error [] while creating the spatial index
ORA-13365: layer SRID does not match geometry SRID
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
00000 - "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.
Thanks for reading.
The message is saying that an object with name PERSONS_SPATIAL_IDX already exists.
You can use the following query to find the existing index:
select *
from all_indexes
where index_name = 'PERSONS_SPATIAL_IDX'

oracle cat index throws invalid sql name exception

We recently upgraded our database to Oracle 12c and since then it throws ORA-44003: invalid sql name exception while inserting on a table which has cat index.
We only have cat index on one column, which was working fine with Oracle 11g.
The interesting part is, i can insert the same record if i keep trying. Sometimes on the second, sometimes on the tenth try.
Here is the exception:
Internal Exception: java.sql.SQLException: ORA-44003: invalid SQL name
ORA-06512: at "SYS.DBMS_ASSERT", line 479
ORA-06512: at "CTXSYS.DRVDML", line 415
ORA-06512: at "EMISDB.DR$IDX_AML_NOTICE_DESCTC", line 1
ORA-04088: error during execution of trigger 'SONARDB.DR$IDX_NOTICE_DESCTC'
I dropped and created the cat index with the script:
create index IDX_NOTICE_DESC on NOTICE (DESCRIPTION) indextype is ctxsys.ctxcat
I would appreciate any tip.

How to deploy Oracle Dimension table for OLAP Cubes

I followed First Example as well as Second Example to create Cubes in Oracle 10g.
I tried to create cube using query rewrite mechanism in Oracle 10g.
(Intailly tried to create using Analystic workspace manager we got error in that too so only we went for query rewrite mechansism)
We succeded in creating table "PRODUCTS"
Also we succedded in creating Dimension for that table "PRODUCTS"
But when we try to create Attribute for the above "PRODUCTS" table like below
BEGIN
cwm_classify.remove_entity_descriptor_use(28, cwm_utility.DIMENSION_TYPE, 'SH', 'PRODUCTS');
COMMIT;
END
we are getting following error.
Note : We have data inside table too
Error starting at line 1 in command:
begin
cwm_classify.remove_entity_descriptor_use(28, cwm_utility.DIMENSION_TYPE, 'SH', 'PRODUCTS');
commit;
end;
Error report:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "OLAPSYS.CWM$OLAP$DIMENSION", line 242
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "OLAPSYS.CWM$UTIL", line 368
ORA-01403: no data found
ORA-06512: at "OLAPSYS.CWM$CLASSIFY", line 322
ORA-06512: at "OLAPSYS.CWM$CLASSIFY", line 1198
ORA-06512: at line 2
06510. 00000 - "PL/SQL: unhandled user-defined exception"
*Cause: A user-defined exception was raised by PL/SQL code, but
not handled.
*Action: Fix the problem causing the exception or write an exception
handler for this condition. Or you may need to contact your
application administrator or DBA.
When i googled i got suggestion like we have to deploy Dimension also before deploying Cubes.
So i'm trying to create OLAP Cubes for this i need to to deploy Dimension Tables in Oracle.
Is there any way to deploy Dimension is that possible actually?
Suggest me how to do this?
Assuming you are using Analytic Workspace Manager, the OLAP documentation would be a good place to start:
http://download.oracle.com/docs/cd/E11882_01/olap.112/e17123/cubes.htm#BGBDJAAG

Resources