用Sql Developer将SQL移植到Oracle(二)

数据库 Oracle
上文中我们介绍了Oracle Sql Developer工具的获取及安装过程,接下来我们开始介绍使用该工具来建立档案库的过程,希望读者喜欢。

本文介绍SQL 移植的第二部分:建立资料档案库(Migration Repository)。

一、连接到Oracle

在程序左边的连接窗口中,点击加号按钮,添加一个到Oracle数据库的dba连接,如下图:

用Sql Developer将SQL数据库移植到Oracle数据库

配置完成后,点击连接按钮,连接到数据库。

二,建立用户

打开到Oracle数据的连接,新建一个用户,我们要在该用户的模式中建立所谓的“资料档案库”,并使用该用户去建立SQL Server移植后的用户名,以及做其它的一些工作。按照帮助中的说明,这个用户最少需要以下权限和角色:

Roles:CONNECT WITH ADMIN OPTION,RESOURCE WITH ADMIN OPTION.

Privileges:ALTER ANY ROLE,ALTER ANY SEQUENCE,ALTER ANY TABLE,ALTER TABLESPACE,ALTER ANY TRIGGER,COMMENT ANY TABLE,CREATE ANY SEQUENCE,CREATE ANY TABLE,CREATE ANY TRIGGER,CREATE VIEW WITH ADMIN OPTION,CREATE PUBLIC SYNONYM WITH ADMIN OPTION,CREATE ROLE,CREATE USER,DROP ANY SEQUENCE,DROP ANY TABLE,DROP ANY TRIGGER,DROP USER,DROP ANY ROLE,GRANT ANY ROLE,INSERT ANY TABLE,SELECT ANY TABLE,UPDATE ANY TABLE.

以下语句直接建立一个名为migrations的用户:

-- Create the user

  1. create user MIGRATIONS  
  2.  
  3. identified by MIGRATIONS  
  4.  
  5. default tablespace USERS  
  6.  
  7. temporary tablespace TEMP  
  8.  
  9. profile DEFAULT; 

-- Grant/Revoke role privileges

  1. grant connect to MIGRATIONS with admin option;  
  2.  
  3. grant resource to MIGRATIONS with admin option; 

-- Grant/Revoke system privileges

  1. grant alter any role to MIGRATIONS;  
  2.  
  3. grant alter any sequence to MIGRATIONS;  
  4.  
  5. grant alter any table to MIGRATIONS;  
  6.  
  7. grant alter any trigger to MIGRATIONS;  
  8.  
  9. grant alter tablespace to MIGRATIONS;  
  10.  
  11. grant comment any table to MIGRATIONS;  
  12.  
  13. grant create any sequence to MIGRATIONS;  
  14.  
  15. grant create any table to MIGRATIONS;  
  16.  
  17. grant create any trigger to MIGRATIONS;  
  18.  
  19. grant create any view to MIGRATIONS;  
  20.  
  21. grant create materialized view to MIGRATIONS with admin option;  
  22.  
  23. grant create public synonym to MIGRATIONS with admin option;  
  24.  
  25. grant create role to MIGRATIONS;  
  26.  
  27. grant create session to MIGRATIONS with admin option;  
  28.  
  29. grant create synonym to MIGRATIONS with admin option;  
  30.  
  31. grant create tablespace to MIGRATIONS;  
  32.  
  33. grant create user to MIGRATIONS;  
  34.  
  35. grant create view to MIGRATIONS with admin option;  
  36.  
  37. grant drop any role to MIGRATIONS;  
  38.  
  39. grant drop any sequence to MIGRATIONS;  
  40.  
  41. grant drop any table to MIGRATIONS;  
  42.  
  43. grant drop any trigger to MIGRATIONS;  
  44.  
  45. grant drop tablespace to MIGRATIONS;  
  46.  
  47. grant drop user to MIGRATIONS;  
  48.  
  49. grant grant any role to MIGRATIONS;  
  50.  
  51. grant insert any table to MIGRATIONS;  
  52.  
  53. grant select any table to MIGRATIONS;  
  54.  
  55. grant unlimited tablespace to MIGRATIONS with admin option;  
  56.  
  57. grant update any table to MIGRATIONS; 

再次点击连接中的加号按钮,添加一个使用刚刚新建立的用户的连接。

用Sql Developer将SQL数据库移植到Oracle数据库

连接后,在该连接上点击右键,选择移植资料档案库-关联移植资料档案库,程序会在该用户下建立移植资料档案库所需要的表、存储过程等等,弹出一个对话框显示当前建立的进度,稍等片刻即建立完毕。

原文出处:http://www.cnblogs.com/hiizsk/archive/2011/07/10/2102454.html。

【编辑推荐】

  1. 用Sql Developer将SQL移植到Oracle(三)
  2. 用Sql Developer将SQL移植到Oracle(四)
  3. 用Sql Developer将SQL移植到Oracle(五)
  4. 用Sql Developer将SQL移植到Oracle(一)
责任编辑:赵鹏 来源: 博客园
相关推荐

2011-07-11 16:47:57

数据库移植SQL ServerOracle

2011-07-11 15:23:37

Sql DevelopOracle Migr

2011-07-11 17:44:07

SQLOracle标识符

2011-07-11 18:22:34

2010-04-09 12:20:11

Oracle SQL

2011-09-05 09:28:58

MySQLMongoDB

2010-08-12 10:43:36

DB2 SQL移植

2017-04-07 13:30:54

2009-12-29 08:58:32

Oracle SQL PL SQL单元测试

2009-12-28 10:08:07

OracleSQLDevelope开发框架

2011-01-13 14:19:41

solarisLinux

2011-08-01 09:09:07

SQL Server SQL Server 数据库

2011-04-07 09:44:23

SQL2000数据库SQL2005

2010-05-05 11:17:55

Oracle数据库

2010-04-01 14:14:56

Oracle绑定变量

2011-06-21 10:28:49

Oracle

2011-10-09 12:59:54

DtraceLinux甲骨文

2023-06-07 09:00:00

JavaScript开发TypeScript

2011-05-04 09:29:22

2010-05-24 18:05:12

MySQL数据库
点赞
收藏

51CTO技术栈公众号