Delete takes ages! Help!!!!!!!!

I am running a stored procedure from shell script as a sceduled task in crontab. This SP is run every Monday at 3 in the morning.
The scenario is;
I am working on GSM Prepaid Service for a telecom company. I have a log table which maintains the history when subscribers recharge their account through prepaid voucher cards to keep track of the used voucher pins. The log is maitained for 7 days only.
I have approx. 1 million records every week, which I delete through stored procedure in a batch of 20000 rows each. This takes around 75 minutes and puts lot of load on the server, as there are also many other scheduled tasks running in parallel.
Can anyone help me troubleshoot this problem.

Hi,
The most important in partitioned table is the choice of partition clause. What is the desc of your table, index, PK and you need to know the main query about this table.
Assuming that delete previous week records is the main job, you can create partition on week number, for example, you can have 2 partitions (0 and 1) with mod2 on week number :
SQL> select mod(to_char(sysdate,'IW'),2) from dual; --this week
MOD(TO_CHAR(SYSDATE,'IW'),2)
                           0
SQL> select mod(to_char(sysdate+5,'IW'),2) from dual;--next week
MOD(TO_CHAR(SYSDATE+5,'IW'),2)
                             1
SQL> Replace sysdate by your date column.
Only one problem with this one, it's when a year has 53 weeks, the 53th week of the current year and the 1st week of the next year goes in the same partition... this is not the case in 2005/2006.
You can too precreate a partition for each week number from 1 to 53. There are too many possibilities.
I advise you to read doc : http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_73a.htm#2101280
and
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_32a.htm#2100180
You can export your table, drop table, create your partitioned table and import.
Nicolas.

Similar Messages

  • My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Help!

    My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Please help !!!!

    Thank you very much for your reply gdgmacguy :) I did all you suggested apart from restore as new device . Didn't know I could do that . After restore I did restore from back up only,  as I didn't want to end up without contacts details on my phone. If I restore as new device how do I get my all contacts? Still will have to use back up? Sorry if it sounds like I don't know what i am doing, i just have no one to ask who would know. Thank you

  • TS1368 I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.

    I want to delete a lot of things childrens stories, albums which are not used which that are on my ipad. However when I go through Itunes it wont show me most of the stuff in my library. it takes ages to delete one at a time.
    Can you help please?

    Thanks King_Penguin for taking time to read and reply. 
    I just purchased this movie on Thursday, May 15, so just a few days ago.  I have never had any trouble whatsoever since I have been in Vietnam.  I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase. 
    Sorry, I don't quite understand what you mean by studios and different versions.  Could you please explain? 
    I checked my purchased list in my purchase history under my account and there are no hidden items. 

  • Macbook 2.2ghz Leopard wont auto update (says it cant connect to internet??) also safari and chrome take ages to open and frequently crash. Help!

    Here goes...
    1) I have a Macbook 2.2ghz (early 2008) running Leopard 10.5.8 which wont auto update (says it cant connect to internet even though it is - error says A networking error has occurred: timed out (-1001). Make sure you can connect to the Internet, then try again.) Network diagnostcs says that im connected to the intermet.
    2) Also safari and chrome take ages to load pages when every time I open them (around 45 seconds) and then when they are running safari will randomly close and chrome will come up with the aw snap message for random pages (doesnt matter if its trying to loas flash or not).
    Iv got Sophos anti virus which is saying theres no malware or viruses, also tried restartiing, re downloading chrome, deleteing my profile from chrome, exporting, deleting and then importing bookmarks and hardwiring the latop to the router. None of these fixed the issues.
    Never had these issues and they are really getting on my nerves! Any help would be appreciated.

    Thanks but just tried and does nothing, i read somewhere it could be to do with proxy settings? even though though i havnt changed them?? couldnt work out how to do it on a mac, could this be the problem?

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • My imac 21" takes ages to load videos and websites. HELP

    i have a imac 21" that i got like 4 months ago and it was running safari and google chrome very fast but now its is very slow it takes ages for it to load a video from youtube or any other place and it takes longer time for it to load a page then it did befor...
    when i first got it i could open 1080 HD videos from youtube easly and the hole thing would load very fast but now i takes like 10 mins to load a very short video thats like 360p... Befor it could open a page in like 1 second and now its takes like 1 minute for it to load a very simple page...
    I have alot of memory left and i have ATT u-vers internet, and other apps that need internet run normal like itunes, twitter...
    plz help its getting really annoying. sometimes when i play Starcraft 2 it kinda slow too.

    anyone!?

  • How can I bulk delete contacts from my iPhone 4S? I've imported contacts from gmail and hotmail, many of which I don't need. Deleting them individually will take ages, there must be a quicker way. Also, are my contacts taking up space on my iPhone or

    How can I bulk delete contacts from my iPhone 4S? I've imported them from gmail and hotmail and there are many more than I need. Deleting them one by one will take ages, there must be a quicker way! Also, do contacts take up space on the phone or are they stored remotely?
    Thanks.. J

    You should be syncing your contacts with an app on your computer or cloud service (iCloud, Gmail, Yahoo, etc), and not relying on a backup.  If you haven't been doing this, start now and then restore your old backup.  You will then be able to sync the new contacts back into the phone.  However, you will lose all messages, etc newer thant the backup.

  • My ipod touch 2g a1288 wont restore. The download takes ages then ipod puts itself back in2 DISABLED mode, HELP!!

    Ok so my ipod is making me really angry. If I don't figure this thing out today after trying for so long I think I'm going to take my car and repeatedly run the thing over until its in a million pieces.
    Right now heres the long story which ill try keep kinda short but I do need to explain whats happened thus far
    Ipod touch (2G), Mondel: A1288 which has gone into disabled mode and is basically useless at the moment.
    Now I've done the thing where you hold the two buttons while plugged into laptop until itunes detects ipod in recovery mode. Then I try to hit restore, this starts up the download/ update thing which will not download because here in the dark ages of New Zealand our internet is slow. So because its so slow the ipod touch takes itself back into disabled mode! ahhhhhhhhhhhhh so FRUSTRATING
    Now I'm aware that I can pre-download the firmware (which will still probably take ages but may save the ipod from timing out and going back into disabled screen) and then just hit control and select it when ipod is detected in recovery mode by itunes. The only thing wrong with doing this however, is when I go to the site to get the firmware from http://http://www.felixbruns.de/iPod/firmware/ and look in the drop down menu of 2G ipod touches, I don't see my model listed there so I'm wondering what firmware I can download for the A1288? Is it compatible with a different version? because it wasn't even listed in the drop-down menu of ipod touches.
    I just wan't the thing going again! they put these things into technology that make it useless because they know the average joe like me will just give up trying to fix it and buy a new one. Well not this time, if I cant fix this, I'm going to run the thing over and that will be that!
    Many thanks for reading my speal, I hope somebody can help

    lol yea when i inserted the link i just copied and pasted thats why that happend... Lets try again... http://www.felixbruns.de/iPod/firmware/
    Anyways when I go to it theres a drop-down list and you select the one you want and I know the number next to it identifies the model but the thing is they don't have my model listed so my main question is, what version eg. 2.1.1. or 2.2.1 etc. etc. etc. etc. will work with my model of ipod touch which is the 2g Model A1288?
    Does anybody know? Does it work with any firmware thats for 2G ipod touches or do i have to get firmware thats model specific?

  • Google, Facebook etc take ages to load on Safari (and Firefox)

    There have been a few threads on this issue...but none seem to have a solution that works for us.
    We have two laptops (MacBook (MB) and MacBook Pro (MBP)) using an airport wireless.   The MP has all of a sudden decided that google and facebook will not load up straight away like they have always done in the past...they take ages to load up (we are talking "go get a coffee..and read the newspaper" times).  Other websites just fire up as fast as ever.   All sites fire up super fast on the MBP.
    What we have tried:
    1. Rebooted the modem, wireless router and computers
    2. Reset Safari, deleted and reinstalled Firefox 4.0.1.  Wiped out all caches , cookies etc
    3. Restored entire computer from time tunnel from a month ago...when life was good!
    4.. Changed/added DNS numbers to airport (via airport utilities) and change the airport settings (using openDNS numbers).
    5. Flushed the DNS resolver caches...
    Still no good....
    What are we missing?   What can the MB have to cause the issue that the MPB does not?
    MB is on OSX 10.5.8
    MBP is on OSX 10.6.7
    Please help...my wife uses the MB and is angry that her beloved Facebook and Google are just not working

    Ok.. from the Safari menu bar click Safari / Preferences then select the Extensions tab. If you have any installed, turn that off, quit then relaunch Safari, try Facebook.
    If it's not Extensions...  try troubleshooting Safari third party add ons.
    Safari: Unsupported third-party add-ons may cause Safari to unexpectedly quit or have performance issues

  • Mounting nas folder takes ages (only on mac)

    Hi
    I have a synology DS212J. I mount my folder on my nas using finder which worked fine. but for the last few month it dosen't work properly anymore. I connect to my nas (no problem) then choose a folder (no problem) but then when I open it for example picture it takes ages to show the contends and even after a long time being open it never shows all the contends. it's not possible to work like that. I have an early 2011 macbook running m.l. i have more and more probem with m.l
    I have to old laptop 5 and 7 years running win7 on them and no problem to mount the nas in seconds. I also installed win7 on my mac, and from there no problem to mount withhin seconds.
    starting to think using win 7 again as my mac (moutain lion) starting to cause more and more problem.hope the next os is better...
    hope anyone can help me with this issue....
    K S

    QNAP firmware 3.6.0 works under Lion, but for AFP to work, you may need to delete some of the old hidden files nested within top level folders on the NAS.
    See my post in this thread.
    https://discussions.apple.com/message/15799623#15799623

  • Time Machine back up takes ages.

    Hi. I still got the problem that my time machine backup take ages to complete.
    I installed a widged called time machine buddy, someone told me to do and now that's what it shows me.
    Any idea why it looks like it does the backup twice in a row and for what reason it takes about half an hour to copy less then 1GB.
    I allready deleted the HD I use for the backup and got it all new but it did not solve the problem.
    Cheers.

    Very good question, as I've had the same issue for over 2 months since installing a new hard drive. Pondini very kindly, patiently and astutely helped me get a hanging 2 hour back up down to a respectable 15 minutes, but that is still too long (when nothing has changed between back ups, in particular). You articulate the question and pose the dilemma far better than I ever expressed. The seeming "dual backup" seems to be the culprit. Maybe Pondidni can give us some guidance based on your post.
    For point of reference, the related past links were:
    https://discussions.apple.com/thread/3626762?start=30&tstart=0
    https://discussions.apple.com/message/17830473#17830473
    https://discussions.apple.com/message/17541942#17541942

  • When i log on to thunderbird, the in box has the message, 'building summary file', this then takes ages to do . how do I stop it doing this every time I log on?

    Hello,
    This problem has only started happening in the last few days. Every time i log on the get emails, the inbox has a message saying 'building summary file'. it then takes ages to do this. i have tried deleting most of the in box and compacting the file but it still continues.

    Try restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • It take ages to download and install flash player

    i realize that from some time it take ages to download and install adobe flash player!! is there a problem with the server i just cant install it i use windows 7 and windows 8 in both i download but wen try to install it starts to install and it says it takes to long to download and stops instalation   what can i do to install flash player? thank you very much

    Try the offline installer from http://helpx.adobe.com/content/help/en/flash-player/kb/installation-problems-flash-player- windows.html#main-pars_header

  • Nokia N95 8GB takes ages refreshing even for one t...

    Hi All.
    I have had this REALLY frustrating problem...
    Every time i add a track to my phone, then i refresh it takes AGES to update the library.
    Does anyone know how to fix this?
    Nokia N97 Mini
    V: 10.0.020 : 14/10/09
    RM-555
    Old: N95 8GB : V 20.0.016 : 28/09/08 : RM-320

    The reason it takes a while is that the phone has to scan all memory every time you refresh, doesn't matter whether you're adding/removing 1 track or 1,000 as the phone doesn't know what needs to be added without checking.
    One of the downsides of having more space.
    If you're deleting tracks from the library, you can still listen to other tracks while this is happening: I listen to a lot of podcasts and always delete the ones I've aleady listened to as I'm listening to a new one. Again, deleting 10 tracks together takes the same time as deleting one.
    If you want to listen to a track you've just added, you can do this while the music player library refreshes, just start playing it using file manager then switch to the library to do the refresh.

  • Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy!

    Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy! It syncs 100+ songs, when I only want to sync 1! I'm running Itunes 11.3.1.2

    After having experienced similar problems and having it back to work, I have a few suggestions:
    - Try to find out if the syncing stops at a particular track or song. That might - out of the blue - have gotten corrupted in one way or another. Since that song will not be on the iPod, iTunes will try over and over to put it on and crash in one way or another;
    - reformat the iPod as described in the iTunes 9 crash-thread. It takes time (at first it seems to do nothing, but that is because the green bar is moving with very small steps);
    HTH

Maybe you are looking for

  • FireWire Automatic IP Problem

    A few months ago, my Mac Mini stopped getting an automatic IP address on its FireWire port. I could still get to it with a static IP, so it wasn't too big of a deal. Now I am starting to experience difficulty accessing it with the static IP configura

  • Photoshop and Premiere elements 8 not working after installation

    I installed the Premiere Elements 8 and Photoshop Elements 8 on a Sony Vaio with a ATI Mobility Radeon HD 4650 graphics card.  I can't get a new project to start in the Premiere Elements 8 program to make a DVD.  Can anyone help with this?

  • Cannot compile lib32-wxgtk

    Of course I have a x86_64; the package as-is fails with this message: checking for C compiler default output file name... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile,

  • QT update had 2 types of failures

    I have a Windows-based system, with XP Pro as OS, and FF as browser. I've been getting blue screens, at boot, having to do with a driver. Today, I am attempting to update all software, including QuickTime (I'm attempting to update from 7.70.80.34 to

  • MUVO TX DE

    I have this player Muvo tx and now it doesn't work when I press play button. I downloaded something named CT-RT_PCAPP_INT__0_8_2, ran it and it asked serial number (well, the sticker gone a long time ago). And now the player isn't even detected in WI