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 > recovery of rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-09, 06:57
vijay0708 vijay0708 is offline
Registered User
 
Join Date: Dec 2008
Posts: 5
recovery of rows

hi,

I have one issue that, i deleted 15rows from the table test. After 10min of deletion, i need those 15rows back. So how can we get those. Explain in brief please.



thanks & regards
vijay
Reply With Quote
  #2 (permalink)  
Old 04-06-09, 08:52
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Restore and roll forward
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 04-06-09, 11:38
nick.ncs nick.ncs is offline
Registered User
 
Join Date: May 2007
Location: somewhere in dbforums
Posts: 221
Chances of getting that increases provided you have archival mode of logging and not circular.....
__________________
IBM Certified Database Associate, DB2 9 for LUW
Reply With Quote
  #4 (permalink)  
Old 04-07-09, 03:11
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
or if you have recovery expert : this can recover deletes from the log
__________________
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
  #5 (permalink)  
Old 04-07-09, 06:49
vijay0708 vijay0708 is offline
Registered User
 
Join Date: Dec 2008
Posts: 5
restore of rows

Quote:
Originally Posted by rahul_s80
Restore and roll forward
no its not possible. i need those rows only. How
for eg: i didnt take backup of that db. So how can we get those rows?
Reply With Quote
  #6 (permalink)  
Old 04-07-09, 06:51
vijay0708 vijay0708 is offline
Registered User
 
Join Date: Dec 2008
Posts: 5
restore of rows

Quote:
Originally Posted by nick.ncs
Chances of getting that increases provided you have archival mode of logging and not circular.....

we can restore tablespace or database by using restore command. But here the point is, i need rows only. So how it will possible? HOw can we get those deleted rows.
Reply With Quote
  #7 (permalink)  
Old 04-07-09, 07:01
VolkerK VolkerK is offline
Registered User
 
Join Date: Dec 2003
Location: Duesseldorf - Germany - Europe - Earth - Galaxy
Posts: 18
If you say "delete from table" and commit this there is no "legal" chance to restore the rows deleted with SQL. There is no "trash"-area in relational databases except you create one yourself and handle it yourself. But as a dba you can *try* to restore them.

At least you need a backup copy of the database containing the rows.

Which DB2 do you use?
DB2 zOS V8++:
Use the UNLOAD Utility to unload all the rows of the table from that copy (needs the FROMCOPY-clause) Delete all rows not needed from the unloadfile and load the ones you want into the original table.

DB2 UDB:
Restore the database backup into another database usindg RESTORE REDIRECT. Use the EXPORT comand to export the rows you need and the IMPORT command to load them into the original database.

I coult post samples for both platforms.

Regards,
Volker.
Reply With Quote
  #8 (permalink)  
Old 04-07-09, 08:07
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Quote:
Originally Posted by vijay0708
we can restore tablespace or database by using restore command. But here the point is, i need rows only. So how it will possible? HOw can we get those deleted rows.
Maybe I'm missing your point, but what's the problem? You take the backup, restore it in another system/DB2 instance that you set up, extract the rows you want and export them, then load them again in the desired target system.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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