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 > Tablespace restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-11, 07:11
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
Tablespace restore

Environment : DB2 V9.7 FP3 on Linux

DPF environment . 17 logical nodes spanned across 3 physical nodes

I have two databases. Database A and Database B. I have taken an online tablespace backup of one tablespace on database B. Can I restore that tablespace on to existing database A ??

If online is not possible, Can I do with an offline tablespace backup?

Note that there are other tablespaces on Database A and all of them needs to be preserved.

Any help or suggestion for this is greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 11-10-11, 07:49
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
See:
Restoring to an existing database - IBM DB2 9.7 for Linux, UNIX, and Windows

For database-level you can restore into other database. It's not stated for tablespace-level. If it's possible, you need the same seed, same tablespace. Not very likely that it works.
Reply With Quote
  #3 (permalink)  
Old 11-10-11, 07:54
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Not sure if it will work in a partitioned database, but try the TRANSPORT option when restoring.

Transport examples - IBM DB2 9.7 for Linux, UNIX, and Windows
Reply With Quote
  #4 (permalink)  
Old 11-10-11, 08:01
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
Transport option is actually not available in partitioned environment.
Reply With Quote
  #5 (permalink)  
Old 11-12-11, 00:24
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
Can a tablespace level online backup be restored to another new database in DPF environment?
Example: I have a database with tablespaces syscatspace, tempsapce, userspace1, userspace2, userpace3. I only wanted to restore userspace 1 to another new database using a tablespace level backup. Here the new database should only have the restored tablespace. All the other existing data is not required on the new database.
Reply With Quote
  #6 (permalink)  
Old 11-12-11, 07:49
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Look at the restore with rebuild option. You need to restore syscatspace as well. A simple example is here: table space restore

This presentation can be very helpful:
http://www.idugdb2-l.org/conferences...ta/NA08D07.pdf
Reply With Quote
  #7 (permalink)  
Old 12-02-11, 10:11
sanchez786 sanchez786 is offline
Registered User
 
Join Date: Jul 2011
Posts: 24
Thank you all for your suggestions, however, I'm still having issues.

I'm on a partitioned environment (2 nodes).

Node 0: Catalog Node
Node 1 and Node 2 with data etc.

I'm attempting to run a redirect restore for just one tablespace for now. The restore is from an online tablespace backup image on a different instance.

Here is the command I ran followed by the error:

RESTORE DATABASE DB1_DB REBUILD WITH TABLESPACE ( TEMPSPACE2 , MYTABLESPACE, WRAPPER1 , TEMPSPACE16K_2 ) USE TSM OPEN 1 SESSIONS OPTIONS '-fromowner=Instance_1' TAKEN AT 20111128
122156 INTO DB2_DB NEWLOGPATH '/DB2_DBlog_dir/DB2_DB/NODE0002/' REDIRECT WITHOUT ROLLING FORWARD WITHOUT PROMPTING

It doesn't allow be to perform the restore as it states the following error message:

SQL2537N Roll-forward is required following the Restore.

I specifically stated the WITHOUT ROLLING FORWARD option as I will need to ROLLFORWARD to a specific point in time.
Reply With Quote
  #8 (permalink)  
Old 12-02-11, 10:51
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by sanchez786 View Post

I specifically stated the WITHOUT ROLLING FORWARD option as I will need to ROLLFORWARD to a specific point in time.
That's wrong. "WITHOUT ROLLING FORWARD" means that you do _not_ intend to rollforward the database, so it should _not_ be placed into the rollforward pending state.

Lose this option and rerun the restore.
Reply With Quote
  #9 (permalink)  
Old 12-02-11, 11:18
sanchez786 sanchez786 is offline
Registered User
 
Join Date: Jul 2011
Posts: 24
Quote:
Originally Posted by n_i View Post
That's wrong. "WITHOUT ROLLING FORWARD" means that you do _not_ intend to rollforward the database, so it should _not_ be placed into the rollforward pending state.

Lose this option and rerun the restore.
I did that, but now that I want to rollforward the tablespace, I run the following command:

db2 "rollforward db DB2_DB to 2011-11-28.12.30.00.0000 using local time and complete tablespace(MYTABLESPACE) online

It returns the error:

SQL1117N A connection to or activation of database "DB2_DB" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE=57019
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