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 > table space restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-09, 21:49
xbrian xbrian is offline
Registered User
 
Join Date: Dec 2009
Posts: 3
table space restore

Can I restore tablespaces from a cold backup?
Reply With Quote
  #2 (permalink)  
Old 12-01-09, 22:12
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
"Cold backup" is not a standard DB2 term, so, assuming that you meant offline backup, the answer should be "yes". However, I think you will still need to roll forward the database, which requires it be in archive logging mode and the logs being available.
Reply With Quote
  #3 (permalink)  
Old 12-01-09, 22:22
xbrian xbrian is offline
Registered User
 
Join Date: Dec 2009
Posts: 3
How can I tell if backup is offline and if archival logging mode is set?
Reply With Quote
  #4 (permalink)  
Old 12-01-09, 22:50
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
That generally depends on what DB2 version you use. You may also want to describe your situation in greater detail to avoid guesswork.
Reply With Quote
  #5 (permalink)  
Old 12-02-09, 19:28
xbrian xbrian is offline
Registered User
 
Join Date: Dec 2009
Posts: 3
I'm told we are running DB2 9.5.2. I need to restore several tablespaces from the image. I don't know if the image is offline and logging mode. How to check?
Reply With Quote
  #6 (permalink)  
Old 12-02-09, 22:37
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You can use the db2ckbkp command to check if your image is offline or online. If you're restoring a set of tablespaces into a different db (different from the one this backup image was created from), then you have to use the rebuild option on the restore command. If you're restoring a set of tablespaces into the same database, then db has be enabled for archival logging (as Nick had mentioned). The restored tablespaces will be in the rollforward pending state and you need to have the logs in order to rollforward them.


I think you're restoring into a different db/env, so you'll need to use the rebuild option. I did a quick test to show how this is done. See if this is something you can use (play with it in some test env first). I'm attaching it here.
Attached Files
File Type: txt restore_with_rebuild_tablespaces.txt (4.9 KB, 55 views)
Reply With Quote
  #7 (permalink)  
Old 12-02-09, 22:56
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
In my example, I used a non-automatic storage tablespace (testts). If I create testts using automatic storage, then the restore command will be different:

bkogan@p6db2serv /home/bkogan/TEST > db2 "restore db test rebuild with tablespace (syscatspace, testts) on /home/bkogan/testts2 into test2"
DB20000I The RESTORE DATABASE command completed successfully.
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