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 db backup to different machine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-10, 07:57
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Restore db backup to different machine

Daers

I am performing restor db to different machine with different instance file system path as the following :


Restore db [IEABDB5U]from different machine(iwmbuat) to (wmbint):

source:
Instance_home:/var/mqsi/iwmbuat

Destaination:
Instance_home:/var/mqsi/wmbint

I have to create same path same as source system mentioned in backup image name :
1. >cd /var/mqsi
2. mkdir iwmbuat
3.chmod 750 iwmbuat


Perform actual Restore:
1.db2 RESTORE DATABASE IEABDB5U FROM '/var/mqsi/wmbint/backup' INTO IEABDB5U REDIRECT WITHOUT PROMPTING;

2.db2 RESTORE DATABASE IEABDB5U CONTINUE;


Restorer success but once i check the tables , no thing restore

db2 list tables

0 selcted.

Every thing same fine in db2diag but i don't know why it's not restoring perfectly.

Regards,
Nasser
Reply With Quote
  #2 (permalink)  
Old 07-28-10, 08:26
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
If you keep the original fileystem structure you don't need the redirect option.
It's only need when you want to restore the database into another filesystem-structure. Have a look at the generated scripts from the redirect option. You have to define tablespace containers and storage pathes.

If you have the same pathes try:
db2 RESTORE DATABASE IEABDB5U FROM '/var/mqsi/wmbint/backup' WITHOUT PROMPTING
Reply With Quote
  #3 (permalink)  
Old 07-28-10, 09:05
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
thanks nvk@vhv for your reply.

I am restoring to another filesystem-structure

And in destaination i create the source filesystem-structure.

Regarding table space it's atutomatic storage for all table spaces so i am unable to redirect.

restoreing db successed but tables for user table space empty space empty.
Reply With Quote
  #4 (permalink)  
Old 07-28-10, 09:14
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
gnerated script :

"iwmbuat_script" 86 lines, 4901 characters
-- ************************************************** ***************************
-- ** automatically created redirect restore script
-- ************************************************** ***************************
UPDATE COMMAND OPTIONS USING S ON Z ON IEABDB5U_NODE0000.out V ON;
SET CLIENT ATTACH_DBPARTITIONNUM 0;
SET CLIENT CONNECT_DBPARTITIONNUM 0;
-- ************************************************** ***************************
-- ** automatically created redirect restore script
-- ************************************************** ***************************
RESTORE DATABASE IEABDB5U
-- USER <username>
-- USING '<password>'
FROM '/var/mqsi/wmbint/backup'
TAKEN AT 20100714130833
-- ON '/var/mqsi/iwmbuat'
-- DBPATH ON '<target-directory>'
INTO IEABDB5U
-- NEWLOGPATH '/var/mqsi/iwmbuat/iwmbuat/NODE0000/SQL00001/SQLOGDIR/'
-- WITH <num-buff> BUFFERS
-- BUFFER <buffer-size>
-- REPLACE HISTORY FILE
-- REPLACE EXISTING
REDIRECT
-- PARALLELISM <n>
WITHOUT ROLLING FORWARD
-- WITHOUT PROMPTING
;
-- ************************************************** ***************************
-- ** table space definition
-- ************************************************** ***************************
-- ************************************************** ***************************
-- ** Tablespace name = SYSCATSPACE
-- ** Tablespace ID = 0
-- ** Tablespace Type = Database managed space
-- ** Tablespace Content Type = All permanent data. Regular table space.
-- ** Tablespace Page size (bytes) = 4096
-- ** Tablespace Extent size (pages) = 4
-- ** Using automatic storage = Yes
-- ** Auto-resize enabled = Yes
-- ** Total number of pages = 16384
-- ** Number of usable pages = 16380
-- ** High water mark (pages) = 9544
-- ************************************************** ***************************
-- ************************************************** ***************************
-- ** Tablespace name = TEMPSPACE1
-- ** Tablespace ID = 1
-- ** Tablespace Type = System managed space
-- ** Tablespace Content Type = System Temporary data
-- ** Tablespace Page size (bytes) = 4096
-- ** Tablespace Extent size (pages) = 32
-- ** Using automatic storage = Yes
-- ** Total number of pages = 1
-- ************************************************** ***************************
-- ************************************************** ***************************
-- ** Tablespace name = USERSPACE1
-- ** Tablespace ID = 2
-- ** Tablespace Type = Database managed space
-- ** Tablespace Content Type = All permanent data. Large table space.
-- ** Tablespace Page size (bytes) = 4096
-- ** Tablespace Extent size (pages) = 32
-- ** Using automatic storage = Yes
-- ** Auto-resize enabled = Yes
-- ** Total number of pages = 8192
-- ** Number of usable pages = 8160
-- ** High water mark (pages) = 4576
-- ************************************************** ***************************
-- ************************************************** ***************************
-- ** Tablespace name = SYSTOOLSPACE
Reply With Quote
  #5 (permalink)  
Old 07-28-10, 09:20
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
-- ON '/var/mqsi/iwmbuat'
-- DBPATH ON '<target-directory>'

is your friend for Automated Storage
Reply With Quote
  #6 (permalink)  
Old 07-28-10, 09:27
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear nvk@vhv


Sorry I don't get it ,What do you mean?


Regards,
Nasser
Reply With Quote
  #7 (permalink)  
Old 07-28-10, 09:40
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Since you are using automated storage, you have to specify a new storage path in the restore command. The specific option is
-- ON '/var/mqsi/iwmbuat'
uncomment this line and specify a valid path

Cheers
nvk
Reply With Quote
  #8 (permalink)  
Old 08-01-10, 07:35
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear nvk@vhv

After I mofify thw script still i can't restore tables.


Here is detalied commands :

wmbint:/var/mqsi/wmbint/backup> db2 RESTORE DATABASE IEABDB5U FROM '/var/mqsi/wmbint/backup' ON '/var/mqsi/wmbint' INTO IEABDB5U REDIRECT WITHOUT PROMPTING
SQL1277W A redirected restore operation is being performed. Table space
configuration can now be viewed and table spaces that do not use automatic
storage can have their containers reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
wmbint:/var/mqsi/wmbint/backup> db2 restore db IEABDB5U continue
DB20000I The RESTORE DATABASE command completed successfully.
wmbint:/var/mqsi/wmbint/backup> db2 connect to IEABDB5U

Database Connection Information

Database server = DB2/AIX64 9.1.3
SQL authorization ID = WMBINT
Local database alias = IEABDB5U

wmbint:/var/mqsi/wmbint/backup> db2 list tables

Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------

0 record(s) selected.



Thanks in advance.
Reply With Quote
  #9 (permalink)  
Old 08-01-10, 12:04
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
With automatic storage, you don't use redirect option in the restore. You just have to specify the automatic storage path (which it appears you have already done).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #10 (permalink)  
Old 08-01-10, 13:21
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Unhappy

Dear Marcus_A

Thanks for your help.


I already tried to restore with redirect/without but still same problem i am not getting tables restored in user table space.


Regards,
Nasser
Reply With Quote
  #11 (permalink)  
Old 08-01-10, 18:15
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Quote:
Originally Posted by nasali View Post
Dear Marcus_A

Thanks for your help.


I already tried to restore with redirect/without but still same problem i am not getting tables restored in user table space.


Regards,
Nasser
Try:
db2 list tables for all
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #12 (permalink)  
Old 08-02-10, 01:58
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
I try it it return all tables of system tables + my 24 tables needed but under source schema which is IWMBUAT for user table space.

Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
BACLENTRIES IWMBUAT T 2010-06-30-15.26.37.002364
BAGGREGATE IWMBUAT T 2010-06-30-15.26.36.461493
BCLIENTUSER IWMBUAT T 2010-06-30-15.26.37.138401
BGROUPNAME IWMBUAT T 2010-06-30-15.26.37.753074
BMQPSTOPOLOGY IWMBUAT T 2010-06-30-15.26.37.409800
BMULTICASTTOPICS IWMBUAT T 2010-06-30-15.26.37.520082
BNBRCONNECTIONS IWMBUAT T 2010-06-30-15.26.36.685292
BPUBLISHERS IWMBUAT T 2010-06-30-15.26.36.874559
BRETAINEDPUBS IWMBUAT T 2010-06-30-15.26.37.269999
BRMINFO IWMBUAT T 2010-06-30-15.26.38.006515
BRMPHYSICALRES IWMBUAT T 2010-06-30-15.26.38.261566
BRMRTDDEPINFO IWMBUAT T 2010-06-30-15.26.38.090297
BRMRTDINFO IWMBUAT T 2010-06-30-15.26.37.852380
BRMWFDINFO IWMBUAT T 2010-06-30-15.26.38.178951
BROKERAA IWMBUAT T 2010-06-30-15.26.36.125248
BROKERAAEG IWMBUAT T 2010-06-30-15.26.35.721026
BROKERRESOURCES IWMBUAT T 2010-06-30-15.26.36.161594
BSCADADEST IWMBUAT T 2010-06-30-15.26.38.721014
BSCADAMSGIN IWMBUAT T 2010-06-30-15.26.38.407538
BSCADAMSGOUT IWMBUAT T 2010-06-30-15.26.38.575213
BSUBSCRIPTIONS IWMBUAT T 2010-06-30-15.26.36.756811
BTOPOLOGY IWMBUAT T 2010-06-30-15.26.36.607330
BUSERMEMBERSHIP IWMBUAT T 2010-06-30-15.26.37.804440
BUSERNAME IWMBUAT T 2010-06-30-15.26.37.691005



Also With >db2 list tables
0 selected



Backup source shema :iwmbuat
Current schema : wmbint
Do you think issue with source schema?


Regards,
Nasser

Last edited by nasali; 08-02-10 at 03:36.
Reply With Quote
  #13 (permalink)  
Old 08-02-10, 02:01
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Quote:
Originally Posted by nasali View Post
Do you think issue with source schema?

Regards,
Nasser
I think you are totally confused.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #14 (permalink)  
Old 08-02-10, 03:35
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear Marcus_A

Can You help me to know what is going on?

"db2 list tables"

return 0 selected

"db2 list tables for all"
return restored user table space under source schema as above which is iwmbuat.

Regards,
Nasser

Last edited by nasali; 08-02-10 at 03:43.
Reply With Quote
  #15 (permalink)  
Old 08-02-10, 04:06
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Within a restore of a database the logical Structure of the database does not change. You can not change the Schema for a table. You have to drop and recreate the tables and view!
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