Home » RDBMS Server » Performance Tuning » dbms_lob.append (oracle 10g)
dbms_lob.append [message #486088] Mon, 13 December 2010 09:23 Go to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
I am facing one issue. I created one proc and when I call in some time it took 10 minutes and some time it took 2 hrs.

CREATE OR REPLACE PROCEDURE DEVDEFT.pra (p_action in number default null) is
cursor c1 is select distinct uev.actionBy from  hclt_temp_mail_record uev;
v1 c1%rowtype;
cursor c0  is
SELECT  uev.actionBy,uev.displayinfo  from hclt_temp_mail_record uev where uev.actionby=v1.actionby;
vc0 c0%rowtype;
vmail_content_old clob;
vmail_content_new clob;
mail_clob clob;
begin
	open c1 ;
  loop
   fetch c1 into v1;
   exit when c1%notfound;
   dbms_lob.createtemporary(mail_clob,false,dbms_lob.call);
   open c0;
        loop
	proclog('TESTCLOB','CLOB');
            fetch c0 into vc0;
            exit when c0%notfound;
           vmail_content_new:=null;
             vmail_content_new:=vc0.displayinfo;
            DBMS_LOB.APPEND(mail_clob, vmail_content_new);
     end loop;
	close c0;
    dbms_lob.freetemporary(mail_clob);
    dbms_lob.freetemporary(vmail_content_new);
    end loop;
    close c1;
END;


BEGIN
PRA;
END;

Please advice me why its behavior in very much inconsistent.
There are 142000 records in hclt_temp_mail_record. Cursor is not slow, its rruning very well, but i think problem is with dbms_lob. Please advice.



Re: dbms_lob.append [message #486272 is a reply to message #486088] Tue, 14 December 2010 10:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>SELECT uev.actionBy,uev.displayinfo from hclt_temp_mail_record uev where uev.actionby=v1.actionby;
Does TEMP_MAIL_RECORD table have current statistics?
Does index exist on ACTIONBY with current statistics?
How many rows exist in TEMP_MAIL_RECORD?
How many rows returned by SQL above?
Why are you joining "temp" table to itself?
Consider enable SQL_TRACE to determine where time is being spent.
Re: dbms_lob.append [message #486291 is a reply to message #486272] Tue, 14 December 2010 11:44 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
when i comment this line DBMS_LOB.APPEND(mail_clob, vmail_content_new); every time the proc ic complete in 5 moniutes ,but without commening this line and when server is busy with other job then the same proc take hrs to complete.

Yes the stats are upto date.
Re: dbms_lob.append [message #486293 is a reply to message #486291] Tue, 14 December 2010 11:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>when i comment this line DBMS_LOB.APPEND(mail_clob, vmail_content_new); every time the proc ic complete in 5 moniutes
Does performance improve when tested on V11.2 database?
Re: dbms_lob.append [message #486299 is a reply to message #486293] Tue, 14 December 2010 12:01 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
do not have any idea because i am using oracle 10g and also cpu uses is very high when use append clause. It works for 142000 records , in starting, process become very fast means in starting 30 minutes it complete 25% records, but for the rest 75% records it took hrs to complete and when we see the cpu utilisation through OEM it shows 100%.
Re: dbms_lob.append [message #486301 is a reply to message #486299] Tue, 14 December 2010 12:08 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Since only Oracle can control what occurs within called procedure, your only choice is to live with the results or find a work around.
I suspect that you are hitting some sort of scalability bug within procedure.
V10 is no longer fully supported.
You're On Your Own (YOYO)!
Re: dbms_lob.append [message #486302 is a reply to message #486301] Tue, 14 December 2010 12:10 Go to previous message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
but my question is whether dbms_lob.append take more cpu in process if we use huge number of records in append,if yes then is there any way to reduce the cpu utilisation.
Previous Topic: help on Query tuning
Next Topic: When to use sub-query and when to use join
Goto Forum:
  


Current Time: Sat Apr 27 13:10:39 CDT 2024