Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Ravi.

Asked: July 31, 2018 - 6:26 pm UTC

Last updated: August 02, 2018 - 10:18 am UTC

Version: Oracle 12.1.0.2

Viewed 1000+ times

You Asked

Hi AskTom,

Can you please help me with this issue. Our application uses lot of global temporary table (GTT) has on commit preserve rows option.

  CREATE GLOBAL TEMPORARY TABLE "ODR"."GTT_POINT" 
   ( "POINT_ID" NUMBER(10,0) NOT NULL ENABLE
   ) ON COMMIT PRESERVE ROWS 


When Java thread runs transactions against this GTT we often get below error.

"Exception: Java ScenarioWorker execution error: com.oracle.ugbu.ouca.core.worker.ScenarioWorker.java: [I:odr,T:362033,B:10204100], Exception [com.oracle.ugbu.ouca.core.pointcache.exception.PointCacheException: Exception in reading point data from db for point batch, pointTypeCode:WEATHER, factId:18, factTypeCode:METRIC, startTimeInt:1523422800, endTimeInt:1531803600]

Caused by: com.oracle.ugbu.ouca.core.exception.DataStoreException: Exception in batch deletion for query: TRUNCATE TABLE GTT_POINT

Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist"


Do you know if any bugs or workarounds to resolve this error ?. Appreciate your feedback and time.

thanks
Ravi

and Chris said...

You're getting ORA-942 errors. Which suggests that either:

- Someone is dropping and re-creating the table (bad idea!) and you happen to access it when it's missing
- Someone's granting/revoking access on the table and you happen to access when you have no privileges
- The code points to the wrong table. This could be due to missing schema prefixes or using synonyms pointing to the wrong place

To figure out what's going on, check:

- The exact SQL sent from your app to the database. Does this work when you connect in SQL Developer/SQL*Plus/... as the application user?
- If the table is being recreated regularly. Check the user_objects.created to see this
- What other code accessing the table is doing

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.