原来的项目是SSH+SQL Server2005,现将系统移到Oracle11g中,打算正向生成数据库表,结果启动Tomcat服务器的时候,控制台报错,有的表不能创建,错误信息如下:16:23:24,896 ERROR SchemaExport:274 - Unsuccessful: create table ZW.dbo.attachment (ID number(10,0) not null, Aud_ID number(10,0), description varchar2(1000), uploadperson varchar2(255), uploadtime varchar2(255), addr varchar2(1000), primary key (ID))
16:23:24,896 ERROR SchemaExport:275 - ORA-00922: 选项缺失或无效
在网上查了很多,都说是与关键字、保留字冲突,但是检查了下,应该不存在这样的问题,所以很疑惑,望大家指点一二,谢谢

解决方案 »

  1.   

     alter   table  ZW.dbo.attachment    add   primary   key(ID)
      

  2.   

    create table ZW.dbo.attachment 看看你的xml映射配置中是不是在class节点加了schema="xxxx"
      

  3.   

    SchemaExport
    老兄,oracle模式不对。
    你的表名ZW.dbo.attachment被认为是ZW用户下的!两个点不能用的。
    比如你的连接用户名是test1,那么模式名就是test1,你这里两个点,sql server支持,但是oracle不支持的。
    oralce只支持一个点,并且这个点前面的代表模式,就是说该表属于的数据库用户。
    修改你的语句。给你做的实验:
    SQL> create table cartoon.t1.to(a number(2));
    create table cartoon.t1.to(a number(2))
                           *
    ERROR 位于第 1 行:
    ORA-00922: missing or invalid option
    SQL> create table cartoon.t1(a number(2));
    create table cartoon.t1(a number(2))
                         *
    ERROR 位于第 1 行:
    ORA-00955: name is already used by an existing object
    SQL> create table cartoon.tt1(a number(2));表已创建。SQL>