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 > RESTORE scripts

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-16-04, 15:10
ckintner ckintner is offline
Registered User
 
Join Date: May 2004
Location: Bordentown, NJ
Posts: 27
RESTORE scripts

Does anyone have a sample script that restores a full-image copy from one DB to a different DB?
Reply With Quote
  #2 (permalink)  
Old 07-16-04, 18:06
tmullins tmullins is offline
Registered User
 
Join Date: Aug 2003
Posts: 68
Quote:
Originally Posted by ckintner
Does anyone have a sample script that restores a full-image copy from one DB to a different DB?

I don't have a script - but I just copy the backup image, and the archive logs to the new dbserver - and run the following cmds:

db2 restore database <dbname> from <path to bkup image>

db2 rollforward database <dbname> to end of logs
Reply With Quote
  #3 (permalink)  
Old 07-17-04, 02:26
nitingm nitingm is offline
Registered User
 
Join Date: Jul 2003
Location: Austin, TX, USA
Posts: 278
Script

Hi,

Please find attached a script that helps to do a redirected restore.

The sequence is as follows: - RENAME THE RESTORE.TXT TO RESTORE.BAT AND EXECUTE. (PLEASE MODIFY AS PER YOUR ENVIRONMENT)

Once this execution is over then you need to copy the log files to the SQLOGDIR

db2 rollforward database <dbname> to end of logs and complete
(This generally gives an error asking for next logfile and stops processing)

db2 rollforward stop. (This completes the processing)

In case you don't need to have the new database in log archiving mode then you will have to update the db cfg parameters logretain off and userexit off.
Attached Files
File Type: txt RESTORE.txt (2.1 KB, 101 views)
__________________
HTH

Nitin

Ask the experienced rather than the learned
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