Does db2 move utility work for different environments if they are on different servers

Hi All

Does db2 move utility work for different environments if they are on different servers (with different IPs)?

    db2move sample COPY -sn BAR -co target_db  target schema_map
      "((BAR,FOO))" -u userid -p password  

I need to do copy a schema.
need DB cataloging?

Connecting to database SOURCEDB... successful!  Server : DB2 Common Server V10.5.7

**ERROR - Failed to connect to target database : TARGETDB


db2move failed with -1 (debuginfo:19)

can you pls help
Prardhan NAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kent OlsenDBACommented:
Hi Sridhar,

The DB2 move utility can't be used to move a database to another server.  

The traditional way to accomplish that move is with a full backup on the source server and a restore on the target server.


Kent
0
Prardhan NAuthor Commented:
I just need to copy the schema with data , not the DB.

but between different DBs which are in different machines.
0
Kent OlsenDBACommented:
BACKUP DATABASE myDB TO path/filename

The BACKUP DATABASE statement will back up any schema/database on the server.  In this case the terms "schema" and "database" are nearly synonymous.  That can be confusing as the terms "Database" and "instance" are often interchanged, too.  Making matters worse is that all vendors don't subscribe to the same definitions.  :(
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Prardhan NAuthor Commented:
For some reason, i want to use db2move utility, any inputs on this.
0
Kent OlsenDBACommented:
Unless the functionality was recently added (and I see no evidence that it was) db2move doesn't support it.  The utility uses direct I/O (skipping some of the DBMS overhead) to accomplish things at a lower level than the database.
0
Tomas Helgi JohannssonCommented:
Hi!

To move a schema with tables and data using db2move then you could use it like this (always works for me :) )
Export
db2move DBSOURCE export -aw -l lobs -sn schema1

Open in new window

Import
db2move DBTARGET import -io replace_create -l lobs

Open in new window


Or similar to your command.
 db2move dbsrc COPY -sn schema1 -co TARGET_DB dbtgt USER myuser1 USING mypass1
        SCHEMA_MAP ((schema1,newschema1)) TABLESPACE_MAP ((ts1,ts2), SYS_ANY))

Open in new window


Note that this command requires : The TARGET_DB cannot be the same as the source database and must be a local database.
So if the the target database is a remote database to the source then use the export/import method copying the exported data between hosts.

https://www.ibm.com/support/knowledgecenter/SSEPGG_10.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002079.html

Regards,
     Tomas Helgi
0
Prardhan NAuthor Commented:
Yes, target Db is on Remote Host.  Does Db2move does not work for remote machine directly ?

Shall i use db2move export
then ftp the files
then shall i Import or load the data ?

is that you are suggesting?
0
Tomas Helgi JohannssonCommented:
Hi!

Yes, use the export/import method in your case.

Regards,
    Tomas Helgi
0
Prardhan NAuthor Commented:
have many tables in the schema, do i need to export and ftp hundred of  files and load or import it.

Any simple way?
0
Prardhan NAuthor Commented:
Hi ,
do we have any Db2 utility does the operation(Schema copy with DDL and Data) over network for a remote target DB?
0
Tomas Helgi JohannssonCommented:
Hi!

No, I'm afraid not.
The export command I gave you exports all tables in the provided schema1 in one go.
And the import of the entire schema1 is also done in one single command.
All you need to do is to be in a directory ( on a disk) big enough to hold the exported data/files.
If you are on *nix then you can use scp commands to copy the entire directory to the remote host in one go.
So actually,  it's only 3 commands you need to execute.

Regards,
     Tomas Helgi
0
Prardhan NAuthor Commented:
Hi

what is the use of  "lobs" paramter? Is it to include lob data type data ?

I have lob data as well.
0
Prardhan NAuthor Commented:
if i want a new schema name in my remote DB

How to do that ?

I think 3rd command will only work for local Data Base.
0
Tomas Helgi JohannssonCommented:
Hi!

You can follow this in the guide to do the schema change inside the same database.
Basically open a connetion to the database as the instance owner or SYSDBA user
and issue the ADMIN_COPY_SCHEMA command
with the required schemanames

Example (see the above link for more info especially the copymode - COPY/COPYNO option)
CALL SYSPROC.ADMIN_COPY_SCHEMA('SOURCE_SCHEMA', 'TARGET_SCHEMA', 
   'COPY', NULL, 'SOURCETS1 , SOURCETS2', 'TARGETTS1, TARGETTS2, 
   SYS_ANY', 'ERRORSCHEMA', 'ERRORNAME') ;

Open in new window


Regards,
     Tomas Helgi
0
Prardhan NAuthor Commented:
Thanks for info. As per your inputs and my reading schema name change is not possible directly.

The only way is to create a new schema(with required name) through ADMIN_COPY_SCHEMA utility and drop the old one.
0
Tomas Helgi JohannssonCommented:
Hi

And to drop the entire schema (after copying it  and the data to the new one) use the ADMIN_DROP_SCHEMA utility. :)

Regards,
    Tomas Helgi
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Prardhan NAuthor Commented:
Thanks for your valuable inputs.

Appreciating your knowledge sharing.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.