Skip to Content
author's profile photo Former Member
Former Member

Restore deleted records in a specific table


We are running db2 udb 9.5 wiht fixpack 2a and SP_BASIS 700 level 0020.

All records created before a certain date were deleted by mistake. We can get those records back from backups but how do we append those records?

Are there any tool i SAP for this, in in that case what format should the file with the records have?


Can we just append the records using db2 command line?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 28, 2010 at 08:47 AM

    Hi Tomas,

    did you delete records from one table only? If this is the case it should be possible to use DB2 EXPORT/IMPORT to restore the data from a restored backup to your productive database.

    Before running the DB2 EXPORT and IMPORT utilities, you need to make sure that the correct codepage is set in your environment. Otherwise DB2 may perform unwanted codepage conversions. You can prevent codepage conversions by setting DB2CODEPAGE in your environment.

    setenv DB2CODEPAGE 1208 on a unicode system

    setenv DB2CODEPAGE 819 on a non-unicode system

    The export command on your restored database looks like:

    db2 "export to TAB.IXF of IXF select * from schema.table where timestamp < xxx "

    The import command on your productive database looks like:

    db2 "import from TAB.IXF of IXF insert into schema.table "

    If the table contains LONG or LOB columns, the commands may become more complicated. You should use IXF format since the table may contain binary data.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.