Link to home
Start Free TrialLog in
Avatar of aicc
aicc

asked on

DB2 online backup/restore

I'm configuring online backup for my DB2 using Tivoli Storage Manager. Following DB2 and TSM document, I think I got it right.
In my testing the backup(online) and restore, this is what I did.
1. created a test table named TESTB and inserted some data.
2. performed a online backup successfully.
3. cleared table TESTB.
4. performed the resotre. The process finished succefully.
5. query table TESTB. The data should come back. right?
my result is not. The table is still cleared.

Is my procedure proper?

BTW, I enabled the USEREXIT and LOGRETAIN parameter, built the user exit executable for TSM, did whatever need on TSM side.

Thanks.

Bill
Avatar of waynezhu
waynezhu

I do not have TSM and I use script to do online
backup and recovery at either database or tablespace
level.

Based on what you've describe, I think you need to make
sure if the backup image contains the data or not. For example, instead of using TSM, you can perrform a manual recovery to confirm if the data are within the backup
image or not. In this way, you can isolate the problem
to see if it happens in the backup stage or recovery
stage.
Avatar of aicc

ASKER

wayne,
Thank you for your response.
I can see something in TSM. But I can't read the content from TSM. By reading the size of the object in TSM, I guess it contains the image. I can use "db2adutl" to query the it.
Sure, I can use tape drive or a file to subtitute TSM.

How you do a manual recovery?

What I did is
db2 restore db devdb use tsm taken at xxxxxxxxx(the timestamp)
and then
db2 rollforward db devdb to end of logs and stop

I think I need to understand how online backup/restore works.
To my understood, when the USEREXIT parameter is turned on, if a tape drive is used, the database is brought into rollforward mode and the full logfiles, which no longer contain active transactions, will automatically be moved off the system to the tape drive. the logfiles in the tape media will be fept updated as the transactions are commited.
the tape media contains both backup media and the archived logs. when recovery is performed, the db2 will first restore the image (when the restore command is issured) and then apply the archived logs against the database to a point in time or end of logs (when the rollforward command is issured).
In my case, when I do the table clear, this action is actually recorded to the logs in TSM. When I restored the database, the image with data I inserted to table testb was copied back to db2. I can't query it even it is there(I think) since the db2 is in rollforward pending mode. So I have to do a rollforward and to apply the logs. The logs contain my clear action and table testb is cleared again when I do the rollforward.

Is my understanding correct? what is the right way to verify a online backup/recovery?

Thanks.

Bill
ASKER CERTIFIED SOLUTION
Avatar of waynezhu
waynezhu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aicc

ASKER

Wayne,

Perfect!

I wish I had known I could do
db2 "rollforward db sample to 2002-08-03-16.41.43.000000 and stop"

That is a big help.

I have tried to understand this since two weeks ago.

Thank you very much!

Bill
Bill,
Thank you.
Wayne