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 > DB2 Backup and Restore to another DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-07, 23:06
mabeljovan mabeljovan is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
DB2 Backup and Restore to another DB2

Hi Guys,

Can anyone help me regarding the DB2 Redirected Restore Scripts the reason is that i want to backup a DB2 and replicate it to another DB2 Server and eventually it is a Windows Server 2003.

Regards,
mabeljovan
Reply With Quote
  #2 (permalink)  
Old 07-18-07, 01:34
sundaram sundaram is offline
Registered User
 
Join Date: Mar 2006
Posts: 104
Hi,

Check Db2 info center on details for 'restore' command.

Basicaly take an offline backup and then restore using the redirect option.

You may have to to do list tablespaces on original db to get the list of required table spaces.

I have given below the script I used in Windows Db2 8.2

db2 restore database mqsicmdb from d:\db2backups taken at 20040429 into mqsicmdt newlogpath R:\db2logs\mqsicmdb\ redirect

db2 set tablespace containers for 0 using (path "s:\axisdatabases\tablespaces\mqsicmdb\syscatspace ")
db2 set tablespace containers for 1 using (path "s:\axisdatabases\tablespaces\mqsicmdb\tempspace1" )
db2 set tablespace containers for 2 using (path "s:\axisdatabases\tablespaces\mqsicmdb\userspace1" )
db2 restore database mqsicmdb continue
db2 rollforward database mqsibkdb complete

Hope it is of help
Reply With Quote
  #3 (permalink)  
Old 07-18-07, 23:33
mabeljovan mabeljovan is offline
Registered User
 
Join Date: Jun 2007
Posts: 27
Thanks Sundaram but the problem is I don't have any offline backup i only have is the online backup.
Reply With Quote
  #4 (permalink)  
Old 07-19-07, 23:35
gou007 gou007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 12
hey mabel, the redirected restore doesnt work for online backup...

u need to have an ofline back up for using redirected restore.

With online backup, if u will try to rollforward to end of logs or a paticular timestamp in redirected option... this doesnt work for you...

one good option is,
as u said u got an online backup...

restore the backup and rollforward to end of logs on the same server...
and now take an ofline backup
u can use this ofline backup to use redirected restore on to other server...

As of now u can follow sundaram's script for redirected restore...
Reply With Quote
  #5 (permalink)  
Old 07-20-07, 10:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by gou007
hey mabel, the redirected restore doesnt work for online backup...
Are you sure about that?
Reply With Quote
  #6 (permalink)  
Old 07-20-07, 11:09
gou007 gou007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 12
hey guys,

ive referred about the redirected restore redirected restore supports both online and offline.

these r the steps

1. take an online/ofline backup for u'r actual database.

2. now transfer the backup image over to target server, FTP the backup image.

3.restore the database on target server using redirect option

4.Define the containers

5.continue the redirect restore.

6. now u can connect to database ( it the backup is offline )

7.if the backup is online u cannot connect, as the db was in rollforward
pending the process continues

8.use query status option in rollforward command to check which logs has to
be rolledforward

9. move the required log files from source database active log directory to the target database active log directory

10 and then rolloforward to end of logs

11. this time u should connect to database on target server.

hope this helps u maybel,
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