develooper Front page | perl.beginners | Postings from August 2009

Re: delete 20 000 records in oracle from perl

Thread Previous | Thread Next
luke devon
August 16, 2009 23:26
Re: delete 20 000 records in oracle from perl
Message ID:
Hi Ray 

Thanks for the reply . Yes , when we going to delete those records , CPU is going high.So then its effecting to the performance. as i beginner in perl , how can i implement multi-threaded env ? Can you help me further ?

Thanks & Regards

From: Raymond Wan <>
To: luke devon <>
Cc: Perl <>
Sent: Monday, August 17, 2009 14:12:27
Subject: Re: delete 20 000 records in oracle from perl

Hi Luke,

luke devon wrote:
> I wanted to delete some unwanted data in one of my oracle
> database.20 000 of records are there. This is actually on production .
> manually to delete  a record , it takes 2 mins of time. 
> So now i decided to write a perl script to do this function
> by learning on the web.  Can somebody give me a exact guide to delete
> that amount of data , without giving any impact for performance of the
> database and i would like to ask what is the better way to do such a
> execution ?
> Do we have to implement more threads ?

Perhaps I'm misunderstanding the problem, but if you would like to remove 20,000 records in an Oracle database, I don't believe that Perl will help you with that.  It seems that you're already doing everything in a single SQL statement; having Perl do it won't give you much added benefit   (i.e., no matter how you do it, you still have 20,000 records to delete).  If these records don't overlap, then you could consider a multi-threaded approach...I guess.

Another suggestion if this is a production server is to mark records as stale rather than deleting them (i.e., add a boolean flag as another column).  And then, when the server is least busy, delete the marked records.  Or, rather than a boolean flag, assign some number (say, from 0 to 9) and periodically delete a portion of the rows...sort of like how log files are handled [delete the oldest ones].

I presume your problem is that deleting 20,000 in one go is slowing down the Oracle server?


      New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About