vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, i am not really a db2 specialist, so i think i have a basic problem. I have two tablespaces in one database which are a generated by SAP Business One. The tablespaces are representing different companies. Here, on is for testing the other for productive use. Now i want to copy the test tablespace onto the productive one. I tried the following without success: I've done a "db2move sbo_db export -ts ts_test", imported this in another database with "db2move temp import". After renaming ts_test to ts_prod in temp database, i've tried the way back but it seems that the data is not imported into the original database! Is this the correct way to do this? Please help! Frank |
| |||
| Frank Fiene wrote: > Hi, i am not really a db2 specialist, so i think i have a basic problem. > > I have two tablespaces in one database which are a generated by SAP Business > One. The tablespaces are representing different companies. Here, on is for > testing the other for productive use. > > Now i want to copy the test tablespace onto the productive one. > > I tried the following without success: > > I've done a "db2move sbo_db export -ts ts_test", > imported this in another database with > "db2move temp import". > > After renaming ts_test to ts_prod in temp database, i've tried the way back > but it seems that the data is not imported into the original database! In DB2 9 (you didn't state the release) you can use teh COPY_SCHEMA() procedure to copy a schema within a database. In DB2 V8.2 you can take a look at this article: http://www.ibm.com/developerworks/db...dm-0602rielau/ Cheers Serge -- Serge Rielau DB2 Solutions Development IBM Toronto Lab IOD Conference http://www.ibm.com/software/data/ond...ness/conf2006/ |
| |||
| Serge Rielau wrote: > In DB2 9 (you didn't state the release) you can use teh COPY_SCHEMA() > procedure to copy a schema within a database. > In DB2 V8.2 you can take a look at this article: > http://www.ibm.com/developerworks/db...dm-0602rielau/ Sorry, 8.2! ;-) But this is for Schema copy, not for tablespace copy! Right? |
| |||
| Frank Fiene wrote: > http://www.ibm.com/developerworks/db...dm-0602rielau/ What I can see from the article you could use: COPYSCHEMA(<TARGETSCHEMA>,<TARGETTABLESPACEINFO>,< SOURCESCHEMA>) So. first you create a new tablespace (TARGETTABLESPACEINFO) and then run this. -- -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- | Gregor Kovac | Gregor.Kovac@mikropis.si | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- |
| |||
| Serge Rielau wrote: > In DB2 9 (you didn't state the release) you can use teh COPY_SCHEMA() > procedure to copy a schema within a database. > In DB2 V8.2 you can take a look at this article: > http://www.ibm.com/developerworks/db...dm-0602rielau/ > > Cheers > Serge > Wow! Pitty I didn't have this/know about this couple of month ago Best regards, Kovi -- -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- | Gregor Kovac | Gregor.Kovac@mikropis.si | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- |
| |||
| Gregor Kovač wrote: > Frank Fiene wrote: > >> http://www.ibm.com/developerworks/db...dm-0602rielau/ > > What I can see from the article you could use: > COPYSCHEMA(<TARGETSCHEMA>,<TARGETTABLESPACEINFO>,< SOURCESCHEMA>) > So. first you create a new tablespace (TARGETTABLESPACEINFO) and then run > this. As i know, all Business One tables are in one schema, but different tablespaces for the companies. So if i do this, i will copy all tablespaces in one schema and rename it with one tablespace name! Right. This is bad. |
| ||||
| Frank Fiene wrote: > Gregor Kovač wrote: > >> Frank Fiene wrote: >> >>> http://www.ibm.com/developerworks/db...dm-0602rielau/ >> >> What I can see from the article you could use: >> COPYSCHEMA(<TARGETSCHEMA>,<TARGETTABLESPACEINFO>,< SOURCESCHEMA>) >> So. first you create a new tablespace (TARGETTABLESPACEINFO) and then run >> this. > > As i know, all Business One tables are in one schema, but different > tablespaces for the companies. > > So if i do this, i will copy all tablespaces in one schema and rename it > with one tablespace name! Right. This is bad. Oh... Now I see So, this is what you can do: SELECT TABNAME FROM SYSCAT.TABLES WHERE TBSPACEID = (SELECT TBSPACEID FROM SYSCAT.TABLESPACES WHERE TBSPACE = 'ts_test') Now you have tables that are in tablespace ts_test and you can export them and import then into new tables. -- -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- | Gregor Kovac | Gregor.Kovac@mikropis.si | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- |