How to port SQL7, Sysbase, and Access to Oracle8i

Source: Internet
Author: User

With the wide application of Oracle in China, many users who used MS SQL7.0, Sysbase, Access and other databases have encountered the problem of data migration. In fact, there are many methods. Here we will introduce three methods.
1. Use the Import/Export tool provided by MS SQL7.0
The Import/Export tool can easily Port Data to Oracle. You need to define ODBC For Or acle as the target source. This method ensures that the vast majority of data in SQL7 is migrated to Oracle, but you must create a user and corresponding tablespace in Oracle in advance. Because SQL7 has some special ype, such as text and image. If a table contains more than one text or image field, an error occurs and cannot be executed. This is what you need to make, or set the text image to varchar2 (4000), or the image to Long datatype, but long datatype can only have one table. In addition, there may be Character Set problems. It is best to use the third method or the fourth method. In this case, you can use 3rd methods in combination.
2. Use Oracle Migration Workbanch.
The current version is 2.2. This tool can be downloaded at http://technet.oracle.com/for free. It is a tool provided by O racle to replace SQL * Loader. Of course, this tool still cannot completely replace SQL * Loade r. Using OMWB, as long as you define ODBC for MS SQL7 or Access or Sysbase, you can easily convert tabels, views, triger, procedure, shortnaps, users, and so on to Oracle, for text, the image type can be CLOB, And the CLOB type can have multiple columns in an Oracle table. Image can be BLOB. However, OMWB2.2 does not support CLOB in Chinese. No matter how I adjust it, after the data is migrated to Oracle, it becomes ????, If anyone has a solution, don't forget to email me. I really appreciate OMWB's control over data streams such as image, video, and sound.
3. Use Oracle SQL * Loader
Using SQL * Loader may be the most inconvenient method, but it is the most effective method. You can use various methods to import source data to an external part. I used the BCP tool in MS SQL7 to export the tables of special multi-te xt fields as an external file. Use SQL * Loader to export the data to a temporary table in Oracle ???? Update fields.
4. Use a program for transplantation

Example: import data from SQL7.0 to Oracle Database Based on Linux: program language: connection between java and database SQL7.0: jdbc-odbc bridge, which comes with java. Oracle: jdbc, which is provided by Oracle. The Code is as follows: import java. lang. *; import java. SQL. *; import oracle. jdbc. driver. *; // enter the public class hhw extends Object {public static void main (String args []) throws SQLException, ClassNotFoundException // throw SQLException exception {Class. forName ("sun. jdbc. odbc. jdbcOdbcDriver "); Class. forName ("oracle. jdbc. driver. oracleDriver "); // register the driver and prepare to connect to the database Connection cn1 = DriverManager. getConnection ("jdbc: oracle: thin: @ 192.168.1.52: 1521: SONIC", "sadly", "sadly"); Connection cn2 = DriverManager. getConnection ("jdbc: odbc: SQL", "sa", ""); // connect to the database and establish a connection to the two databases Statement s1 = cn1.createStatement (); statement s2 = cn2.createStatement (); ResultSet rs1jws2.exe cuteQuery ("select * from users where id> 0 and id <40000"); // obtain data from the data source, define some intermediate variables int id; String name = new String ("1"); String passwd = new String ("1"); String email = new String ("1 "); // execute another query and insert data into the target database while (rs1.next () {id = rs1.getInt (1); name = rs1.getString ("name "); passwd = rs1.getString ("passwd"); email = rs1.getString ("email"); // System.out.print(id+name+passwd+email);s1.exe cuteQuery ("insert into bbsuser values ('" + id + "', '"+ name +"', '"+ passwd +"', '"+ email + "')");}}}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.