If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Data Transfer from DB2 to Oracle using Kshell scripting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-30-10, 13:02
prasenjits prasenjits is offline
Registered User
 
Join Date: Aug 2010
Posts: 1
Exclamation Data Transfer from DB2 to Oracle using Kshell scripting

Hi All,

Need suggestion on this.

Using shell scripting, how I can handle the following things.

1.Connect to mainframe DB2 database.
2.Extract data from a table and stored in CSV file.
3.Extract data from CSV and do some conversion(Date format in DB2 to Date format in Oracle).
4.Load the data to oracle table in a Unix server.

This job will be executed as a scheduler to extract data from DB2 to Oracle for multiple tables.

Many thanks in advance.
Prasenjit
Reply With Quote
  #2 (permalink)  
Old 08-30-10, 20:16
spacebar spacebar is offline
Registered User
 
Join Date: Feb 2006
Posts: 73
If you are going to run this process as a scheduled job from the machine that the Oracle database is on then I'm assuming first, that you have a database gateway setup(some info: database gateway) for the Oracle to DB2 databases.

IMHO, I would just create a database link from the Oracle database to the DB2 database(info: dblink) and just schedule a oracle job(sql statement or run a procedure) via a cron job or dbms_scheduler(info: dbms_scheduler).

Just an example sql:
Code:
begin
insert into oracle_schema.oracle_table
  select < columns you need >
   from  db2_schema.db2_table
  where  < your conditions >;
end;



Or you can export the data on the DB2 machine to a delimited flat file(i prefer TAB delimited) and ftp, scp, etc. the file over to the Oracle machine and import the flat file data via Sql*Loader or I prefer using an external table(info: external table).

hth
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On