Oracle to MySQL through Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Oracle to MySQL through Unix
# 1  
Old 01-07-2004
Oracle to MySQL through Unix

Hello All,

I'm a complete Unix newbie, and I have been asked to provide a solution for the following opportunity:

Currently there is an Oracle database residing on a Unix box that I need to connect to on a regular basis from another Unix box. Upon connecting I need to hit multiple tables and query data which will then need to be written to a MySQL database.

I've thought of the following logic:

Have an Oracle stored Procedure run nightly on the one Server to grab the data I need and throw the records into a CSV file.

Then ftp from the other server nightly and grab that file.

Then use an API to grab each record from the file and write it to the MySQL database.

Does this sound like an appropriate solution?

I would really appreciate alternate solutions as well, as I have to present a list of suitable and functional ideas.

Thank you very much in advance for all the help,
Andrew
# 2  
Old 01-08-2004
If the servers are on same network. All
you really need is the API part.

If the servers are on remote locations and
a dial-up connection is needed, and you
must use ftp. Then your solution of putting
the data on a CSV file sounds good.
You will then have to parse the CSV file and
load it into MySQL. There is a good script
in the Perl Cook book on parsing CSV files.
# 3  
Old 01-08-2004
thanks

Thanks Photon,

They are on seperate servers, thanks for the confirmation of my idea! Smilie

Anyone else have any comments or suggestions?

Andrew
# 4  
Old 01-16-2004
Have you thought about using XML. XML is the ideal format.
There are plenty of API's available to parse the format and it
is more reliable.

For instance, in a CSV file

a, comment, with, commas, is, a, problem

or “ “ is this empty?

Also there is an issue with the disordering of data.

I could probably go on and on, but will spare you.

XML is worth learning, because it solves all these problems and more.
# 5  
Old 01-16-2004
Just a comment on the comma delimited issue, i am no PERL or XLM person, but if you delimit with | instead of commas, your , and " issues go away and very rarely do people store | (pipes) in their data fields.

i just finished migrating 200GB of company wide data and ran across 3 homegrown tables (out of over 4000) that actaully used | in a record, and oddly enough it was a table describing delimiters!!

hope this helps.
# 6  
Old 01-16-2004
I do not want to beat a dead horse, but bars
and commas are passé. Unless you want to
deal with excel and some other application
that gives you no choice to do so, but Hey,
eventually even excel is going to go with XML.

The point is; there is no dynamic enough parser
that can catch every error, unless you have an
agreed standard. Agreed?
# 7  
Old 01-16-2004
Thanks for all of the input

Hi All,

thank you for taking the time to respond to my post.

As it stands, it appears I am going to go with a driect data grab from the Oracle DB using a PHP script then a driect write to the the MySQL DB using PHP as well.

Thanks again,
Andrew
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

MySQL query does not work on Oracle 11g

Dear community, I have to make a "simple" query on ORACLE 11g DB who will output ONLY numbers in field1 who exceeded a specific threshold. In other words, assuming I have the following data in database. FIELD1 FIELD2 FIELD3 ========= ============== ... (3 Replies)
Discussion started by: Lord Spectre
3 Replies

2. UNIX and Linux Applications

Please help: Oracle gqsql or sqlplus output format like mysql

On psql select titolo,lingua from titolo where titolo ~* 'brivid'; titolo | lingua ------- + ------ Brivido | 1 On Sqlplus/gqsql SQL> select titolo,genere,anno,lingua from titolo where titolo like '%rivid%'; TITOLO... (6 Replies)
Discussion started by: Linusolaradm1
6 Replies

3. Shell Programming and Scripting

Error in installing mysql on unix server

Hi , I am trying to install mysql but getting below error $# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) can anyone provide me this file 'mysql.sock' Thanks (6 Replies)
Discussion started by: aish11
6 Replies

4. UNIX and Linux Applications

couldn login mysql in unix ...

hi am getting this error when i tried to login in unix.. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) but my application works fine... can u guide me,, (0 Replies)
Discussion started by: senkerth
0 Replies

5. UNIX for Dummies Questions & Answers

Connect MySQL database from Unix

How to connect a MySQL database from unix using unix shell scripting ( people are using perl scrpt to connect the same database). I want to access a MySQL database through a shell script (4 Replies)
Discussion started by: apsprabhu
4 Replies

6. UNIX for Dummies Questions & Answers

Unix is killing mysql or something else is happening

I don't know what is happening but none of my queries work. When I start mysql, even the use <database> option fails... So when I start mysql with -A, it atleast opens the database and shows the tables. But now, when I perform even a select option on the database, it hangs... Repair is not working... (5 Replies)
Discussion started by: Legend986
5 Replies

7. HP-UX

Restore of oracle 8i from hp unix 11.0 to HP unix 11i

Hi, We are planning to migrate oracle 8.1.7.2 (8i) currently installed on a host with HP unix 11.0 to a host with HP Unix 11i. The method we are adopting is backup and restore of all file systems. Could this be a problem, apart from linking libraries on the target system. Thanks for the... (1 Reply)
Discussion started by: amitb
1 Replies
Login or Register to Ask a Question