使用 SQL Developer 将 SQL Server 数据库移植到 Oracle 上(转)

mac2022-06-30  22

第一步: SQL Developer 下载、安装、与配置

Oracle 网站, 下载 Oracle Sql Developer(如果下载不包含 JDK 的版本, 那么还要确保自己电脑上面, 已经有 JDK 了, 或者额外去新下载一个 JDK )

将下载后的文件,解压缩到 D:\Program Files\sqldeveloper 目录下

去下载一个 jtds-1.2.5-dist.zip解压缩后, 复制 jtds-1.2.5.jar 到 D:\Program Files\sqldeveloper\sqldeveloper\lib 目录下

运行 D:\Program Files\sqldeveloper 目录下的 sqldeveloper.exe  (首次运行时,可能要求你输入 JDK 的目录)

进入 Oracle Sql Developer 以后, 菜单中选择 “工具” -- "首选项"弹出窗口中, 左边树型列表中选择 “数据库” -- “第三方 JDBC 驱动程序”

右下按 “添加条目” 按钮。把前面那个 jtds-1.2.5.jar  加入进来。按 “确定” 关闭当前窗口。

退出 Oracle Sql Developer , 然后再运行一次 sqldeveloper.exe在 “连接” 处按 右键 , 选择 “新建连接”。看看有没有  SQL Server 的选项卡。有的话, 那么本步骤处理完毕了。

 

 

第二步:配置 Oracle  建立资料档案库(Migration Repository)

SQL PlusConn / AS sysdba 以后,执行以下语句直接建立一个名为migrations的用户:

create user MIGRATIONSidentified by MIGRATIONS  default tablespace USERS  temporary tablespace TEMP  profile DEFAULT;-- Grant/Revoke role privilegesgrant connect to MIGRATIONS with admin option;grant resource to MIGRATIONS with admin option;-- Grant/Revoke system privilegesgrant alter any role to MIGRATIONS;grant alter any sequence to MIGRATIONS;grant alter any table to MIGRATIONS;grant alter any trigger to MIGRATIONS;grant alter tablespace to MIGRATIONS;grant comment any table to MIGRATIONS;grant create any sequence to MIGRATIONS;grant create any table to MIGRATIONS;grant create any trigger to MIGRATIONS;grant create any view to MIGRATIONS;grant create materialized view to MIGRATIONS with admin option;grant create public synonym to MIGRATIONS with admin option;grant create role to MIGRATIONS;grant create session to MIGRATIONS with admin option;grant create synonym to MIGRATIONS with admin option;grant create tablespace to MIGRATIONS;grant create user to MIGRATIONS;grant create view to MIGRATIONS with admin option;grant drop any role to MIGRATIONS;grant drop any sequence to MIGRATIONS;grant drop any table to MIGRATIONS;grant drop any trigger to MIGRATIONS;grant drop tablespace to MIGRATIONS;grant drop user to MIGRATIONS;grant grant any role to MIGRATIONS;grant insert any table to MIGRATIONS;grant select any table to MIGRATIONS;grant unlimited tablespace to MIGRATIONS with admin option;grant update any table to MIGRATIONS;

回到 SQL Developer .新建一个 Oracle 的连接 用户名就是  MIGRATIONS

 

 

第三步:配置 SQL Server 的连接首先确保 SQL Server 配置要正确配置内容包含:1、SQL Server 配置管理器中, SQL Server 网络协议的  TCP/IP 协议要 已启用, 指定 IP 地址 已启用。2、SQL Server Management Studio 中,服务器属性里面。 安全性的 服务器身份验证,设置为  SQL Server 和 Windows 身份验证模式。 连接的  允许远程连接到此服务器 要打勾

SQL Developer 中,创建一个 SQL Server 的连接然后 右键, 选择 “移植到 Oracle ”

1、简介,直接按 下一步2、资料档案库,选择前面 第二步 创建的 MIGRATIONS, 然后按下一步。 等待进度条处理完毕。3、项目, 输入名称 , 选择好输出目录后, 按下一步4、源数据库(因为是 先选择好 SQL Server 数据库连接后,右键的,因此这里直接按 下一步)5、捕获,如果 “所选数据库” 有项目了, 那么直接按 下一步6、转换,直接按 下一步7、目标数据库, 还是前面的那个 第二步 创建的 MIGRATIONS,按下一步。8、移动数据,直接按 下一步9、完成。

 

然后慢慢等处理完毕了。

处理完毕后, 会在系统中, 新创建一个   DBO_SQLServer数据库名  的用户。所有的数据库表,都已经在 这个用户的 Schema 下。

下载地址:http://files.cnblogs.com/techMichaelLee/jdbc1.2.5.rar

原文链接:http://hi.baidu.com/wangzhiqing999/item/cadb72efdc85553087d9de2c

转载于:https://www.cnblogs.com/LeeYZ/archive/2012/11/15/2772146.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)