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 database on another machine and other tablespaces

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-12, 12:01
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
restore database on another machine and other tablespaces

Good afternoon,
I've done a backup online in a database and now I have to restore it to another machine with different tablespaces, can someone tell me the steps to take?
I have DB2 8 and AIX 5.3

Greetings and thank you very much.
__________________
DBA DB2 for LUW
Reply With Quote
  #2 (permalink)  
Old 08-07-12, 12:44
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,012
It is called a redirected restore. Look it up in the manual.

Andy
Reply With Quote
  #3 (permalink)  
Old 08-08-12, 02:01
przytula_guy przytula_guy is online now
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,755
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #4 (permalink)  
Old 08-08-12, 10:17
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
Hello Colleagues,
I have a backup online with their logs and want to restore that backup to another machine I have an instance called the same as the backup, but the tablespaces and containers are different. Can anyone tell me the steps I should follow to have my database on another machine?

Thank you very much for your help.
__________________
DBA DB2 for LUW
Reply With Quote
  #5 (permalink)  
Old 08-08-12, 11:11
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,012
Quote:
Originally Posted by georgipa View Post
Hello Colleagues,
I have a backup online with their logs and want to restore that backup to another machine I have an instance called the same as the backup, but the tablespaces and containers are different. Can anyone tell me the steps I should follow to have my database on another machine?

Thank you very much for your help.
This has been answered twice. Look in the manual and it will give you examples.

Andy
Reply With Quote
  #6 (permalink)  
Old 08-09-12, 03:00
przytula_guy przytula_guy is online now
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,755
do you have a problem with scrolling back in the answers ??
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #7 (permalink)  
Old 08-09-12, 10:37
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
to run a restore of the database I have to bring me all the tablespaces of the database where the backup or did some tablespaces?

Thank you very much for your help.
__________________
DBA DB2 for LUW
Reply With Quote
  #8 (permalink)  
Old 08-09-12, 10:41
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,012
Quote:
Originally Posted by georgipa View Post
to run a restore of the database I have to bring me all the tablespaces of the database where the backup or did some tablespaces?

Thank you very much for your help.
I am sorry, I do not understand the question.

Andy
Reply With Quote
  #9 (permalink)  
Old 08-09-12, 12:29
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
on the machine where I did the backup I have these tablespaces:

Tablespaces for Current Database

Tablespace ID = 0
Name = SYSCATSPACE
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 8022
Useable pages = 8022
Used pages = 8022
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2005-10-07-08.33.32.000000

Tablespace ID = 1
Name = TEMPSPACE1
Type = System managed space
Contents = System Temporary data
State = 0x0000
Detailed explanation:
Normal
Total pages = 1
Useable pages = 1
Used pages = 1
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1

Tablespace ID = 2
Name = USERSPACE1
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 225
Useable pages = 225
Used pages = 225
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2011-12-19-10.15.04.000000

Tablespace ID = 3
Name = TSUDATOS
Type = Database managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 3276800
Useable pages = 3276672
Used pages = 2463936
Free pages = 812736
High water mark (pages) = 2621312
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 4
Minimum recovery time = 2012-01-19-11.19.05.000000

Tablespace ID = 4
Name = TSUINDICES
Type = Database managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 1900544
Useable pages = 1900480
Used pages = 1142336
Free pages = 758144
High water mark (pages) = 1546016
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 2
Minimum recovery time = 2005-06-16-09.58.34.000000

Tablespace ID = 5
Name = SYSTOOLSPACE
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 111
Useable pages = 111
Used pages = 111
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2011-02-01-10.02.01.000000

Tablespace ID = 6
Name = SYSTOOLSTMPSPACE
Type = System managed space
Contents = User Temporary data
State = 0x0000
Detailed explanation:
Normal
Total pages = 1
Useable pages = 1
Used pages = 1
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2005-10-24-10.40.10.000000

Tablespace ID = 7
Name = BACKUPTS
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 57
Useable pages = 57
Used pages = 57
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2006-06-22-14.23.10.000000

Tablespace ID = 8
Name = UOWTS
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 119
Useable pages = 119
Used pages = 119
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2006-06-22-14.49.25.000000

Tablespace ID = 9
Name = OTHERTS
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 10835
Useable pages = 10835
Used pages = 10835
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2006-06-22-14.49.25.000000

Tablespace ID = 10
Name = TSSNAP02
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 2
Useable pages = 2
Used pages = 2
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2006-06-22-14.49.24.000000

my question is whether in the restore I have to tell all tablespaces in the backup that I have or I can tell you some. the route of the container where I will run the restore is different.
I've never done a restore redirect why these doubts.

Greetings.
__________________
DBA DB2 for LUW
Reply With Quote
  #10 (permalink)  
Old 08-09-12, 12:50
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,012
For each container in the backup image, if the location is different on the restore, then you have to specify what the new container is. If all of them need to change, then you have to specify all of them in the restore.

Andy
Reply With Quote
  #11 (permalink)  
Old 08-09-12, 12:51
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 2,180
In v8, when restoring into a new db, you have to restore all tablespaces. Just do a redirected restore (restore... redirect, set containers... restore continue). If some tablespaces are using automatic storage, they're redefined using ON parameter. See example here: db2move tuning

If you get stuck, provide the following:

source server:
db2pd -d <db name> -tab

target server:
df -g
Reply With Quote
  #12 (permalink)  
Old 08-09-12, 13:02
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
thank you very much for your quick response.
The database already exists on the machine where I run the restore.
Greetings.
__________________
DBA DB2 for LUW
Reply With Quote
  #13 (permalink)  
Old 08-10-12, 07:35
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
Hi Colleagues,

I am restoring my database with this command:

db2 "restore database ulises from /UlisesBORRAR/BACKUP_ULISESRR TAKEN AT 20120708150002 to /UlisesBORRAR/ulises into ulises2 redirect without prompting"

and show me this message error:

SQL1277N Restore has detected that one or more table space containers are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

Thank you for you help.
__________________
DBA DB2 for LUW
Reply With Quote
  #14 (permalink)  
Old 08-10-12, 09:42
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,012
Quote:
Originally Posted by georgipa View Post
Hi Colleagues,

I am restoring my database with this command:

db2 "restore database ulises from /UlisesBORRAR/BACKUP_ULISESRR TAKEN AT 20120708150002 to /UlisesBORRAR/ulises into ulises2 redirect without prompting"

and show me this message error:

SQL1277N Restore has detected that one or more table space containers are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

Thank you for you help.
Do you get this error on the RESTORE command above or on a subsequent command?

Andy
Reply With Quote
  #15 (permalink)  
Old 08-10-12, 10:25
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 395
this is the first command I run to restore my database.
Greetings.
__________________
DBA DB2 for LUW
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