好比,sql server導出數據庫文件-導入、PL_SQL自帶的遷徙功能sql
好比,navicat prrmium 數據傳輸、DB2DB等等
相同數據庫軟件之間效果好,不一樣數據庫軟件之間可能會有一些問題數據庫
1.導出成SQL腳本,手動處理成另外一種數據庫的sql語句
2.寫程序,鏈接舊數據庫,取出數據,鏈接新數據庫,存入數據c#
Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@"+serverName+":1521:eclipsedb"; Connection connOracle = DriverManager.getConnection(url,"eclipse","888888"); //鏈接源數據源 Statement stmt = connOracle.createStatement(); ResultSet rs = stmt.executeQuery("select * from employee"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection connAccess = DriverManager.getConnection("jdbc:odbc:target","",""); //鏈接目標數據源 PreparedStatement pstmt = connAccess.prepareStatement("insert into employee(id,name,department,salary) values(?,?,?,?)"); //循環裝入數據 while(rs.next()) { pstmt.setInt(1,rs.getInt("id")); pstmt.setString(2,rs.getString("name")); pstmt.setString(3,rs.getString("department")); pstmt.setDouble(4,rs.getDouble("salary")); pstmt.executeUpdate(); } //釋放資源 rs.close(); stmt.close(); pstmt.close(); connOracle.close(); connAccess.close();
來自 http://zhengshuo3527.blog.163.com/blog/static/615348220073381530569/oracle