Wednesday, May 21, 2014

ora-00942 resolution with errorstack trace

Whenever developer warned me that application took ORA-00942 -  table or view does not exist error , i have asked which sql . From one reason related sql could not be captured , so i have decided to open tracing for specific error on level 3.

For ora-00942 -  table or view does not exist error , i have executed ,

alter system set events '942 trace name errorstack level 3';

Error entries were in the alert log file , and it was showing related trace files. But more trace files occured in dump directory that i expect.Most of them were indicating 1 table , but this table was not the cause of error . I have used "grep" command to eliminate irrelevant files in order to detect actual table.

In every trace files there was a entry which is "about to signal 942" helped me to query all related files and "Name:" entry at the end of file showing table name.

grep "about to signal 942" * | grep "^Name:" * | grep -v "TABLE2"

Output ,

testdb_ora_23427.trc:Name: TABLEX
testdb_ora_2626.trc:Name: TABLEX
testdb_ora_2692.trc:Name: TABLEX
testdb_ora_2708.trc:Name: TABLEX
testdb_ora_29230.trc:Name: TABLEX
testdb_ora_31956.trc:Name: TABLEX

Table2 was irrelevant table and with "-v" parameter command only executed for other tables.As a result relevant table has been determined.

After resolution , you can disable errostack tracing,

alter system set events '942 trace name errorstack off';

No comments:

Post a Comment