Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Userexit for online backup and restore

Status
Not open for further replies.

mixmouse

Programmer
Mar 22, 2001
26
CA
I have a problem after I turned user exit to "on" and put the user exit program to a correct directory.
OS: AIX 4.3.3
DB2: 7.1 EE
Problem description:
1. Insert data into a database "bktest", commit.
2. Online backup. (backup image and offline archive logs are not under the current database directory)
3. Drop off the database "bktest".
4. Restore the database "bktest" from the last online backup.
5. Command "restore" is OK.
6. Command "rollforward" failed because of log missing.
===========================================================
Does there anybody have the similiar problem? User exit program has moved all fulled online archive logs to off line archive logs. But when I did the online backup, it could not take the last online backup to the off line directory. Of course I alway lost the last archive log after the online backup.
User exit program source code: /usr/lpp/db2_07_01/samples/c/db2uexit2.disk
 
could you give a bit more information on what you are doing.

I don't know how different v7 is to v6 but once you had set up user exit with a directory for you current logs and a directory to archive them, the database knows about all the logs. Eg once the log file had no open transactions in them the logs would be archived.

When you do a
db2 backup db dbname to blah it would give you the timestamp.

If you wanted to the restore that all you would do is:
db2 restore db dbname .......

You don't have to move logs around as the database applies the ones it needs to and will go and fetch the ones that are archived if it requires them but not usually.

I think you are trying to move the logs in different locations so then the db doesn't know where they are.

I don't know if this is the same in v7 but this might help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top