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
  #16 (permalink)  
Old 08-02-10, 04:20
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear nvk@vhv

With current situation how to see from this tables to user wmbint "detaination".


If I can't see these tables by "db2 list tables" because they have another schema "Source Schema" that's mean still restore not perfect.


Regards,
Nasser

Last edited by nasali; 08-02-10 at 04:24.
Reply With Quote
  #17 (permalink)  
Old 08-02-10, 05:14
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Hi,

i not sure what your issue is about...
You restored the database. The restore was fine? You are able to Connect to the restored database? The User tables are in the restored database, but not in the schema you expected?

The Database is exactly the same as the source-database. You can not change the schema of a table. It's not possible!
Reply With Quote
  #18 (permalink)  
Old 08-02-10, 05:44
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear nvk@vhv/Marcus_A

It's can be done with V9 or later
I made it .

i copy the schema under wmbint succssfully by using SYSPROC.ADMIN_COPY_SCHEMA provedure check the following.


db2 => CALL SYSPROC.ADMIN_COPY_SCHEMA('IWMBUAT', 'WMBINT', 'COPY', NULL, 'USERSPACE1', 'USERSPACE1, SYS_ANY', 'ERRORSCHEMA', 'ERRORNAME')

Value of output parameters
--------------------------
Parameter Name : ERRORTABSCHEMA
Parameter Value : -

Parameter Name : ERRORTABNAME
Parameter Value : -

Return Status = 0

db2 => quit
DB20000I The QUIT command completed successfully.
wmbint:/var/mqsi/wmbint/backup> db2 list tables

Table/View Schema Type Creation time
------------------------------- --------------- ----- ---------------------
BACLENTRIES WMBINT T 2010-08-02-20.09.37.505499
BAGGREGATE WMBINT T 2010-08-02-20.09.37.602389
BCLIENTUSER WMBINT T 2010-08-02-20.09.37.672693
BGROUPNAME WMBINT T 2010-08-02-20.09.37.742123
BMQPSTOPOLOGY WMBINT T 2010-08-02-20.09.37.765363
BMULTICASTTOPICS WMBINT T 2010-08-02-20.09.37.832159
BNBRCONNECTIONS WMBINT T 2010-08-02-20.09.37.897746
BPUBLISHERS WMBINT T 2010-08-02-20.09.37.921042
BRETAINEDPUBS WMBINT T 2010-08-02-20.09.37.992623
BRMINFO WMBINT T 2010-08-02-20.09.38.058672
BRMPHYSICALRES WMBINT T 2010-08-02-20.09.38.081016
BRMRTDDEPINFO WMBINT T 2010-08-02-20.09.38.147520
BRMRTDINFO WMBINT T 2010-08-02-20.09.38.172666
BRMWFDINFO WMBINT T 2010-08-02-20.09.38.237019
BROKERAA WMBINT T 2010-08-02-20.09.38.260171
BROKERAAEG WMBINT T 2010-08-02-20.09.38.293476
BROKERRESOURCES WMBINT T 2010-08-02-20.09.38.358956
BSCADADEST WMBINT T 2010-08-02-20.09.38.430214
BSCADAMSGIN WMBINT T 2010-08-02-20.09.38.452936
BSCADAMSGOUT WMBINT T 2010-08-02-20.09.38.521383
BSUBSCRIPTIONS WMBINT T 2010-08-02-20.09.38.588085
BTOPOLOGY WMBINT T 2010-08-02-20.09.38.654756
BUSERMEMBERSHIP WMBINT T 2010-08-02-20.09.38.677498
BUSERNAME WMBINT T 2010-08-02-20.09.38.700214

24 record(s) selected.


You may find this link useful.
DB2 Database for Linux, UNIX, and Windows

Regards,
Nasser
Reply With Quote
  #19 (permalink)  
Old 08-02-10, 15:45
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 nvk@vhv/Marcus_A

It's can be done with V9 or later
I made it.
Technically, you copied a schema and deleted the old one, not changed a schema. Keep in mind that the admin SP you used does not reset indentity columns or sequences to the values you may want.

If you wanted to changed the schema name, you should have said so in the first place. Changing the schema name has nothing to with restoring a database.
__________________
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
  #20 (permalink)  
Old 08-03-10, 01:45
nasali nasali is offline
Registered User
 
Join Date: Apr 2008
Posts: 30
Dear Marcus_A

Sorry for that,,,,

But I already mentioned " If I can't see these tables by "db2 list tables" because they have another schema "Source Schema" that's mean still restore not perfect. "


Currently After copying schema how can I check "indentity columns or sequences " still same or changed.

what is the best way to change schema in save mode.

Because I am restoring to different destination schema.

Thanks in advance,
Nasser

Last edited by nasali; 08-03-10 at 01:49.
Reply With Quote
  #21 (permalink)  
Old 08-03-10, 14:57
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

Sorry for that,,,,

But I already mentioned " If I can't see these tables by "db2 list tables" because they have another schema "Source Schema" that's mean still restore not perfect. "


Currently After copying schema how can I check "indentity columns or sequences " still same or changed.

what is the best way to change schema in save mode.

Because I am restoring to different destination schema.

Thanks in advance,
Nasser
No, the restore was perfect. It restores the database to the exact state as the backup, including the schema names of existing tables. You seem to have a major lack of understanding of how DB2 works. You do not restore to a schema in DB2, you restore to a database.

Do a db2look to see what the current values are for sequences and indentity columns. You will have to run your own SQL to determine the proper values and to reset them if you used the admin SP to copy the schema.
__________________
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
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