DB2 9.7 on Linux
I have to copy the data from the production database to test enviroment (on a a differente server).
Really isn't necessary to copy the whole db but just few user schema.
The schema name on test enviroment have different names.
I cant use backup/restore because after the restore on test enviroment I can't re-name the schema name to be compliant to test nomenclature (correct? there is no ALTER SCHEMA NAME...?!).
I cant use db2move because there are a lot of table with "identity column generated always" and documentation say I can't use DB2MOVE.
So it's seem to me that I can't use a general tool/command to clone the data but I have to "manually" copy every table.
Wich approach migth be easy and simply (less command... less error) to move/clone a lot of table/data on such scenario?!
SystemAdmin 110000D4XK17917 Posts
Re: cloning databases2013-01-10T11:06:22ZThis is the accepted answer. This is the accepted answer.May be you can try data studio copy schema feature described here http://www.ibm.com/developerworks/data/library/techarticle/dm-0902chen/
I believe data studio also allows you to rename the schema (right click -> Refactor -> rename).
Hope it can help you.
Re: cloning databases2013-01-10T14:17:28ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Interesting your hint. It seem that "scripts" can be generated automatically.
I do not know why but the "paste" option is not enabled as show in "Figure 35. Selecting Paste... in the Data Source Explorer
" so I can't try it. On both database (source and target) the connected user is granted to DBADM, I can't understand why the "paste" option is disabled.
Following the example... seem to me that I should buy "Optim High Performance Unload" isn't?
nivanov1 100000H9H7231 Posts
Re: cloning databases2013-01-10T15:05:58ZThis is the accepted answer. This is the accepted answer.You could use "db2move export" to extract the tables you need, then write a script that would use the table list (db2move.lst) to generate the LOAD commands with the identityoverride option to load data, possibly also renaming schemas at the same time.