[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Bulk inserts with Oracle 8i

Asked by ppinon in Oracle Database, Oracle 8.x, PL / SQL

Tags: Oracle 8i PL/SQL performance bulk inserts

Hi!,
I'm using an Oracle 8i database and I would like to do ~12.000.000 inserts with a PL/SQL block like this.
Unfortunately, it takes 7 hours to execute...
the r in the loop contains 8 numbers 400, 402, 403, 404, 405, 406, 408 and 570 used to call the appropriate tables (ex.  baan.ttdsls032402 or baan.ttdsls032570).

Do you have any suggestion ?

Have tried the solution FORALL provided at http://www.dba-oracle.com/oracle_news/news_plsql_forall_performance_insert.htm to improve the performace, but it gives me a PLS-00597 error, probably because I use a 8i DB.

Anyway, your suggestions are welcome!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
declare
    v_comm varchar2(15000);
begin
insert into pablo_log_temp values ('3s',sysdate);
execute immediate 'truncate table zz_auditbaanprices';
insert into pablo_log_temp values ('3e',sysdate);
for r in (select c.lsemacompanycode from spm.salescountrygroup c
          where c.spmenabled = 'Y'
          and c.LSEMACOMPANYCODE not in ('412', '420')
          order by c.lsemacompanycode
         )
loop
insert into pablo_log_temp values ('4s_'||r.lsemacompanycode,sysdate);
    v_comm := 'insert into zz_auditbaanprices(lsemacompanycode,pl_code,prod_code,quality_code,size_code,item,value,startdate,ref_date) '||
    'select '''||r.lsemacompanycode||''' as lsemacompanycode, '||
           's.t$cpls, substr(trim(s.t$item),1,9) as prod_code, '||
           'substr(trim(s.t$item),10,1) as quality_code, substr(trim(s.t$item),11,4) as size_code, '||
           'trim(s.t$item) as item, '||
           's.t$pric, s.t$stdt, case when s.t$stdt <= trunc(sysdate) then trunc(sysdate) else trunc(s.t$stdt) end as ref_date '||
    'from baan.ttdsls032'||r.lsemacompanycode||'@beuprd02 s '||
    'where s.t$stdt > trunc(sysdate) '||
       'or not exists(select ''x'' '||
                     'from baan.ttdsls032'||r.lsemacompanycode||'@beuprd02 m '||
                     'where m.t$stdt > s.t$stdt '||
                       'and s.t$cpls = m.t$cpls '||
                       'and s.t$item = m.t$item)';
    execute immediate v_comm;
    commit;
insert into pablo_log_temp values ('4e_'||r.lsemacompanycode,sysdate);
end loop;
commit;
end;
/
 
Related Solutions
Keywords: Bulk inserts with Oracle 8i
 
Loading Advertisement...
 
[+][-]10/29/09 02:52 AM, ID: 25691905Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Oracle Database, Oracle 8.x, PL / SQL
Tags: Oracle 8i PL/SQL performance bulk inserts
Sign Up Now!
Solution Provided By: aiklamha
Participating Experts: 2
Solution Grade: B
 
[+][-]10/29/09 02:52 AM, ID: 25691911Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/29/09 06:09 AM, ID: 25693172Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 09:33 AM, ID: 25695447Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_EXPERT_20070906