I have a problem with Oracle, where I have two procedures that are executed one after the other.
Where in the first procedure
, I have a cursor that makes insert
in a table.
This insert has approximately 30 million records , which are inserted in one time
fast and acceptable.
But when the next procedure is executed, the update is delayed. In one last execution it took about 38 hours. And it has only one cursor of update
, smaller than the first one and executing the cursor separately, it runs in less than a minute.
A detail is that when the procedures are running, and I see that the second procedure
is "locked", if I stop the execution, I give a analyze table
, and I execute only the second procedure again, it is performed normally, taking about 1 or 2 hours to complete.
Does anyone have any idea how to help me?