Best way of delete records??

Hi,
I'm having a performance problem, i need to del 8 million records from a table that as more then 50 millions. The table has partitions by the column that is used in the delete where clause. I created the following procedure to do it:
procedure del_pay(v_year in number, v_month in number) is
cursor c_pay is
select rowid from payments
where am_integ = ((v_year * 100) + v_month);
x number;
y number;
TYPE t_rowid IS TABLE OF VARCHAR2(100)
index by binary_integer;
tab_rowid t_rowid;
begin
open c_pay;
FETCH c_pay BULK COLLECT INTO TAB_ROWID;
close c_pay;
y := tab_rowid.FIRST;
x := 50000;
loop
exit when x > tab_rowid.last;
FORALL I IN y..x
delete from payments d
where d.rowid = tab_rowid(i);
commit;
y := x + 1;
x := x + 50000;
END LOOP;
FORALL I IN y..tab_rowid.last
delete from payments d
where d.rowid = tab_rowid(i);
tab_rowid.delete;
dbms_session.free_unused_user_memory;
commit;
end del_pay;
is there other way of mking this to run faster?
thanks for your help.

I think you could try using a DELETE statement instead of going through a cursor loop. Check if an INDEXES are present, if possible try to DISABLE those indexes.
Thanks

Similar Messages

  • Is there a way to delete records from MDM automatically?

    Is there a way to delete records from MDM automatically?
    I am able to import the data automatically through MDIS, but I have to delete the data first. Itu2019s possible to do it ?

    Hi Adam,
    Current scenario
    USER1: call ME to delete old catalog data
    ME: open the MDM & delete it manually
    USER1: Transaction to extract new data file
    MDIS: load the data to catalog
    As per your requirement, you should save map in following way which can solve your purpose. Create a XML file which should consist of new and existing records. So in import Manager, for newly added records you need to set Default Import Action as Create and for existing records you should use or set Default Import Action as Replace and then should save in map.
    So using this every-time if new record comes (not available in data manager), it will get created and for existing record (already available in Data Manager) it will replace (which means delete the existing record (old catalog data) and create a new record).
    Regards,
    Mandeep Saini

  • Best way to delete transcoded and proxy media?

    Hello,
    I am trying to free up some disc space and am curious what is the best way to delete transcoded and proxy media in fcpx?  I know I can open up a library bundle and delete the folder, but is this safe?  There must be a better option...
    Thanks,
    Austin

    Austin Samuel wrote:
    Hello,
    I am trying to free up some disc space and am curious what is the best way to delete transcoded and proxy media in fcpx?  I know I can open up a library bundle and delete the folder, but is this safe?  There must be a better option...
    Thanks,
    Austin
    I don't know of any other way.
    Proxy and Transcoded media can always be re-generated if the original files are in place.
    If this question refers to your system drive then a BIG suggestion is to aquire a fast dedicated media drive.
    Al

  • What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    To completely remove an app and all of its data, do this: First delete the app on your phone, then in iTunes, under Library, click on Apps, right-click the app you want to delete & select delete, when prompted, move all files to trash, empty your trash. Connect your phone and sync. The app and all of its data will be gone.

  • I own CS4, upgraded to CS5, then joined CS6, CC... and now I installed CC14. Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues? I have an Alienware Area 51 PC running Windows 7.

    I own CS4, upgraded to CS5, then joined CS6, CC... and now I installed CC14. Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues? I have an Alienware Area 51 PC running Windows 7.

    Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues?
    There is none. Whatever you do to get rid of the older versions will inevitably do damage to shared components and other stuff of the new versions as well. That's just how it is with this approach... Uninstall the older versions, run the cleaner tool then reinstall CC 2014.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    Mylenium

  • What is the best way to delete MacKeeper?

    I installed MacKeeper last year in an attempt to free up some hard drive space on my former hard drive. I now have a new SSD and have no need for MacKeeper. In addition, I see that this programme attracts a lot of negative press.
    What is the best way to delete MacKeeper from my hard drive and Time machine?

    Remove the "MacKeeper" crapware as follows. First, back up all data.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select Go ▹ Applications from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Then a dialog will pop up asking why you want to uninstall it. You don't have to provide that information. Enter anything you like in the text box, then click the Uninstall MacKeeper button. All the functional components of the software will be deleted. Reboot.
    Do not try to uninstall by dragging the MacKeeper icon in the Dock or the LaunchPad to the Trash.
    Here are some general suggestions. If you want your computer to be usable, don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” "tune-ups," “accelerators,” “extenders,” “cleaners,” “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this kind of material is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.

  • What is the best way to delete applications?

    I am told that my Mac came with everything I need in the way of programs for basic functions.  What is the best way to delete applications making sure there are no threads left in Library and other places?

    Yes, but not always. An example of what I call "System" files/folders would be Quicktime or things like pre-installed print and scanner drivers. You have to be pretty confident to go rummaging through files in either /System or /Library. Most of the time there is no reason to be in there.
    An example of a file that is in those system folders, that does not come pre-installed as of Lion, is Flash plug-ins. That gets installed in the /Library/Internet Plug-Ins
    But your average App downloaded from the MAS, most of it's files will be in the User Folder   ~/username

  • Given ipod from someone best way to delete their music and add to my apple id

    Have been given ipod from someone what is best way to delete their music and then sync to my itumes and apple id

    Hi Caz0,
    You might want to try to factory reset the iPod to wipe it completely. Here's a link on how to do it: http://support.apple.com/kb/ht1339
    As far as I'm aware an iPod Classic isn't tied to an Apple ID, therefore all you need to do is factory reset the iPod, sync your music library and plug in headphones, and you're ready to go!
    Good Luck,
    Stefan

  • Best way to delete large number of records but not interfere with tlog backups on a schedule

    Ive inherited a system with multiple databases and there are db and tlog backups that run on schedules.  There is a list of tables that need a lot of records purged from them.  What would be a good approach to use for deleting the old records?
    Ive been digging through old posts, reading best practices etc, but still not sure the best way to attack it.
    Approach #1
    A one-time delete that did everything.  Delete all the old records, in batches of say 50,000 at a time.
    After each run through all the tables for that DB, execute a tlog backup.
    Approach #2
    Create a job that does a similar process as above, except dont loop.  Only do the batch once.  Have the job scheduled to start say on the half hour, assuming the tlog backups run every hour.
    Note:
    Some of these (well, most) are going to have relations on them.

    Hi shiftbit,
    According to your description, in my opinion, the type of this question is changed to discussion. It will be better and 
    more experts will focus on this issue and assist you. When delete large number of records from tables, you can use bulk deletions that it would not make the transaction log growing and runing out of disk space. You can
    take the table offline for maintenance, a complete reorganization is always best because it does the delete and places the table back into a pristine state. 
    For more information about deleting a large number of records without affecting the transaction log.
    http://www.virtualobjectives.com.au/sqlserver/deleting_records_from_a_large_table.htm
    Hope it can help.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • What's the best way to delete 2.4 million of records from table?

    We are having two tables one is production one and another is temp table which data we want to insert into production table. temp table having 2.5 million of records and on the other side production table is having billions of records. the thing which we want to do just simple delete already existed records from production table and then insert the remaining records from temp to production table.
    Can anyone guide what's the best way to do this?
    Thanks,
    Waheed.

    Waheed Azhar wrote:
    production table is live and data is appending in this table on random basis. if i go insert data from temp to prod table a pk voilation exception occured bcoz already a record is exist in prod table which we are going to insert from temp to prod
    If you really just want to insert the records and don't want to update the matching ones and you're already on 10g you could use the "DML error logging" facility of the INSERT command, which would log all failed records but succeeds for the remaining ones.
    You can create a suitable exception table using the DBMS_ERRLOG.CREATE_ERROR_LOG procedure and then use the "LOG ERRORS INTO" clause of the INSERT command. Note that you can't use the "direct-path" insert mode (APPEND hint) if you expect to encounter UNIQUE CONSTRAINT violations, because this can't be logged and cause the direct-path insert to fail. Since this is a "live" table you probably don't want to use the direct-path insert anyway.
    See the manuals for more information: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
    Sample taken from 10g manuals:
    CREATE TABLE raises (emp_id NUMBER, sal NUMBER
       CONSTRAINT check_sal CHECK(sal > 8000));
    EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog');
    INSERT INTO raises
       SELECT employee_id, salary*1.1 FROM employees
       WHERE commission_pct > .2
       LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10;
    SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog;
    ORA_ERR_MESG$               ORA_ERR_TAG$         EMP_ID SAL
    ORA-02290: check constraint my_bad               161    7700
    (HR.SYS_C004266) violatedIf the number of rows in the temp table is not too large and you have a suitable index on the large table for the lookup you could also try to use a NOT EXISTS clause in the insert command:
    INSERT INTO <large_table>
    SELECT ...
    FROM TEMP A
    WHERE NOT EXISTS (
    SELECT NULL
    FROM <large_table> B
    WHERE B.<lookup> = A.<key>
    );But you need to check the execution plan, because a hash join using a full table scan on the <large_table> is probably something you want to avoid.
    Regards,
    Randolf
    Oracle related stuff blog:
    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/

  • What is the best way to delete dynamically-generated symbols from another symbol?

    in the onClick handler for 1 symbol, I have:
    var sandwhichQty1 = sym.createChildSymbol("sandQty1", "Stage");
    another symbol inside sandQty1 has the onClick method:
    this.deleteSymbol();
    which works fine, deleting sandQty1. I'd like to delete it, and others, from another button, in the circumstance where users don't close them this way.
    I notice that id and class are dynamically assigned to the child symbol, which makes it hard for me.
    any ideas?

    Hi, I did it in this way, and functions well; maybe this is not the best way, but worked for me. Obviously this code is based on the elainafineell's correct solution.
    This is my scenario:
    In a Trigger @ xxxxms there is that:
    var i = 1;
    $.each(results, function(index, element)
         var s = sym.createChildSymbol("mySymbol", "someContainer");
         // some code here
         // Creating the variable that save my new instance of mySymbol
         sym.setVariable("var_id"+i, s);
         i++;
    // a global var, take care with the name
    numOfInstances = i;
    Then, in a click action of some button, symbol, anything that support an action, I code this:
    sym.eraseSymInstance();
    And, in the creationComplete, I code the function like this:
    sym.eraseSymInstance = function()
              for(var i = 1; i <= numOfInstances; i++)
                             var s = sym.getVariable("var_id"+i);
                             s.deleteSymbol();
    For me function well.
    I hope this can be usefull for somebody else.

  • Best way to Insert Records into a DB

    hi
    i have around 400000(4 lakh ) records to insert into a db , whats the optimal way to do it ,
    i tried it doin g using threads i could gain only 2 seconds for 4 lakh records ,suggest me a better way

    Very hard thread, poor informations u give us can not help me too much to understand really the problem.
    Where do u have to 40.000K (input) records?
    Those records must be only added to output table?
    How many rows, and how many indexes output table has?
    The cost oh each insert depends also on how many indexes dbms has
    to manage on oupy table.
    In general to take about 2 seconds to add to a table a large amount of rows depends on many variables (hardware performances, dbms performances and so on)
    If u ahve only to insert and your input secord statys on another table,
    I think that a performance way to do it is insert select, so
    insert into output select * from input
    If your input records statys on a text file, the best way is to use
    native dbms importer
    Let me know something more....
    Regards

  • Best way of filtering records in a block

    Hi,
    i have a form with a data block that i want to filter. when i launch the form all records are fetched but then i want to choose the records displayed base on some criteria. Can i apply this criteria to the block so that it is not necessary to requery the database? Which is the best way to achieve this?
    Best regards,
    Bruno Martins

    To save network traffic, you may search from the form memory. Since you first got all deptments and its employees, which stays in form memory. then you should not use set_block_property('..',default_where), which will requery database.
    Then you may add another button inside add ENTER_QUERY;
    then in the when-list-changed trigger,
    GO_ITEM('emp.deptno');
    :emp.deptno := :delptno_list;
    execute_query;
    This way will just search among records in memory. But you may payoff with another ENTER_QUERY button or use default menu bar ENTER QUERY button item.

  • Time Machine Backup is Full, best way to delete?

    Hi,
    I'm stuck in this problem. Few days ago my TM told me that it didn't have the required space to make a backup which I though was odd because it has always automatically removed older backups to make room for new ones. But not this time.
    Which means I need to manually delete some backups. What is the best way to do it?
    I marked some of them and pressed command+backspace to delete them put they ended up in my trash so when I tried to empty my trash it tells me I have 1 306 229 objects to delete and this is probably gonna take weeks.
    Can someone help me with this?

    Time Machine should normally remove old items from the backup to make room for new. If it is unable to do that, it could be because your backup drive is not large enough for what you're backing up. TM needs a minimum of 2-3 times more space for the backups as what is being backed up. There could also be something wrong with your backup, in which case you could visit the [Time Machine Troubleshooting guide|http://discussions.apple.com/thread.jspa?threadID=2057525].
    Unfortunately, since you deleted stuff from your Time Machine backup in the Finder (from the sounds of it), it's too late for any troubleshooting. You have destroyed your backup, and will have to erase the backup drive and start from scratch.

  • Need help knowing best way to create record

    What is the best way to create a new record... I have a form pulling info from about 20 tables. When the user wants to create a new record, I want a new form to open and allow them to select the values based on the foreign key fields so it makes more sense than just random numbers.
    The problem I'm having is knowing when and how to insert. Should the "new record" form be it's own database block that inserts from within it. (but then when they go back to the original form they must requery to see the new value.) Or what about copying each field back to the original form. I'm new to forms and would appreciate any insight and tips.

    would a wire like this help me?
    I doubt it. You want FireWire.
    Take look at the Canopus ADVC300. It comes with a nice Macintosh application that works flawlessly with iMovie 06.
    http://www.canopus.com/products/ADVC300/index.php
    Yes, it does cost more but it works.

Maybe you are looking for

  • IPhone 5 that was purchased as 'unlocked' won't work with my carrier!

    I purchased a few days ago an unlocked iphone 5 from an apple store at Barcelona in full price of 667 euros and i can't get it to work with my carrier. I live in Israel and there is no way i can contact that store. I tried looking for a relevent plac

  • With a high volume of tabs, scrolling to the end of the tab list often resets to the first tab

    Firefox 34.0.5 When using a large number of tabs, around 300 inactive and 30 active tabs, when the currently selected tab is a tab on the far left side of the tab bar, attempting to scroll to the end (far right) side of the tab bar will often cause s

  • Unable to open jsp in JDev 10.1.3.3

    Hi everybody! I newly have a problem with opening a jsp or jspx-page in Jdeveloper 10.1.3.3. When I double-click a page the Jdev is hard working but seems to doesn't come to an end. After 20 minutes I don't like to wait anymore and close the Jdev wit

  • How to get Quicktime to play

    I'm new to Dreamweaver. I'm trying to created a simple webpage with a video in the middle of the page. I just want the video to play when you go to that page. Or you can use the > button... doesn't matter. WHat's happening is the page is trying to us

  • Transfering Drawings From FreeHand to pdf- Lines are Blurry

    I am working on a catalog. I've drawn up everything in freehand but when I pull them into my pdf they looked blurry. The drawings look fine in freehand, however. Does anyone know what the problem might be?