使用ant执行sql脚本重建oracle数据库

最近工作中,需要把之前的产品(基于mysql数据库的)转换到oracle环境中,利用oracle自己提供的一个工具sqldeveloper(有时间的话,把这个工具如何把mysql转换到oracle,也整理出来),里面的migration功能,可以把mysql的表结构,数据都导出成oracle的格式,对于生成的sql脚本,为了便于开发人员,持续构建,我写成了ant文件,供大家使用。



























DROP USER ${jdbc.userid} CASCADE;








CREATE USER ${jdbc.userid} IDENTIFIED BY ${jdbc.password};
GRANT CONNECT, RESOURCE, CREATE VIEW, CREATE PUBLIC SYNONYM TO ${jdbc.userid} WITH ADMIN OPTION;
GRANT 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 ROLE, CREATE TABLESPACE,
  CREATE USER, DROP ANY SEQUENCE, DROP ANY TABLE,
  DROP ANY TRIGGER, DROP TABLESPACE, DROP USER,
  DROP ANY ROLE, GRANT ANY ROLE, INSERT ANY TABLE,
  SELECT ANY TABLE, UPDATE ANY TABLE
  TO ${jdbc.userid} WITH ADMIN OPTION;








你可能感兴趣的:(工作,脚本,Oracle,SQL,Ant,数据结构)