Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, jahanzeb.

Asked: September 12, 2000 - 4:00 pm UTC

Last updated: February 20, 2005 - 10:45 pm UTC

Version: oracle 7.3

Viewed 1000+ times

You Asked

Hi,

I am having a problem regarding export.
I want to export sets of tables repeatedly, but following error is occuring.

ORA-00604 error occurred at recursive SQL level num

Actually I have to export various tables in the form of sets. Each set contains 42 selected tables.When I export any set the above error occurs.
But, when I export in sets of 6 tables , no error occurs.

More over, this error only occurs only when I perform export on a server called 'PCV'.And when i perform the same action on server called 'BACKUP',no error occur in any case. Actually PCV and BACKUP ,both are copies of each other,with slight differences in their init.ora file.The parameters which differ
with each other are,

PCV --parameters

1.db_files=20
2.db_block_buffers=200
3.shared_pool_size=6500000
4.open_cursors=100
5.log_buffer=8192

BACKUP ---parameters


1.db_files=35
2.db_block_buffers=3200
3.shared_pool_size=12000000
4.open_cursors=300
5.log_buffer=32768

There may be problem with the parameter difference.

Please help me in this regard.

Thanks.

Jahazneb



and Tom said...

Well, that is not the entire message stack. the ora-604 is:

00604, 00000, "error occurred at recursive SQL level %s"
An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).

If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.


There is a "next error on the stack" that describes the real failure. I'm going to guess here based on the init.ora parameters above -- it is ORA-01000 "maximum open cursors exceeded" exceeded.

100 is way too small. the smallest I use is 500 but I prefer 1000 myself in all cases. Adjust and retry the operation after changing and bouncing the instance (shutdown+startup).

If you are worried that setting too high will "waste" stuff, see
</code> http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:288216032261 <code>It'll only allocate them as it needs them (and if it needs them -- it isn't wasting anything, it needs them)



Rating

  (7 ratings)

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

Comments

still don't understand why export gets ORA-01000

Beth, September 25, 2003 - 7:41 pm UTC

Hi Tom,
I have been receiving the same ORA-00604, ORA-01000 stack, as in this question, during a nightly export.

I have been reading all about open cursors on your site and still have a few questions.

1) Why exactly does the export get max open cursors exceeded? Does the exp utility open one cursor per table? I can't tell if there is a correlation, because I don't know how far the export gets before it fails. We have open_cursors = 220, and there are 454 tables in the entire database. (This is a full export that it is failing on.)

2) I understand you stress to set open_cursors to at least 500, preferably 1000, because there is no harm done in allocating an array of 1000 pointers (not yet eating up memory) and it solves the bigger pain-in-the-butt problem of having to repeatedly bounce the database to fix this error, if you only increment it by a small amount each time, right?

a) You also said, if there is a memory leak in some code, you will find it then (how? I am not exactly sure, but if it can suck up the bulk of 1000 cursors I guess you can find out what in v$open_cursor and find out who in v$sesstat...) Regardless, if this bad code got implemented in a prod db, wouldn't it then start to allocate memory for those 1000 array pointers, and depending on the amt of memory available for Oracle on your server, couldn't that be a bad thing, to let it run wild?

b) or do you just have to keep in mind the 'OS limit for open cursors'? Is there one? This was a phrase from some TAR. If it exists, how do you know what that would be? The Ref manual says 4294967295 is the max, but that is number of cursors...would I need to find out the size of each cursor and compare to RAM on the box?

3) Lastly, or perhaps repeating myself, if there is a threshold of max cursors being set too high....how do you proactively figure it out?

Thanks as always!



Tom Kyte
September 25, 2003 - 11:38 pm UTC

what version of the database/exp are we talking about here.

version

Beth, September 26, 2003 - 11:55 am UTC

8.1.7.0.0

version

Beth, September 26, 2003 - 11:57 am UTC

817 for both the database *and* the exp utility

Tom Kyte
September 26, 2003 - 2:47 pm UTC

contact support and reference:

Hdr: 2194182 8.1.7.2 RDBMS 8.1.7.2 SPACE PRODID-5 PORTID-59 ORA-604
Abstract: ORA-604 FOLLOWED BY ORA-1000 DURING SELECTS ON THE DD VIEWS

patched in 8173 and 8174

Thanks!

Beth, September 26, 2003 - 2:58 pm UTC

Wow, thanks! Sorry to bother you with a bug. I inherited the unpatched db, and know i need to fix it, but didn't think this was a bug!

But anyway, for my understanding...what about 2a, b?

Tom Kyte
September 26, 2003 - 8:06 pm UTC

2a) you would find that in TEST would you not? if you say no, then prod is error prone anyway...

2b) it is a function of RAM available

exp is using 600 cursors

Manish Upadhyay, January 28, 2005 - 10:45 am UTC

Hi ,
My database 9.2.0.6 on AIX with open_cursors=1000. I am running full database export on this database and at the same time I query to see how many cursors were opened by exp session.
select sid, count(*) from V$OPEN_CURSOR group by sid;

SID COUNT(*)
---------- ----------
10 594
11 1
15 8
22 1
25 4
28 10
30 22

Sid 10 is the export session.
This database has XML database too. ( if this has any effect)

Do you think that exp might be leaking cursors? or just normal for exp to use that many cursors.?



Tom Kyte
January 28, 2005 - 2:31 pm UTC

cursors will be cached by plsql automagically and for good purpose.

No probablems here.

when using Export i'm getting these error and can't do the export

Rahul Chaudhari, February 15, 2005 - 11:47 pm UTC

EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00904: invalid column name
EXP-00000: Export terminated unsuccessfully

Tom Kyte
February 16, 2005 - 7:55 am UTC

umm, sort of falls into "insufficient data"

but why didn't you contact support?

EXP-00008: ORACLE error 604 encountered

Rahul Chaudhari, February 20, 2005 - 10:45 pm UTC

While Exporting any schema through one of service name on one of our server the following were the errors
EXP-00008: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00904: invalid column name
EXP-00000: Export terminated unsuccessfully


Solution :--
Solved it by running CATALOG.SQL as it was found that incompatibility with the catalog.

Thankx a lot Tom...
Rahul chaudhari