Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-03113 while executing a sql query

I have a 400 line sql query which is throwing exception withing 30 seconds

ORA-03113: end-of-file on communication channel

Below are things to note:

  1. I have set the timeout as 10 mins
  2. There is one last condition when removed resolves this error.
  3. This error came only recently when I analyzed indexes.

The troubling condition is like this:

AND UPPER (someMultiJoin.someColumn) LIKE UPPER ('%90936%')

So my assumption is that the query is getting terminated from the server side apparently because its identified as a resource hog.

Is my assumption appropriate ? How should I go about to fix this problem ?

EDIT: I tried to get the explain plan of faulty query but the explain plan query also gives me an ORA-03113 error. I understand that my query is not very performant but why should that be a reason for ORA-03113 error. I am trying to run the query from toad and there are no alert log or trace generated, my db version is Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production

like image 500
Ravi Gupta Avatar asked Jul 28 '10 07:07

Ravi Gupta


People also ask

What does the error ORA 03113 mean?

An ORA-3113 "end of file on communication channel" error is a general error usually reported by a client process connected to an Oracle database. The error basically means 'I cannot communicate with the Oracle shadow process'.


2 Answers

One possible cause of this error is a thread crash on the server side. Check whether the Oracle server has generated any trace files, or logged any errors in its alert log.

You say that removing one condition from the query causes the problem to go away. How long does the query take to run without that condition? Have you checked the execution plans for both versions of the query to see if adding that condition is causing some inefficient plan to be chosen?

like image 129
Dave Costa Avatar answered Sep 24 '22 20:09

Dave Costa


I've had similar connection dropping issues with certain variations on a query. In my case connections dropped when using rownum under certain circumstances. It turned out to be a bug that had a workaround by adjusting a certain Oracle Database configuration setting. We went with a workaround until a patch could be installed. I wish I could remember more specifics or find an old email on this but I don't know that the specifics would help address your issue. I'm posting this just to say that you've probably encountered a bug and if you have access to Oracle's support site (support.oracle.com) you'll likely find that others have reported it.

Edit: I had a quick look at Oracle support. There are more than 1000 bugs related to ORA-03113 but I found one that may apply:

Bug 5015257: QUERY FAILS WITH ORA-3113 AND COREDUMP WHEN QUERY_REWRITE_ENABLED='TRUE'

To summarize:

  • Identified in 9.2.0.6.0 and fixed in 10.2.0.1
  • Running a particular query (not identified) causes ORA-03113
  • Running explain on query does the same
  • There is a core file in $ORACLE_HOME/dbs
  • Workaround is to set QUERY_REWRITE_ENABLED to false: alter system set query_rewrite_enabled = FALSE;

Another possibility:

Bug 3659827: ORA-3113 FROM LONG RUNNING QUERY

  • 9.2.0.5.0 through 10.2.0.0
  • Problem: Customer has long running query that consistently produces ORA-3113 errros.
    On customers system they receive core.log files but do not receive any errors in the alert.log. On test system I used I receivded ORA-7445 errors.
  • Workaround: set "_complex_view_merging"=false at session level or instance level.
like image 34
jlpp Avatar answered Sep 25 '22 20:09

jlpp