cancel
Showing results for 
Search instead for 
Did you mean: 

recover UDB database to a transaction

Former Member
0 Kudos

Gurus:

Yesterday, one developer deleted some entries from a table accidentally.

We want to use on-line backup to restore it right before the table entries were deleted.

What is the command to use? Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Ashley - You need to use combination of "restore" and "roll forward" commands.

The syntax of the restore command depends on where (disk or tape ?) the backup image is located. Assuming it is disk, you need to use something like this:

db2 "restore database $dbnamexxxx from $pathxxxxx taken at 20080825xxxxxx"

(You do not specify without rolling forward in the above command).

Next step is to roll forward just before the records were dropped. Lets say the timestamp of the delete activity is

2009-08-25-yy.yy.yy.yyyyyy

In this case: roll forward looks like:

db2 "rollforward database $dbnamexxxx to 2009-08-25-yy.yy.yy.yyyyyy and stop"

Hope it helps. Below is a very old article that can give you more info about the basics of these commands:

http://www.ibm.com/developerworks/data/library/techarticle/pworld/0112mccluney.html

-- Pavan Kristipati.

Former Member
0 Kudos

Thanks!

However the backup is on the tape. Could you help further?

Thanks again!

Former Member
0 Kudos

What is the storage manager ? TSM / Vertias Netbackup ?

Former Member
0 Kudos

It is Veritas. Please help asap. Thanks a lot!

Former Member
0 Kudos

It is Veritas. Please help asap. Thanks a lot!

Former Member
0 Kudos

Sorry for the delay. You need to use bprestore command to get the backup image from the veritas netbackup (tape).

Here is the basic syntax:

/usr/openv/netbackup/bin/bprestore -f restore_list -L restore_log_file

where restore_list has fully qualified path and name of the file you are trying to restore.

If you need to restore a file to disk from tape that was originally archived using bparchive command (not backed up to disk using bpbackup command), you need to use u201C-Au201D in bprestore command. Sample command is shown below:

/usr/openv/netbackup/bin/bprestore u2013A u2013K u2013f restore_list

If you want to just have a list of files that are available on the tape, you have to use u201Cbplistu201D command.

/usr/openv/netbackup/bin/bplist -A -l -R DIRECTORY > output_file

-A | -B Specifies whether to produce the listing from archives (-A)

or backups (-B). The default is -B.

-R [n] Recursively lists subdirectories encountered to a depth of

n. The default for n is 999.

-l Lists in long format, giving mode, owner, group, size in

bytes, and time of last modification for each file.

Hope it helps.

-- Pavan Kristipati.

Former Member
0 Kudos

Sorry for the delay. You need to use bprestore command to get the backup image from the veritas netbackup (tape).

Here is the basic syntax:

/usr/openv/netbackup/bin/bprestore -f restore_list -L restore_log_file

where restore_list has fully qualified path and name of the file you are trying to restore.

If you need to restore a file to disk from tape that was originally archived using bparchive command (not backed up to disk using bpbackup command), you need to use u201C-Au201D in bprestore command. Sample command is shown below:

/usr/openv/netbackup/bin/bprestore u2013A u2013K u2013f restore_list

If you want to just have a list of files that are available on the tape, you have to use u201Cbplistu201D command.

/usr/openv/netbackup/bin/bplist -A -l -R DIRECTORY > output_file

-A | -B Specifies whether to produce the listing from archives (-A)

or backups (-B). The default is -B.

-R [n] Recursively lists subdirectories encountered to a depth of

n. The default for n is 999.

-l Lists in long format, giving mode, owner, group, size in

bytes, and time of last modification for each file.

Hope it helps.

-- Pavan Kristipati.

Answers (1)

Answers (1)

0 Kudos

Hello Ashley,

the following, brand new paper may be of interest for you:

[A Practical Guide to Backup and Recovery of IBM DB2 for Linux, UNIX and Windows in SAP Environments Part 1: Backup and Recovery - Overview|https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/80e61772-e471-2c10-60b1-9529b69b50c5]

Regards, Hans-Juergen