Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / July 2006

Tip: Looking for answers? Try searching our database.

Help with db2move

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Fiene - 05 Jul 2006 11:38 GMT
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
Serge Rielau - 05 Jul 2006 12:06 GMT
> Hi, i am not really a db2 specialist, so i think i have a basic problem.
>
[quoted text clipped - 12 lines]
> 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/db2/library/techarticle/dm-0602rielau/

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ondemandbusiness/conf2006/

Frank Fiene - 05 Jul 2006 13:17 GMT
> 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/db2/library/techarticle/dm-0602rielau/

Sorry, 8.2! ;-)

But this is for Schema copy, not for tablespace copy! Right?
Gregor Kovač - 05 Jul 2006 13:23 GMT
> http://www.ibm.com/developerworks/db2/library/techarticle/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.

Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

| Gregor Kovac |    Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?   |
|              Experience Linux.                |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Frank Fiene - 05 Jul 2006 15:12 GMT
>> http://www.ibm.com/developerworks/db2/library/techarticle/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.
Gregor Kovač - 05 Jul 2006 16:47 GMT
>>> http://www.ibm.com/developerworks/db2/library/techarticle/dm-0602rielau/
>>
[quoted text clipped - 8 lines]
> 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.

Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

| Gregor Kovac |    Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?   |
|              Experience Linux.                |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Gregor Kovač - 05 Jul 2006 13:27 GMT
> In DB2 9 (you didn't state the release) you can use teh COPY_SCHEMA()
> procedure to copy a schema within a database.
[quoted text clipped - 3 lines]
> Cheers
> Serge

Wow! Pitty I didn't have this/know about this couple of month ago :(

Best regards,
       Kovi

Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

| Gregor Kovac |    Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?   |
|              Experience Linux.                |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.