dbTalk Databases Forums  

transferring data between different DB2 servers

ibm.software.db2.mvs ibm.software.db2.mvs


Discuss transferring data between different DB2 servers in the ibm.software.db2.mvs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Helena Frank
 
Posts: n/a

Default transferring data between different DB2 servers - 09-14-2004 , 03:37 AM






Hi,

We have four different DB2 databases with the same sets of tables.
I'd like connect to one DB2 server, select rows from tables in that
environment and then connect to the other DB2 servers and insert these rows
into their corresponding tables. I want to do this whithout having the
application storing the result in between connections. In other words, I
want DB2 to do the whole job, preferably in a stored procedure which I call
from the application program. Is this at all possible?

Regards Helena



Reply With Quote
  #2  
Old   
M.D.
 
Posts: n/a

Default Re: transferring data between different DB2 servers - 09-14-2004 , 06:42 AM






Hi Helena

I suggest You to use standalone utility DSN1COPY Below is sample working
JCL. SYSUT1 is source tablespace consists table with data SYSUT2 is
empty tablespace with this same structure

//DSN1COPY JOB BID,MSGCLASS=M, MSGLEVEL=(2,1),NOTIFY=&SYSUID
//************************************************** //* STOP TABLESPACE
//************************************************** //STOP EXEC
PGM=IKJEFT01,DYNAMNBR=20 //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DBC1) -STOP DB(MARIUSZ)
SPACENAM(AAABBB) END /* //DSN1COPY EXEC PGM=DSN1COPY,PARM='OBIDXLAT'
//SYSPRINT DD SYSOUT=A //SYSUT1 DD
DSN=DA2D.DSNDBC.MARIUSZ.TS1.I0001.A001,DISP=SHR //SYSUT2 DD
DSN=DBC1.DSNDBC.MARIUSZ.AAABBB.I0001.A001,DISP=SHR //SYSXLAT DD *
263,270 6,2 7,3 /* //* START TABLESPACE
//*********************************************** //START EXEC
PGM=IKJEFT01,DYNAMNBR=20 //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DBC1) -START
DB(MARIUSZ) SPACENAM(AAABBB) END /* //REPAIR EXEC
DSNUPROC,SYSTEM=DBC1,UID='REPAIR' //SYSIN DD * REPAIR LEVELID TABLESPACE
MARIUSZ.AAABBB /* More information You'll find in 'Utility Guide &
Reference'

Regards Mariusz



--
posted via MFF : http://www.MainFrameForum.com - USENET Gateway

Reply With Quote
  #3  
Old   
Rolf Loeben
 
Posts: n/a

Default Re: transferring data between different DB2 servers - 09-14-2004 , 11:27 AM



Helena,

Quote:
We have four different DB2 databases with the same sets of tables.
I'd like connect to one DB2 server, select rows from tables in that
environment and then connect to the other DB2 servers and insert these
rows
into their corresponding tables. I want to do this without having the
application storing the result in between connections.
you have three choices:

either you use DRDA (not private protocol, which wouldn't work in this
case), connect to the required servers, SELECT and INSERT the data you
want, possibly in a StPrCall.
or use Information Integrator to do the work for you on a scheduled base
(additional licensed product)
or use Utility Remote Copy (integrated free product) to do it you
according to the SQL you provided to it.

In any case I would consult an IBM representative to learn more about the
details of your choice.

Regards Rolf


Reply With Quote
  #4  
Old   
Norm Wong
 
Posts: n/a

Default Re: transferring data between different DB2 servers - 10-18-2004 , 09:37 PM



Helena Frank wrote:

Quote:
Hi,

We have four different DB2 databases with the same sets of tables.
I'd like connect to one DB2 server, select rows from tables in that
environment and then connect to the other DB2 servers and insert these rows
into their corresponding tables. I want to do this whithout having the
application storing the result in between connections. In other words, I
want DB2 to do the whole job, preferably in a stored procedure which I call
from the application program. Is this at all possible?

Regards Helena


A simple option if you don't mind Utilities is to use the LOAD utility
to load from a cursor. It would be executed at each target database.
It goes something like this:

EXEX-SQL OPEN CURSOR C1 AS
SELECT * FROM LOCATION.OWNER.TABLE
ENDEXEC

LOAD TABLE OWNER.TABLE FROM CURSOR C1


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.