Working around ORA-02393: exceeded call limit on CPU usage Error
I have queries to run on a server that often yield CPU errors. I know the cause of the error--it's a stored procedure on the server. Trouble is, the stored procedure can't be changed/improved/fixed (no money, so I have to live with it). It's not my stored procedure--I'm just a data analyst. So what I always do is limit the number of records that it pulls at once using things like WHERE MOD(my_id, 20)=0 and re-run the query until I have gotten all of the records. But I was thinking that maybe I could put the query inside of a loop and let the loop increase the number each time. But will that really work? Because then it is still one query after all. If that won't work, are there any other tricks to slow down my query so the server won't get overwhelmed while at the same time be able to get all the data at once without having to manually restart? I don't think this is a tuning question, although I don't know anything about tuning. I've never tuned a query before. But this query is really nothing more than just running a stored procedure over many record id's and saving the output to a spool file. I guess another option is convincing the DBA to set my CPU threshold higher, but I really doubt they will do that. The bottom line is, I am on my own here, so if there is a solution, it will have to be restricted to the query that I run.