Bulk Insert for 10 million records - error - Snap shot too old

Hello

I try to use 'Bulk Insert' for the insertion of 10 million documents. This piece of code is placed in the procedure. For my bad, I have found often the procedure (managed by a batch process) becomes the question of "Snapshot too old" error-ed
Through a few blogs made me feel this cold size Undo retention aid increase.
My question is: fact between it "COMMIT" contributes to the error. The value of the validation between the Bulk Insert is 100,000.

Thanks in advance!

974675 wrote:
Hi Hoek,

Thanks for the link to the blog.
You want to know, how intermediate VALIDATIONS could be processed in bulk insertion.

don't NO If ENGAGE inside the LOOP!

Tags: Database

Similar Questions

  • Snap shot too old error

    Hello

    Why we get error snapshot too old?

    Thank you
    Anil

    Google

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:275215756923

    Anand

  • Bulk Insert for more than 50 columns of one table to another.

    Hi all

    I have two Source and target tables that are the same in structure, and I need the Source Table Insert into the target Table.

    Source and the target Table is to have about 60 columns. And Volumn of data in the Source Table is about 1 Cr.

    Previously, someone wrote the Simple insertion as

    INSERT INTO TARGET_TBL (C1, C2, C3, C4... C60)

    (SELECT C1, C2, C3, C4... TARGET_TAB C60);

    And it will not work for this a large part of the data. Could you please suggest the best approach to do this.

    Thanks in advance.


    Hello..

    This will not work for that much of the data

    Tips for use as APPEND... See below link for direct loading

    Direct-load INSERT

    Try the below

    ALTER session enable parallel dml.

    INSERT / * + append parallel (6) * / INTO TARGET_TBL (C1, C2, C3, C4... C60)

    (SELECT C1, C2, C3, C4... TARGET_TAB C60);

  • Http for Smartphones blackBerry 413 error: entity asked too large

    I am new to the BlackBerry family.

    When I go to http://my.yahoo.com or other web sites, the browser returns an error message of "Http Error 413: requested entity too Large" and I can't load the web page.

    Y at - it a setting I need to change in order to get out of this error?

    Thank you.

    Try using a different internet browser.

    For example OperaMini

    It's free.

  • How to upgrade more than 5 million records without error ORA-00257:

    Hello

    I need to update some of the columns in my table which is contains approximately 5 million records
    I already tried this

    Update AAA_CDR
    Set RoamFload = Null;

    but the problem is that I have the error message ("ORA-00257: archiver error.") Connect internal only, until this that released.) and the update consume about 6 hours with no results,

    can I make orders (Alter system set db_recovery_file_dest_size = 50G) and the problem resolved.

    but I need to be updated about 15 columns of this table to be null, what should I do to overcome this message and update the table within a reasonable


    Please help me,

    Hello

    You can consider the following option.

    1. create a new table AAA_CDR_BKP as being equal to the structure of table AAA_CDR

    
    Create Table AAA_CDR_BKP as
    Select * from AAA_CDR where 1=2;
    

    2. check the original array (AAA_CDR) as of the clues in this regard. Make sure you take the DDL of these indices, because you will need it later.

    3. now you can insert records from AAA_CDR to AAA_CDR_BKP

    
    Insert /*+APPEND */ into AAA_CDR_BKP
    select col1,col2,col3,null,null,null,null,null,col9,null,col11
    from AAA_CDR;
    
    Commit;
    

    where you will pass nulls for the required columns. Also make sure you have space on the tablespace as equal to table AAA_CDR

    You can get the size of the table in

    
    select bytes/(1024*1024*1024) size_in_GB from user_segments where segment_name = 'AAA_CDR';
    

    Once finished insert please post the transaction.

    4 delete the index (if any) of the original table (AAA_CDR)
    5. rename the original in AAA_CDR_ORG table
    6. Rename AAA_CDR_BKP to AAA_CDR
    7 run the DDL scripts on step 2 to re-create the index.
    8. delete the AAA_CDR_ORG table after investigating the whole operation.

    Using this method, you'll generate less archive logs and the process will be faster.

    See you soon
    LIX.

  • Bulk Insert to help for all is slow

    HII All,
    I have two sql scripts. Having just insert statements and the other using bulk insert both do the same thing.

    (1) using the Bulk Insert
    Set serveroutput on;
    
    Declare
              type t_hgn_no is table of r_dummy_1%rowtype
              index by binary_integer;
              type t_flx_no is table of varchar2(4000)
              index by binary_integer;
              
              l_hgn_no t_hgn_no;
              l_flx_no t_flx_no;
    
              begin_time number;
              end_time   number;
    
              
    Begin
         select (dbms_utility.get_time) into begin_time from dual;
         dbms_output.put_line('started at : '||begin_time);
         
         
         With t as
         (
         Select '100004501' HOGAN_REFERENCE_NUMBER , '320IVLA092811011' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100014501' HOGAN_REFERENCE_NUMBER , '320IVLA092811010' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100024501' HOGAN_REFERENCE_NUMBER , '320IVLA092811009' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100034501' HOGAN_REFERENCE_NUMBER , '320IVLA092811008' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100044501' HOGAN_REFERENCE_NUMBER , '320IVLA092811007' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '10006501' HOGAN_REFERENCE_NUMBER , '140IGL2092811951' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100074501' HOGAN_REFERENCE_NUMBER , '320IVLA092811006' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '10007501' HOGAN_REFERENCE_NUMBER , '200IVLA092810617' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100084501' HOGAN_REFERENCE_NUMBER , '320SVLA092810002' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100094501' HOGAN_REFERENCE_NUMBER , '320IVLA092811005' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100104501' HOGAN_REFERENCE_NUMBER , '320IVLA092811004' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100114501' HOGAN_REFERENCE_NUMBER , '320IVLA092811003' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100124501' HOGAN_REFERENCE_NUMBER , '320IVLA092811002' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100134501' HOGAN_REFERENCE_NUMBER , '320IVLA092811001' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100144501' HOGAN_REFERENCE_NUMBER , '320SVLA092810001' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '10016501' HOGAN_REFERENCE_NUMBER , '140IGL2092811950' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '10017501' HOGAN_REFERENCE_NUMBER , '200IVLA092810616' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '100217851' HOGAN_REFERENCE_NUMBER , '520USDL092818459' FLEXCUBE_REFERENCE_NUMBER from dual 
         union all
         Select '1002501' HOGAN_REFERENCE_NUMBER , '100PVL2092813320' FLEXCUBE_REFERENCE_NUMBER from dual 
              )
         Select HOGAN_REFERENCE_NUMBER,FLEXCUBE_REFERENCE_NUMBER
         bulk collect into l_hgn_no
         from t;
    
         forall i in 1..l_hgn_no.count
         
         Insert into r_dummy_1 values l_hgn_no(i);
    
         
    
    
    
    
    
    
         
         Commit;
         select (dbms_utility.get_time) into end_time from dual;
         dbms_output.put_line('ended at : '||end_time);
    
         
         
    Exception
              When others then
                   dbms_output.put_line('Exception : '||sqlerrm);
                   rollback;
    End;
    /
    Duration for bulk collect
    ==================


    SQL > @d:/bulk_insert.sql.
    starts at: 1084934013
    has completed at: 1084972317

    PL/SQL procedure successfully completed.

    SQL > select 1084972317-1084934013 double;

    1084972317 1084934013
    ---------------------
    38304




    (2) using the Insert statement
    Declare
              begin_time number;
              end_time   number;
    
    Begin
                        select (dbms_utility.get_time) into begin_time from dual;
                        dbms_output.put_line('started at : '||begin_time);
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('36501', '100CFL3092811385');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('106501', '100CFL3092811108');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('172501', '100SFL1092810013');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('192501', '100SVL2092814600');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('212501', '100SVL2092814181');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('272501', '100AFL309281B2LZ');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('292501', '100AVL2092812200');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('332501', '100SVL2092814599');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('346501', '100AFL309281B2LY');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('372501', '100SVL2092814598');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('382501', '100IVL1092811512');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('422501', '100SFL1092810020');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('432501', '100IVL1092811447');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('462501', '100CFL3092811107');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('492501', '100SVL2092814245');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('542501', '100AVL2092812530');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('592501', '100CFL3092811105');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('612501', '100SVL2092814242');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('632501', '100CFL3092811384');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('712501', '100PVL2092813321');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('722501', '100PVL2092813311');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('732501', '100PVL2092813341');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('742501', '100PVL2092813319');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('752501', '100PVL2092813308');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('762501', '100PVL2092813338');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('772501', '100PVL2092813316');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('782501', '100PVL2092813305');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('786501', '100CFL2092810051');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('792501', '100PVL2092813335');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('802501', '100PVL2092813313');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('812501', '100PVL2092813302');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('822501', '100PVL2092813332');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('832501', '100PVL2092813310');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('852501', '100PVL2092813329');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('862501', '100PVL2092813307');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('872501', '100PVL2092813299');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('882501', '100PVL2092813326');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('922501', '100PVL2092813304');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('932501', '100PVL2092813296');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('952501', '100PVL2092813300');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('962501', '100PVL2092813293');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('972501', '100PVL2092813323');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('982501', '100PVL2092813297');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1002501', '100PVL2092813320');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1012501', '100PVL2092813294');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1022501', '100PVL2092813290');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1032501', '100PVL2092813317');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1042501', '100PVL2092813291');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1052501', '100PVL2092813287');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1062501', '100PVL2092813315');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1072501', '100PVL2092813288');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1082501', '100AFL309281B2LX');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1092501', '100PVL2092813312');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1102501', '100PVL2092813285');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1112501', '100PVL2092813284');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1122501', '100PVL2092813309');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1142501', '100PVL2092813281');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1152501', '100PVL2092813306');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1162501', '100PVL2092813282');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1166501', '100CFL3092811383');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1212501', '100IVL1092811445');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1232501', '100IVL1092811526');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1272501', '100IVL1092811441');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1292501', '100IVL1092811523');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1302501', '100PVL2092813303');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1312501', '100PVL2092813279');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1322501', '100PVL2092813278');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1332501', '100PVL2092813301');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1342501', '100PVL2092813276');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1352501', '100PVL2092813275');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1376501', '100AFL309281B2LW');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1382501', '100PVL2092813272');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1392501', '100PVL2092813298');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1402501', '100PVL2092813273');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1412501', '100PVL2092813269');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1446501', '100RNF6092810019');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1452501', '100IVL1092811436');
    
                        insert into r_dummy (HOGAN_REFERENCE_NUMBER, FLEXCUBE_REFERENCE_NUMBER)
                        values ('1492501', '100CFL3092811382');
    
         
    
                        
                        select (dbms_utility.get_time) into end_time from dual;
                        dbms_output.put_line('ended at : '||end_time);
    Exception
              When Others Then
                         dbms_output.put_line('Exception Occured '||sqlerrm);
                         rollback;
    End;
    /
    duration for the insert script
    ====================
    SQL> @@d:/insert_bhanu.sql
    started at : 1084984928
    ended at : 1084988401
    
    PL/SQL procedure successfully completed.
    
    SQL> select 1084988401 - 1084984928 from dual;
    
    1084988401-1084984928
    ---------------------
                     3473
    I waz impossible of past all of the code... He has almost 13851 records. Please suggest me the best option, and if there is another way to achieve this.
    I need to provide a solution optimized to my clients.

    Concerning
    Rambeau.

    792353 wrote:

    I have two sql scripts. Having just insert statements and the other using bulk insert both do the same thing.

    Not really valid for the purposes of comparison.

    The fundamental question is what makes in bulk for faster processing. It is a well-known and easily answered--reduction in context switches between SQL and PL/SQL engines. And that's all. Nothing more and nothing magical.

    The easiest way to show this difference is to eliminate all other factors - especially I/O as a trial may be at a disadvantage by the physical i/o, while the comparison test can be promoted by e/s logic. Another factor that must be eliminated is extra unnecessary SQL that adds more overhead (such as the use of DOUBLE and unions) and so on.

    Remember that it is critical for the reference driver to compare like with like and eliminate all other factors. As simplistic as maybe keep it. For example, something like the following:

    SQL> create table foo_table( id number );
    
    Table created.
    
    SQL> var iterations number
    SQL> exec :iterations := 10000;
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> declare
      2          t1      timestamp with time zone;
      3  begin
      4          dbms_output.put_line( 'bench A: hard parsing, normal delete' );
      5          t1 := systimestamp;
      6          for i in 1..:iterations
      7          loop
      8                  execute immediate 'delete from foo_table where id = '||i;
      9          end loop;
     10          dbms_output.put_line( systimestamp - t1 );
     11  end;
     12  /
    bench A: hard parsing, normal delete
    +000000000 00:00:07.639779000
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> declare
      2          t1      timestamp with time zone;
      3  begin
      4          dbms_output.put_line( 'bench B: soft parsing, normal delete' );
      5          t1 := systimestamp;
      6          for i in 1..:iterations
      7          loop
      8                  delete from foo_table where id = i;
      9          end loop;
     10          dbms_output.put_line( systimestamp - t1 );
     11  end;
     12  /
    bench B: soft parsing, normal delete
    +000000000 00:00:00.268915000
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> declare
      2          type TNumbers is table of number;
      3          t1      timestamp with time zone;
      4          idList  TNumbers;
      5  begin
      6          dbms_output.put_line( 'bench C: soft parsing, bulk delete' );
      7          idList := new TNumbers();
      8          idList.Extend( :iterations );
      9
     10          for i in 1..:iterations
     11          loop
     12                  idList(i) := i;
     13          end loop;
     14
     15          t1 := systimestamp;
     16          forall i in 1..:iterations
     17                  delete from foo_table where id = idList(i);
     18          dbms_output.put_line( systimestamp - t1 );
     19  end;
     20  /
    bench C: soft parsing, bulk delete
    +000000000 00:00:00.061639000
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Why an empty table? Eliminates potential problems with the physical versus logical I/O. Why a delete and not Insertstatement? The same reason.

    The foregoing shows how slow hard analysis is clear. It has the advantage of soft analysis. It has the advantage of reducing the change of context, at the expense of additional memory - as bench 3 consumes much more memory (PGA) that other points of reference.

    Also note that these marks the exact same delete SQL statements - using different approaches. Where the approach only (and not the SQL) made the difference. This means that we can draw valid conclusions on each of these approaches.

    Can we say the same thing with the scripts you used to "show" that the treatment bulk is apparently slow?

  • I often get frequent blue screens on internet sites. Blue screen too fast for me to record specific error message. How can I put an end to the blue screen to get the error message?

    frequent blue screens often to internet sites.  Blue screen too fast for me to record specific error message.  How can I put an end to the blue screen to get the error message?

    en blue screen too fast for me to record specific error message.  How can I put an end to the blue screen to get the error message?

    If your computer is restarted when the BSOD appears, then you must change the by default for what to do in case of system error. It is easy to do, but takes a lot of mouse clicks to get there:

    Start | Control Panel | System | Advanced system settings (need for credentials for the administrator to spend here |) Advanced | Startup and recovery / settings.

    On this screen, uncheck the box under system failure that says automatically restart. The next time the BSOD appears, your computer will not do anything else until you press the reset button, so you'll have all the time you need to read and copy the error codes. Paste here, verbatim, and someone should be able to point in the right direction.

    ``````~~~~`````

    In the control panel choose reports on problems and Solutions (problem of type in the START search box), go to historical problem, right-click your error and choose check for the Solution. You can also examine the details.

    In administrative tools, choose the reliability and performance monitor and click on MonitoringTools then the reliability monitor (type reliability in research on Start). This list is a chart of the software installs, uninstalls, updated Windows and crashes by date. See if your plant has started to happen after you installed or uninstalled something.

    It may be useful to eliminate equipment defects

    Type of memory in the search box of start and choose Memory diagnosis

    In a command prompt (type command in the start search box then right click and choose Run as administrator) type

    CHKDSK c: /r

    If you have more than one drive replace C: with the other drive letters.

    Search for corrupted files by typing at the command prompt

    sfc/scannow

    You can clean boot troubleshooting http://support.microsoft.com/kb/331796

  • Performance issue Bulk Insert PL/SQL table type

    Hi all

    I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.

    Currently, I follow two approaches to implement the process described above. (Please see the code segments below). I need to choose how to best wise performance between these two approaches. I really appreciate all the comments of experts about the runtime of the two approaches.

    (I don't see much difference in consumption of time in my test environment that has limited the data series. This process involves building a complex set of structures of large product once deployed in the production environment).


    Approach I:_
    DECLARE
    TYPE of test_type IS test_tab % ROWTYPE directory INDEX TABLE;
    test_type_ test_type.
    ins_idx_ NUMBER;
    BEGIN
    ins_idx_: = 1;
    NESTED LOOPS
    test_type_ (ins_idx_) .column1: = value1;
    test_type_ (ins_idx_) .column2: = value2;
    test_type_ (ins_idx_) .column3: = value3;
    ins_idx_: = ins_idx_ + 1;
    END LOOP;

    I_ FORALL in 1.test_type_. COUNTY
    INSERT INTO test_tab VALUES (i_) test_type_;
    END;
    /


    Approach II:_
    DECLARE
    Column1 IS a TABLE OF TYPE test_tab.column1%TYPE INDEX DIRECTORY.
    Column2 IS a TABLE OF TYPE test_tab.column2%TYPE INDEX DIRECTORY.
    Column3 IS a TABLE OF TYPE test_tab.column3%TYPE INDEX DIRECTORY.
    column1 column1_;
    column2_ Column2;
    column3_ Column3;
    ins_idx_ NUMBER;
    BEGIN
    ins_idx_: = 1;
    NESTED LOOPS
    column1_ (ins_idx_): = value1;
    column2_ (ins_idx_): = value2;
    column3_ (ins_idx_): = value3;
    ins_idx_: = ins_idx_ + 1;
    END LOOP;

    FORALL idx_ in 1.column1_. COUNTY
    INSERT
    IN n_part_cost_bucket_tab)
    Column1,
    Column2,
    Column3)
    VALUES)
    column1_ (idx_),
    column2_ (idx_),
    column3_ (idx_));
    END;
    /

    Best regards
    Lorenzo

    Published by: nipuna86 on January 3, 2013 22:23

    nipuna86 wrote:

    I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.

    Performance is more than just reducing the execution time.

    Just as smashing a car stops more than a car in the fastest possible time.

    If it was (breaking a car stopping all simply), then a brick with reinforced concrete wall construction, would have been the perfect way to stop all types of all sorts of speed motor vehicles.

    Only problem (well more than one actually) is that stop a vehicle in this way is bad for the car, the engine, the driver, passengers and any other content inside.

    And pushing 3 million records in a PL/SQL 'table' (btw, that is a WRONG terminology - there no PL/SQL table structure) in order to run a SQL cursor INSERT 3 million times, to reduce the execution times, is no different than using a brick wall to stop a car.

    Both approaches are pretty well imperfect. Both places an unreasonable demand on the memory of the PGA. Both are still row-by-row (aka slow-by-slow) treatment.

  • Snap Shot recording is not with WVC54CGA of IE8

    I use WVC54CGA.

    I can view images from the camera with IE8. When I click on the snap shot button it goes through the movement to save the image, but it does not record.  I choose the top folder or desktop, but after clicking on save button there is no file anywhere.  I did a search for the file and it is not found.

    If I use the utility turned wink works very well to save the image file.

    Help

    Joe

    Uncheck the "require a secure server (https"under the list of trusted sites). I can't try it for you now, because I'm out of town.

    Maurice

    PS problem with firefox. You have Skype installed, if necessary to disable and uninstall the Skype firefox plugin, it causes the server not found error.

  • Bulk insert in an external table

    Hi, I get the error ora-29913, ora-01410 trying to do a bulk insert of external table

    INSERT

    IN CORE_TB_LOG

    (SELECT 'MODEL', 'ARCH_BH_MODEL', ROWID, "MODEL-D-000000001', - 45, 'A', SYSDATE, 'R'")

    OF ARCH_BH_MODEL1

    WHERE length (MOD_XCODIGO) > 10)

    INSERT

    *

    ERROR on line 1:

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend

    ORA-01410: invalid ROWID

    ARCH_BH_MODEL1 is the external table.


    What's wrong?


    Thank you.

    Hello

    There is no ROWID in external tables.

    It makes sense: ROWID identifies where a line is stored in the database; It shows the data file and the block number in this file.

    External tables are not stored in the database.  They exist independently of any data file in the database.  The concept of an Oracle block does not apply to them.

    Why would you copy the ROWID, even if you could?

    Apart from ROWID and SYSDATE, you select only literals.  You don't want to select all the real data of the external table?

    What is the big picture here?  Post a small example of data (a CREATE TABLE statement and a small data file for the external table) and the desired results from these sample data (in other words, what core_tb_log must contain after INSERTION is complete.)  Explain how you get these results from data provided.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • When inserting to reject incorrect records

    Hello

    I have a SQL query like
    insert into table1 select * from table2
    Table 2 has now some incorrect records. It; s a field table and the date of stage inside is VARCHAR2 format. And for little it records not in the right format. Then, when insert into table1 and making to_date it throws error.

    Error number: ORA-01878

    So now, I want to reject these recordings and insert the rest of the records. Please guide how this can be achieved.
    select * from v$version
    where banner like 'Oracle%';
    
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Thank you and best regards,
    Mr. lonely

    Published by: Mr lone on April 10, 2013 10:35 - added Version
    CREATE OR REPLACE FUNCTION checkDate(d VARCHAR2) RETURN DATE DETERMINISTIC IS
    BEGIN
      RETURN to_date(d,'dd.mm.yyyy');
    EXCEPTION
      WHEN OTHERS THEN RETURN NULL;
    END;
    
    WITH t(d) AS
    (
      SELECT '01.01.2013' FROM dual UNION ALL
      SELECT '04.04.2013' FROM dual UNION ALL
      SELECT '.2013' FROM dual UNION ALL
      SELECT '09.04.2013' FROM dual UNION ALL
      SELECT '01.asdasdasdsad' FROM dual
    )
    SELECT checkDate(d)  FROM t
    WHERE checkDate(d) IS NOT NULL
    

    Published by: Ramin Hashimzadeh on 10 April 2013 09:59

  • BULK collect for all

    I do need to update the deposit_tbl who have around 1500000 records. every day approximately 1 million records are up to date.
    I use the following code:

    DECLARE

    number of l_awaiting_status;
    number of l_pending_status;
    CURSOR s_cur IS
    SELECT DT. DEP_REF_NUM
    OF deposit_tbl dt
    WHEN DT. STATUS_VALUE = l_awaiting_status
    AND trunc (dt.settle_due_dt) < = trunc (sysdate);

    TYPE fetch_array IS TABLE OF s_cur % rowTYPE;
    s_array fetch_array;
    BEGIN
    l_awaiting_status: = 16;

    l_pending_status: = 0;
    OPEN s_cur;
    LOOP
    Fetch the s_cur COLLECT LOOSE s_array LIMIT 100000;

    FORALL i IN 1.s_array. COUNTY
    UPDATE deposit_tbl
    SET status_value = l_pending_status,
    update_by = "ST_SYSTEM."
    update_dt = sysdate
    WHERE DEP_REF_NUM = s_array (i);
    EXIT WHEN s_cur % NOTFOUND;
    END LOOP;
    CLOSE S_cur;
    END;


    error: expression of the wrong data type for condition WHERE DEP_REF_NUM = s_array (i);

    How can I avoid this problem and update the table in the recordset of 100000 at a time. NONMAL of loops is too expensive and parallel update is not possible.

    Hello
    Please replace WHERE DEP_REF_NUM = s_array (i); with WHERE DEP_REF_NUM = s_array (i). DEP_REF_NUM;.

    Thank you
    JULIEN

    Published by: dev. On January 21, 2013 Oracle 06:32

  • SELECT from Bulk INSERT - Performance Clarification

    I have 2 tables-emp_new & emp_old. I need to load all the data from emp_old to emp_new. Is there a transaction_id column in emp_new whose value should be extracted from a main_transaction table that includes a column of region Code. Something like -

    TRANSACTION_ID REGION_CODE
    ------------------------- ------------
    100. WE
    AMER 101
    APAC 102

    My bulk insert query looks like this-

    INSERT INTO emp_new
    (col1,
    col2,
    ...,
    ...,
    ...,
    transaction_id)
    SELECT
    col1,
    col2,
    ...,
    ...,
    ...,
    * (Select transaction_id from main_transaction WHERE region_code = 'US') *.
    Of emp_old

    There are millions of rows that need to be loaded this way. I would like to know if the Subselection to fetch the transaction_id would be re-executed for each line, which would be very expensive and I'm actually looking for a way to avoid this. The main_transcation table is pre-loaded and its values will not change. Is there a way (via some SUSPICION) to indicate that the subselect should not re-run for each line?

    On a different note, the implementation plan of the whole above INSERT looks like-

    --------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU).
    --------------------------------------------------------------------------
    | 0 | INSERT STATEMENT. 11 M | 54 M | 6124 (4) |
    | 1. FULL RESTRICTED INDEX SCAN FAST | EMPO_IE2_IDX | 11 M | 54 M | 6124 (4) |
    --------------------------------------------------------------------------
    EMPO_IE2_IDX-> Index on emp_old

    I'm surprised to see that the main_transaction of the table is not in the execution plan at all. Does this mean that the subselect is not executed for each line? However, at least for the first reading, I suppose that the table must appear in the plan.

    Can someone help me understand this?

    Why the explain command plan includes no information about the table of main_transaction
    Can someone please clarify?

    As I said originally (and repeated in a later post) - probably because PLAN_TABLE is an older version.
    More recent versions of PLAN_TABLE are required to correctly report "most recent" functions implementation plans.

  • Bulk Insert using databaselink in oracle 10 g (10.2)

    Bulk insert with data link gives an error like 'cannot insert null into the column primary code as follows
    ForAll i in < type name > such... < type name > .last
    insert into < table_name > name of @databaselink values...

    If I use the code throws above an error cannot insert null. But if I use the same collection with simple insert it works
    the code as follows

    I'm in < type name > such... < type name > .last
    loop
    Insert in the name of @databaselink values < table name >...
    end loop;
    It worked. ?!!!!!

    I was wondering what would be the solution and where it wasn't. Please throw some light on this
    Thanks in advance

    Bulk operations are used to minimize the change between PL/SQL and SQL context engines.
    For remote database operations, there is no context switching of each link DB must open a new connection.
    If you can ensure that your procedure @ distance DB only you can use the features in bulk collect.

    Thank you
    Fahad Aziz Khan

  • inserting data 1 million through the command copy

    Hello

    I tried to insert data 1 million per copy command sqlplus, but because of tablespace size problem

    "ORA-30036: unable to extend segment by 1024 in undo tablespace"UNDOTBS1"" error is coming.

    I cann 't take the help of s/n cos my enviornment cann' t b has changed.

    So is it possible to insert 1 million through the command data copy both

    Thanks in advance

    BP says:
    Hello

    I tried to insert data 1 million per copy command sqlplus, but because of tablespace size problem

    "ORA-30036: unable to extend segment by 1024 in undo tablespace"UNDOTBS1"" error is coming.

    I cann 't take the help of s/n cos my enviornment cann' t b has changed.

    So is it possible to insert 1 million through the command data copy both

    Apart from the other advice you have already, you might be thinking how to use a direct-path insert access instead of the COPY"" command.

    If you use "INSERT / * + APPEND * / IN...» You will not use all CANCEL as long as you're not violating any restrictions direct-path insert SELECT FROM... ». Most commonly encountered are active triggers and foreign keys or primary/unique constraints can be delayed.

    A fairly comprehensive list of restrictions is located in the documentation:

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28313/usingpe.htm#CACEJACE

    Outside do not use CANCEL the access direct-path insert is usually a bit faster that the conventional insert, then you want to give it a try.

    Note, however, that you are unable to access the object that you inserted by using direct-path insert of access in the same transaction, this triggers error "ORA-12838: cannot read/modify an object after edit it in parallel." So if you need to access the same object once again without committing the transaction, does not allow direct-path inserts.

    In addition the access direct-path insert will not re - using the available space in the already allocated blocks, so if you insert frequently subsequently delete a significant number of lines your table will increase with each path direct insert operation and leave unused space behind, affecting the performance of full table scans since it will have to go through all the blocks, although they could be empty (or almost).

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

Maybe you are looking for

  • MacBook Air won't turn on.

    Hello I have a MacBook Air, which is about 1.5 years old, without any problem so far.  He began with a stop at random in the login screen.  When the computer reboots, it turned on for a few seconds then turns off.  He didn't say 'Stop' or something l

  • Lenovo multi-mode F800 WiFi storage - formatting options?

    Basically, it's a 1 TB hard with Wifi capabilities allowing up to 5 devices to connect.My plan when I bought was connected to my NAS Linkstation of Buffalo as attaché USB storage as a backup device - then I could bring him on holidays for films of ch

  • A Turbo charger is for the car?

    I'm not wondering if Motorola (or other) is a car charger which uses turbo technology?

  • Laptop Pavilion g7; Computer overheats and turns off

    Hello Last year, I had my laptop, a g7 Windows 8 Pavilion and it was fine for about 5 months, but after that, it began to overheat sometimes and give me the link www.hp.com/go/techcenter/startupward to help. After that he became more frequent and it

  • programming for PXI-6071e with SCXI1125

    Dear all, I connected the SCXI-1001 chassis with card Conditioning SCXI-1125 and SCXI-1327 block with PXI-6071E PXI-8176 with SH1006868 cable controller card. I chose the SCB-100 for PXI-6071 accessories, as there is no option to select SH1006868. I