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 > DB2 migration from windows to AIX, schema re-naming problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-19-07, 13:17
durera durera is offline
Registered User
 
Join Date: Mar 2007
Posts: 3
DB2 migration from windows to AIX, schema re-naming problem

Hi folks,

I am following the process outlined here: http://www.tek-tips.com/faqs.cfm?fid=2767 (which I found from the FAW here, many thanks for that!) but I have come across the following problem which I am at a loss as to how to solve.

The source database has a schema named "user1" and I want those tables shifted over to the destination, but "user1" does not exist there, instead the schema should be "user2". I hoped to be able to simply rename the schema after completing the copy. However, the "user1" schema appears as "NULLID" in the list of schemas and none of the tables under that schema appear to have been transferrred (they don't show up in control center).

So my question to you is "how on Earth do I move my database (from Windows to AIX) and cope with a change of schema name in the process?" Any help appreciated, I've been searching the 'net for answers all afternoon and I've given up for the day now, it's time to go home.

Regards,

Dave
Reply With Quote
  #2 (permalink)  
Old 03-19-07, 14:12
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
If you have followed the procedure in the FAQ, then you must Find Replace 'user1' with user2 in your db2look output before creating tables on the target db.

You should do the same in the db2move.lst file.

I have not tested this one now ... but i guess it should work

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 03-19-07, 14:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Use the following two SQL statements to generate two separate SQL script files, one for export and one for load:

select 'export to d:\temp\'||tabname||'.ixf of ixf select * from user1.'||tabname||';' from syscat.tables where tabscheme = 'USER1' order by tabname

select 'load from '||tabname||'.ixf of ixf into user2.||tabname||';' from syscat.tables where tabschema = 'USER1' order by tabname


Run both SQLs on the source server. Use the output from the first on to make your export script. Use the second SQL output to make your load script. Run the export script on the source. Copy the ixf files and the load script to the target. Run the load script on the target.

HTH

Andy
Reply With Quote
  #4 (permalink)  
Old 03-20-07, 05:08
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
if u are at db2 9 LUW
then u can use db2move with copy option
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #5 (permalink)  
Old 03-20-07, 08:29
durera durera is offline
Registered User
 
Join Date: Mar 2007
Posts: 3
Thanks all, changing schema name in the ddl and those scripts from ARWinner did the trick nicely.
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