Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 6th, 2002, 02:42 PM
bapolis bapolis is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 257 bapolis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 36 sec
Reputation Power: 7
Transferring data between multiple sources

I need to write a script that dumps data from one database (Oracle) and uploads it into a completely different database (MS SQL). Has anyone ever writen a script like this before? Are there any sites/tutorials that explain the fundamentals on how do to this?

Reply With Quote
  #2  
Old August 6th, 2002, 04:12 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
This can be broken down into two stages, depending on what you have set up.
Stage 1:
If the receiving database does not have the table structure already defined in it, then you have to build the table structure. There can be problems here, it the table structure is valid for one database, but not on the other. This goes to include, data types, primary/foreign keys and other constraints. So it would be best to build just a basic table structure with known data types that will work for both database types.
PHP (if this is the language you are using) has the ability to get field names, data types and primary keys for almost all databases it supports, so building the table structure shouldn't be that difficult of a taskl

Stage 2:
Dumping the data into a file in the format that can be uploaded into the receiving database. There are three options here.
1) A csv file (comma delimited) which most databases have support for uploading csv files.
2) Another defined delimited support, for which generally all databases support this also but can sometimes be more of a pain to upload. (i.e. a tab delimited file)
3) Export the contents of the database into sql insert statement according to the table structure.

I would say option 3 is the best route to go if you have a new table structure, or are relatively new to uploading data into a database. Each way will pose it's own risks. A well known tool for PHP uses on the mysql database is phpMySQLAdmin which has the options listed above and a few more, but is only for mysql.

Reply With Quote
  #3  
Old August 8th, 2002, 06:08 PM
mlemos mlemos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 1 mlemos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Transferring data between multiple sources

Quote:
Originally posted by bapolis
I need to write a script that dumps data from one database (Oracle) and uploads it into a completely different database (MS SQL). Has anyone ever writen a script like this before? Are there any sites/tutorials that explain the fundamentals on how do to this?


This looks like a task for Metabase .

Metabase has now experimental schema reverse engineering support in such way that you can retrieve the schema of a database installed by some other application and then you can re-install it in any supported database, including MS SQL.

The support for this is not yet publically available in the address above but it is already in the beta version in the metabase-dev mailing list file archive. Just mail me at URL if you are interested to use Metabase for this purpose and I can make sure it works for the particular databases that you are working with.

Reply With Quote
  #4  
Old August 9th, 2002, 03:15 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,808 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 21 h 29 m 33 sec
Reputation Power: 278
You should look at the MS DTS (Data Transformation Services) Assistant, (see http://www.sqldts.com/ ) or read this http://www.devarticles.com/content....leId=147&page=1 about bulk copy utility.
Hope this helps, and please let me know about your solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Transferring data between multiple sources


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway