Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

we use oracle9i database. and since last week my oracle crash many times, after running for 30 hours more or less. we see errors repeat in my trc file and alert log :

qmhGetHTTPError: Got unknown oracle error. Error stack is:
ORA-00942: table or view does not exist

we do not find the exact table or view does not exist. if we upgrade our database to oracle 10g or 11g,will solve the problems? I found some error another log,

error 1242 detected in background process
ORA-01242: data file suffered media failure: database in NOARCHIVELOG mode
ORA-01114: IO error writing block to file 16 (block # 156925)
ORA-01110: data file 16: 'D:\ORACLE\ORADATA\SDH\SDH_DATA4.ORA'
ORA-27072: skgfdisp: I/O error
OSD-04008: WriteFile() 
O/S-Error: (OS 1450) 

 will above implies hard disk error? anyone gets an idea? thanks for all.
share|improve this question
1  
The existing answers are applicable to your original posts description, but based on your update the second problem seems to be much worse. At best something like a backup process is locking the data file. At worst your data file is corrupted and you will have to restore from backup. You should open a case with Oracle if you haven't already and probably create a second question if you have a specific question about the data file errors. –  Leigh Riffel Apr 20 '12 at 19:26

3 Answers 3

up vote 2 down vote accepted

The error you're getting indicates that a query is trying to reference an object that doesn't exist or that the user doesn't have access to. If you started getting it a week ago and weren't getting it before that, something changed a week ago so that an object was dropped, a privilege was revoked, or a SQL statement was added that references an invalid object. It is unlikely that upgrading the database would resolve the error.

Can you determine the SQL statement that your application is issuing when it receives this error? If not, can you add additional logging so that you can determine what statement is generating the error? If your application doesn't log the SQL statements it generates, you could create a SERVERERROR trigger (based on this trigger code). Obviously, you would probably want to log more than just the SQL statement.

create table stmt_err_log (
  sql_stmt varchar2(1000)
);

 CREATE OR REPLACE TRIGGER after_error
  AFTER SERVERERROR ON DATABASE
  DECLARE
  pragma autonomous_transaction;
  id NUMBER;
  sql_text ORA_NAME_LIST_T;
  v_stmt CLOB;
  n NUMBER;
 BEGIN
  n := ora_sql_txt(sql_text);
  --
  IF n >= 1
  THEN
    FOR i IN 1..n LOOP
      v_stmt := v_stmt || sql_text(i);
    END LOOP;
  END IF;
  --
  FOR n IN 1..ora_server_error_depth LOOP
   IF ora_server_error(n) = '942'
   THEN
     insert into scott.stmt_err_log( sql_stmt )
       values( v_stmt );
     commit;
   END IF;
 END LOOP;
  --
 END after_error;
share|improve this answer
    
thanks.it is hard to find sql statement error.because i do not know where the code have been changed.we are trying to find where the sql problem it is. –  snow8261 Apr 20 '12 at 6:24
    
@snow8261 - I updated my answer with a trigger that will log the SQL statement. –  Justin Cave Apr 20 '12 at 6:52
    
thanks very much. i will try with your answers. –  snow8261 Apr 20 '12 at 7:05
    
i already create the trigger, and wait for the result.meanwhile, i found a error says ORA-01242: data file suffered media failure: database in NOARCHIVELOG mode i donot know if this error relate to the database crash. –  snow8261 Apr 20 '12 at 8:20
3  
The error "IO error writing block to file 16 (block # 156925)" sounds more like that the data file containing the table is corrupted. –  a_horse_with_no_name Apr 20 '12 at 9:15

Mostly, if the table really exists, the reason is, that the user under which the DML statement is executed, does not have permission to select from the table. If the user is not granted the select privilege, no upgrade will ever help.

share|improve this answer

Broken shared cursor (sql re-use) as cause of ORA-00942:

I recently had this error, although the table to select from did exist and the user had sufficient privileges. Furthermore, select from SQL Developer or Sqlplus worked correctly, and even other queries on the same table within the application (using NHibernate). Only one specific, but important query to get an item by name failed again and again.

The cause of this was a broken shared cursor (similar to a query plan in MS SQL Server) which didn't work anymore after I changed some user rights. My solution was to do an

ALTER SYSTEM FLUSH SHARED_POOL;

to clear the cursor cache (an admin had to do it!). There are probably other ways to do this on user or SQL statement level (the above is for the whole database server), which I did not understand the quick way. An alternative may be:

DBMS_SHARED_POOL.PURGE(...)

perhaps somebody can add the correct syntax how to remove shared cursors for a table or user this way, and tell if full admin rights are required for this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.