If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > milions of delete

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-08-05, 07:18
sandrino sandrino is offline
Registered User
 
Join Date: Mar 2005
Posts: 4
milions of delete

Hi boys
I need your help!!
Ive a tablespaces not partitioned with one table inside in a Db2 for os390 v 7.2.
every year I've to load 10 milions rows group by 10-15 companies

when i've to reload a company i've to delete that company-year and load it.
here is the problem.....i've to do quite 2 milions delete to clear a company!!!!
the mainframe crash !!!!!!!!!!!!
how can i do???

help meeeeeeeeeeeeeeeeeeeeeeeeeeee

sandrino
Reply With Quote
  #2 (permalink)  
Old 03-08-05, 07:44
antonv antonv is offline
Registered User
 
Join Date: May 2003
Location: Amsterdam
Posts: 65
It would be a lot easier if the tablespace was partitioned on year.
But if you are loading all the companies at the same time
you could a load (replace) for the first company. This empties the complete tablespace. Then do a load (resume yes) for the remaining companies.
__________________
Anton Versteeg
IBM Netherlands
Reply With Quote
  #3 (permalink)  
Old 03-08-05, 08:39
sandrino sandrino is offline
Registered User
 
Join Date: Mar 2005
Posts: 4
Quote:
Originally Posted by antonv
It would be a lot easier if the tablespace was partitioned on year.
thanks antonv!!!

con i make the partition with an "alter tablespaces"?
and then what can i do?
Reply With Quote
  #4 (permalink)  
Old 03-08-05, 09:19
antonv antonv is offline
Registered User
 
Join Date: May 2003
Location: Amsterdam
Posts: 65
No you must define a new partitioned tablespace . Ask your DBA.
__________________
Anton Versteeg
IBM Netherlands
Reply With Quote
  #5 (permalink)  
Old 03-08-05, 20:32
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
Another possibilty is to use REORG ... DISCARD.

BTW There is no V7.2 on OS390 - it's just v7.

James Campbell
Reply With Quote
  #6 (permalink)  
Old 03-09-05, 00:33
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
On AIX (db2 udb ese)

we could use : db2 " import from /dev/null of del replace into tablename" to delete millions of records together.

Is there any equivalent of this available for M/F platform too for deletion of millions of rows?

Jayanta Datta
Xansa India
Reply With Quote
  #7 (permalink)  
Old 03-09-05, 02:58
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
On m/f you can do a LOAD REPLACE with an empty input file to do the same thing. However both this and a load from /dev/null will delete all rows in the table. The orginal requirement was for a selective delete.

James Campbell
Reply With Quote
  #8 (permalink)  
Old 03-10-05, 04:36
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
James thanks a lot for the info.

Would it be a good suggestion:
If this delete process is really taking enough time: then--
a> Export the selected rows to some flat file xx.dat
b> do a import from /dev/null to the table
c> Load the xx.dat file into the table.

Thx
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On