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 > db2 export/import - intergrity constrain

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-11, 18:51
dgunas dgunas is offline
Registered User
 
Join Date: Dec 2008
Location: Chennai
Posts: 110
db2 export/import - intergrity constrain

Hello
db2 9.7 on Win 2008 R2

One of my tables has around 200million rows (45 GB table size).
Around 100 million rows are useless and should be deleted.
So, I am planning to export the wanted data (can be done using date coloumn), then drop and recreate the table and Import the data back.

I was told that that there are intergrity constrains and triggers for this table and I will not be able to do this easly.
However, how can I check that are there intergrity constrains? or triggers?
And how can I do this task smoothly ?

Please help me.
Thanks, valan.
__________________
Reply With Quote
  #2 (permalink)  
Old 11-04-11, 05:36
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
there is a view syscat.tabdep
SYSCAT.TABDEP catalog view
that gives info about dependencies
according to this you will have to take an action : drop trigger/foreign key...before the operation and redo this after the intervention
db2look can give all info about ddl for objects and can also include drop statements..
db2look - DB2 Statistics and DDL extraction tool command
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 11-04-11, 09:45
DebianDog DebianDog is offline
Registered User
 
Join Date: Apr 2011
Posts: 17
Yep with a lot of triggers and other constraints you may just want to run batch deletes over the weekend or something.

100 million rows is really not "that" much depending on the size and speed of your server.
Reply With Quote
  #4 (permalink)  
Old 11-04-11, 15:00
dgunas dgunas is offline
Registered User
 
Join Date: Dec 2008
Location: Chennai
Posts: 110
Thanks

Thanks for the quick advise. I will try this on Monday and let you know the status.
Regards, Valan.
__________________
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