How to remove 60 million lines

Hi all

I have table tb1 with 60 million and I have another painting tb2 with 30 million

I want to delete tab2 regarding the one table

For this I wrote a procedure to dellete this. but when iam trying to run after 4 minutes of the procedure does not work due to large data:

 PROCEDURE temp (id IN NUMBER)
AS
   CURSOR c
   IS
      SELECT order
        FROM tab1
       WHERE (status = 'A'
              AND billdt < ADD_MONTHS (SYSTIMESTAMP, -12))
             OR (status IN ('B','C')
                 AND orderdt < ADD_MONTHS (SYSTIMESTAMP, -12));

   TYPE ordernum IS TABLE OF tab1.order%TYPE;

   order1   ordernum;
BEGIN

   OPEN c;

   LOOP
      FETCH c
      BULK COLLECT INTO order1
      LIMIT 1000;

      FORALL i IN 1 .. order1.COUNT
         DELETE FROM tb2
               WHERE id = order1 (i);

      EXIT WHEN c%NOTFOUND;
   END LOOP;
   COMMIT;
    EXCEPTION
      WHEN OTHERS
      THEN
         ROLLBACK;
       END ;
       
can someone help me!

Thanks in advance

When possible, you should try a solution based game (for example, a SQL statement).

This gives a shot:

DELETE FROM tb2
WHERE  order IN ( SELECT order
                  FROM   tab1
                  WHERE  (   status = 'A'
                         AND billdt < ADD_MONTHS(SYSTIMESTAMP, -12)
                         )
                  OR     (   status IN ('B','C')
                         AND orderdt < ADD_MONTHS(SYSTIMESTAMP, -12)
                         )
                )
;

If it is still too slow, so we have to look at alternative methods. These threads can be interesting to read this way.

{message: id = 1812597}

{: identifier of the thread = 863295}

Tags: Database

Similar Questions

  • How to remove the new line?

    Hello

    I read a text file using java and send its contents by mail. I want to remove space (new line) as shown below in line 3. How can I do in java?

    Content of the file text (line numbers for reference)

    Line1: Sales details 1
    Row2: CN P1 C1 E1 1,958
    Line 3:
    4: Sales details 2
    Line5: CN P2 C2 E2 2,529

    Thank you
    K. Henry

    May not be more obvious.

    if(!(members.contains(strLine)) &&!"".equals(strLine.trim()))
    
  • How to remove the black line with a canvas stacked at run time?

    Hi all
    I developed a canvas stacked in a table of content, when I run the form takes the apeared canvas stacked with a black line.
    How to remove this line, or how to remove this line at run time?
    I tried to do by putting (no line) in the Toolbox of the line color tool after selecting black line one and after selecting the stacked another painting once, but this has not solved the problem!

    I need something else:
    I put the canvas stacked to the block of data in detail and did not appear since I run the query in the database block
    How to make appear stacked directly canvas before you run the query in the master data block?

    What is your version of forms? I don't know what black line you're talking about.

    Regarding the display of the canvas, first make sure it isn't about who has the focus and she rides (located under the canvas completely or partially) your canvas stacked, this will cause to the canvas to hide in order to display the item that has the focus. And you can also try using SHOW_VIEW ('your_stacked_canvas'); in your form, this will show the stacked canvas.

    Tony

  • I still have not found "help" to tell me how to remove all the lines and columns beyond those needed for my spreadsheet.

    I used several worksheets.  More allows me to specify the rows/columns and then delete them.  This is to remove all the lines/columns beyond those set up and formatted for my spreadsheet.   I tried many ways to remove all additional lines/columns, but without success.  I even took the time to scroll down/on to highlight all the unnecessary lines and columns, but they do not remove it.
    Any suggestions?  I used spreadsheets most allow me to specify the number of rows/columns for my worksheet

    You can ask your question in the office | Excel Forum because it is not really a problem of Windows XP performance and maintenance.

    Office | Excel

    http://answers.Microsoft.com/en-us/Office/Forum/Excel

    Also, providing specific information may help to get a faster response or better, such as the version of Office or Excel? version of Windows XP? Home, Pro, 32-bit or 64-bit.

    I hope this helps.

  • How to remove newly added line in table advanced

    Hello

    It comes to 12.1.3.

    I have a case of use with advanced table and the "Add Row" button.

    The user can add two lines (empty), field 2 (both part of PK, the two LOVs), then start filling, then realizes he added too many, because the TooManyObjectsException exception is thrown. What would be the 'Nice' way of having the last added row deleted, or some newly added lines to delete if a few lines have been added (before actually trying to commit). I mean how must reference any row that has been added and should be removed - this line do always not PK (PK because not even adjustable due to violation of PK if this makes sense). Is there a fun/easier way to do it? Would be great if someone could share a line or two...

    Thank you

    Anatoliy

    PS

    I have a delete button in a footer with action to fire the event as 'remove' in LICS, I like below, and copy the following code deletes the LAST record in the advanced table, not the one where the cursor is?

    If ("delete".equals (pageContext.getParameter (EVENT_PARAM)))
    {
    String rowRef = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Line OARow = (OARow) am.findRowByRef (rowRef);
    Row.Remove ();
    }

    Asmirnov-Oracle wrote:

    Hello

    Yes, I actually try this approach too.

    Have what approach you tried? 1 or 2?

    If you try to follow the second approach, you can try this?

    OAViewObject srcAppvo = (OAViewObject)findViewObject("SrcAppVO1");
    if (srcAppvo != null) {
        RowSetIterator srcAppRowItr =
            srcAppvo.createRowSetIterator("srcAppRowItr");
    
        try {
            Row srcAppRow;
            srcAppRowItr.setRangeStart(0);
            srcAppRowItr.setRangeSize(srcAppvo.getFetchedRowCount());
            int recCnt = srcAppvo.getFetchedRowCount();
            while (srcAppRowItr.hasNext()) {
                srcAppRow =
                        srcAppRowItr.next();
                if (srcAppRow != null) {
                    if (srcAppRow.getAttribute("SelectFlag") != null &&
                        srcAppRow.getAttribute("SelectFlag").toString().equals("Y")) {
                        srcAppRow.remove();
                    }
                }
            }
        } finally {
            srcAppRowItr.closeRowSetIterator();
        }
    }
    
  • Re: How to remove the black lines that prints when I use my ADF?

    I have an Officejet 6500 has more.  I only get the double lines when using the document feeder.  Fine when I use the flat bed.  I thoroughly cleaned the glass, and it makes no difference.  Help!

    The ADF in the Officejet 6500 a scanner glass is a bit more difficult to access, but the video in the third step of the second Solution in the here document will show how to clean this area.

  • How to remove white (border) line on the cutout pictures sliced with links?

    Hello..  I've attached a screen that shows the white lines, I would like to remove.  I already tried to use the style = css syntax "display: block" in the line of each image.  The syntax worked for superior images, but not the images below as shown in the screenshot.

    Note: This occurs only in a Windows 7/Chrome/Web Gmail interface.  On Mac, Outlook 2011, Chrome Mac, Mac Safari, iPhone, Samsung phone html email looks perfectly intact without borders lined with white.  Yahoo Web mail on Windows 7/Chrome works fine as well.  Thank you.

    Lines.jpg

    I use Dreamweaver CS6

    I was typing the above, I realized that the problem was isolated to machine W7 1.  So I uninstalled Chrome and re-installed (same version) and wala!  Problem solved!  The E-mail in Gmail Web using Chrome displays perfectly!

  • How to remove or delete line empty space between paragraphs

    I want to remove or delete the space of empty line between paragraphs.

    and in each content page should be the end in the same line down...

    love books...

    indesign #target

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

    cleanup_module (app.activeDocument, true);

    myDocument var = app.activeDocument;

    var inddFile = new File (myDocument.filePath + "/ Gardner.indd");

    app.activeDocument.save ();

    Alert ("cleanup_module completed!")

    Exit();

    function cleanup_module (scope, caps)

    {

    app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findChangeGrepOptions.includeFootnotes = true;

    app.findChangeGrepOptions.includeHiddenLayers = true;

    app.findChangeGrepOptions.includeLockedLayersForFind = true;

    app.findChangeGrepOptions.includeLockedStoriesForFind = true;

    app.findChangeGrepOptions.includeMasterPages = true;

    app.documents.everyItem ().xmlElements.item (0).xmlElements.everyItem () .untag ();

    series of tabs

    change_grep (scope, "\\t\\t+", "\\t");

    series of statements

    change_grep (scope, ' ~ b ~ b + ',' ~ b');

    series of spaces

    change_grep (scope, "\\x{20}\\x{20}+" {, ' \\x{20} "");

    spaces and tabs

    change_grep (scope, "\\s+$", "");

    main spaces/tabs

    change_grep (scope, ' ^ \\s+', ' ');

    change_grep (scope, ' ~ e + ','. ~ s ~ S.');

    change_grep (scope, '...) «, ». (~ S.~S.~S.');

    }

    function change_grep (obj, f, r)

    {

    app.findGrepPreferences.findWhat = f;

    app.changeGrepPreferences.changeTo = r;

    obj.changeGrep)

    }

  • How to remove duplicate Oracle lines and retain the last rows in double

    Hello

    I have millions of records in the table. Some values / duplicate rows are inserted into it.
    I want to just delete the duplicate lines but I also want to keep the last duplicate line.
    For example if a record is found three times, I want to delete the first and second record and keep
    the third is to say the last inserted a.


    Concerning
    Valérie Singh

    Hello

    PLS, try the commond...!

    1.
    delete from  a where rowid<(select max(rowid) from  b
    where a.ID = b.ID (or perticular column name). 
    
    OR 
    
    2.
    delete from  a where rowid>(select min(rowid) from  b
    where a.ID = b.ID (or perticular column name). 
    
    for example emp table a.empno=b.empno;
    

    * If you are satisfied with this answer make as correct
    * If you're ok withi this answer helpful also

    Concerning
    KPR

  • How to remove the jump line, characters and past of a table column?

    HII,

    I m using 4 Apex.
    I m find the problem by removing the line break, characters and captures existing data in the column of the table.


    thnx in advance

    for example

    replace(replace(l_string_var, chr(10)),chr(13))
    

    Best regards
    Marko

    Published by: Marko Goricki, January 17, 2011 10:52

  • How to remove a black line between the two parts of the scanned image?

    Hello

    I scanned a drawing I did a long time ago.

    But given that the paper is too large for the scanner, I had to do two scanning. I wanted to join these two parts as in Photoshop.

    I loaded the left side of the drawing.

    I changed the size of the canva so the second part could be put there.

    I loaded the part right of the drawing and copied and paste it on the canva of the left side of the drawing.

    But whatever I do, I can see a vertical black line where the left and right hand reach. On the contrary, where the right side starts, it seems.

    Could someone tell me (or direct me to a tutorial that tells about) what to do in this case?

    Thanks in advance for your answers.

    This isn't under file, Scripts, but under file, PLC.

  • How to remove the last line of Utl_file

    Hi I have a requirement to write the output to a file. But everything I try the last line is coming as white. I can't understand why UTL_file last blank line as null. Is aby wat to fix this problem?

    /

    Declare

    Lfilehandler Utl_File.File_Type;

    Lfilepath varchar2 (100);

    Varchar2 (100) Lfilename: = "TESTFATCAFILEGEN.txt";

    Lhead VARCHAR2 (2000);

    Begin

    Dbms_output.put_line (' started read directories ");

    SELECT Filepath

    IN Lfilepath

    OF Interfacefileformathdrtbl

    WHERE Interfaceid = "FATCAPREXTFEED";

    Dbms_output.put_line ('found directory');

    Lhead: = ' this is a test generated file to test if the generation of the file that is happening or not. "

    Lfilehandler: = Utl_File.Fopen (Lfilepath, Lfilename, 'W');

    Utl_File.PUTF (Lfilehandler, Lhead |) '\n');

    Utl_File.fclose (Lfilehandler);

    Dbms_output.put_line ('generation of the file is complete");

    exception

    While others then

    Dbms_output.put_line ('down in the generation of file');

    Dbms_output.put_line ("sqlerr" |) SQLERRM);

    End;

    /

    UTL_FILE adds always new line at the end of the file if you use text mode. You must use the byte mode:

    Declare

    Lfilehandler Utl_File.File_Type;

    Lfilepath varchar2 (100);

    Varchar2 (100) Lfilename: = "TESTFATCAFILEGEN.txt";

    Lhead VARCHAR2 (2000);

    Begin

    Dbms_output.put_line (' started read directories ");

    SELECT Filepath

    IN Lfilepath

    OF Interfacefileformathdrtbl

    WHERE Interfaceid = "FATCAPREXTFEED";

    Dbms_output.put_line ('found directory');

    Lhead: = ' this is a test generated file to test if the generation of the file that is happening or not. "

    Lfilehandler: = Utl_File.Fopen (Lfilepath, Lfilename, 'WB');

    Utl_File.Put_RAW (Lfilehandler, UTL_RAW. CAST_TO_RAW (Lhead));

    Utl_File.fclose (Lfilehandler);

    Dbms_output.put_line ('generation of the file is complete");

    exception

    While others then

    Dbms_output.put_line ('down in the generation of file');

    Dbms_output.put_line ("sqlerr" |) SQLERRM);

    End;

    /

    SY.

  • How to remove the blue line, the Date and the name of your Signature blocks?

    We would use esign for documents; However, these documents are dated elsewhere and the signature should not be dated. Is there a way to turn the blue line, power in esign etc on and off? Thank you!

    Hi Lillian,

    Then, it seems you are the user and does not take into account admin. Pouvez you inbox me your email address recorded so I can verify your account?

    Kind regards

    -Usman

  • How to remove a gray line around a picture empty in DW CS6

    I have an image that I recover files from a database (the trail) are stored in a folder.

    However when there is no picture the outline of the image is still there.

    I managed to get the dreamweaver image CS6 gives you automatically (if there is an error, etc), but the outline is still there even if you set the border to zero. When there is a picture it is shown without a border

    Is there a solution to remove the border from the empty image or remove the image empty all together

    Please find my code I use under

    <img src="<?php if (is_null($row_Recordset1['SmalImage2'])) { 
    
    } else {
    
    }   $file_path.$row_Recordset1['SmallImage2']; ?>" alt="<?php echo $row_Recordset1['Manufacturer']; ?> <?php echo $row_Recordset1['Model']; ?>" name="t2" width="60" height="60" id="t2" onClick="MM_swapImage('main','','<?php echo $file_path.$row_Recordset1['LargeImage2']; ?>',1)"border = "0"></td>
    
    

    Thank you very much

    It works now, not sure what I did different but the code following the tour

    
    " alt="  name="t2" width="60" height="60" id="t2" onClick="MM_swapImage('main','','',1)"border = "0">
    

    Thanks for sticking with me to get it sorted

    RIA

  • How to remove the default line break when you export in XML format?

    Hello

    I'm using FDK 11 to convert a FrameMaker to XML file. Basic example as in the "guide structured Import/Export API Programmer" works very well. But all my files frame long paragraphs which, then the conversion is a line break after a length that appear to be the default. Hereby, the length of the XML and the readability becomes tedious. Here is the snapshot of the transformation and the piece of code used. Please let me know if there is a function that allows to eliminate this default behavior.

    #include "futils.h".

    extern VoidT Structured_ApiEmergency ((VoidT)) FARGS;

    extern VoidT Structured_ApiInitialize ((init IntT)) FARGS;

    extern VoidT Structured_ApiCommand ((command IntT)) FARGS;

    extern VoidT Structured_ApiNotify FARGS ((IntT notification,

    F_ObjHandleT docId, sparm StringT,

    IntT iparm));

    VoidT F_ApiEmergency() {}

    Structured_ApiEmergency();

    }

    VoidT F_ApiInitialize (IntT init) {}

    Structured_ApiInitialize (init);

    }

    VoidT F_ApiCommand (IntT command) {}

    Structured_ApiCommand (Command);

    }

    VoidT F_ApiNotify (IntT notification,

    F_ObjHandleT docId, StringT, IntT iparm sparm) {}

    Structured_ApiNotify (notification, docId, sparm, iparm);

    }

    Export.jpg

    Thank you

    Vincent

    [Message moved from General Discussion by moderator]

    Hi Vincent,.

    You use a structured application? If so, you might try reading/writing as a rule:

    writer

    {

    line break is 1000 characters;

    }

    .. .or whatever length you deem appropriate.

    Russ

Maybe you are looking for