CSDN博客

img hongbo781202

OBE数据库配置过程

发表于2004/6/24 12:25:00  2768人阅读

OBE的数据库配置过程(补充版)

配置数据库

感谢snailhyy, 感谢dcomli

 

这里用mysql作为说明,准备工作是安装mysql数据库。

 

1。建立一个名字为obe的数据库

2。在客户端运行D:/obe/obe/obeserver/etc/ddl/mysql-ddl.sql这个sql文件。(记住去掉“TYPE = InnoDB”,并去掉里面的注释,否则会报错)修改后可以直接使用的ddl文件在本文后面提供

3。运行D:/obe/obe/obeserver/etc/ddl/populatedb.sql文件。该文件放初始化数据。

4。建立一个用户名为obe,密码为obe的用户

5。为这个用户设立权限,当然首先要对这个用户设立可以操作obe数据库的权限。其他的就可以选择了。

这样配置数据库的过程就可以结束了。你可以用mysql的客户端测试,连接obe@localhost:3306看是否成功,然后连接obe数据库时候成功。

 

DDL文件全文

DROP TABLE OBEAUDITENTRY;

DROP TABLE OBEATTRIBUTEINSTANCE;

DROP TABLE OBEWORKITEM;

DROP TABLE OBEACTIVITYINSTANCE;

DROP TABLE OBEPROCESSINSTANCE;

DROP TABLE OBEPROCESSDEFINITION;

DROP TABLE OBEPACKAGE;

DROP TABLE OBESEQUENCE;

DROP TABLE OBEAUDITEVENT;

DROP TABLE OBEACTIVITYINSTANCESTATE;

DROP TABLE OBEATTRIBUTETYPE;

DROP TABLE OBEATTRIBUTEOWNER;

DROP TABLE OBEPROCESSINSTANCESTATE;

DROP TABLE OBEPROCESSDEFINITIONSTATE;

 

 

CREATE TABLE obe.OBEPROCESSDEFINITIONSTATE (

       STATE TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              STATE

        )

);

 

 

CREATE TABLE obe.OBEPROCESSINSTANCESTATE (

       STATE TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              STATE

        )

);

 

 

CREATE TABLE obe.OBEATTRIBUTEOWNER (

       OWNERTYPE TINYINT NOT NULL,

       TABLENAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              OWNERTYPE

        )

) ;

 

 

 

CREATE TABLE obe.OBEATTRIBUTETYPE (

       TYPE TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              TYPE

        )

);

 

 

CREATE TABLE obe.OBEACTIVITYINSTANCESTATE (

       STATE TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              STATE

        )

);

 

 

CREATE TABLE obe.OBEAUDITEVENT (

       EVENT TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PRIMARY KEY (

              EVENT

        )

) ;

 

 

CREATE TABLE obe.OBESEQUENCE (

       NAME VARCHAR(64) NOT NULL,

       MAXKEY BIGINT NOT NULL,

       PRIMARY KEY (

              NAME

        )

);

 

 

CREATE TABLE obe.OBEPACKAGE (

       PACKAGEID VARCHAR(64) NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       DESCRIPTION VARCHAR(254) NULL,

       VERSION VARCHAR(16) NULL,

       AUTHOR VARCHAR(32) NULL,

       VENDOR VARCHAR(32) NULL,

       XPDLPACKAGE LONGBLOB  NOT NULL,

       PRIMARY KEY (

              PACKAGEID

        )

);

 

 

CREATE TABLE obe.OBEPROCESSDEFINITION (

       PROCESSDEFINITIONID VARCHAR(64) NOT NULL,

       NAME VARCHAR(64) NULL,

       DESCRIPTION VARCHAR(254) NULL,

       AUTHOR VARCHAR(32) NULL,

       STATUS VARCHAR(32) NULL,

       CREATEDDATE DATETIME NULL,

       VALIDFROMDATE DATETIME NULL,

       VALIDTODATE DATETIME NULL,

       STATE TINYINT NOT NULL,

       PACKAGEID VARCHAR(64) NULL,

       PRIMARY KEY (

              PROCESSDEFINITIONID

        ),

        INDEX(PACKAGEID),

       FOREIGN KEY (

              PACKAGEID

        )

       REFERENCES OBEPACKAGE(PACKAGEID),

        INDEX(STATE),

       FOREIGN KEY (

              STATE

        )

       REFERENCES OBEPROCESSDEFINITIONSTATE(STATE)

);

 

 

CREATE TABLE obe.OBEPROCESSINSTANCE (

       PROCESSINSTANCEID BIGINT NOT NULL,

       PARENTACTIVITYINSTANCEID BIGINT NULL,

       PRIORITY TINYINT NOT NULL,

       COMPLETEDDATE DATETIME NULL,

       CREATEDDATE DATETIME NOT NULL,

       ACTIVITYDUEDATE DATETIME NULL,

       ACTIVITYTARGETDATE DATETIME NULL,

       DUEDATE DATETIME NULL,

       TARGETDATE DATETIME NULL,

       STARTEDDATE DATETIME NULL,

       NAME VARCHAR(64) NULL,

       PARTICIPANTS LONGBLOB  NULL,

       STATE TINYINT NOT NULL,

       PROCESSDEFINITIONID VARCHAR(64) NULL,

       PRIMARY KEY (

              PROCESSINSTANCEID

        ),

        INDEX(PROCESSDEFINITIONID),

       FOREIGN KEY (

              PROCESSDEFINITIONID

        )

       REFERENCES OBEPROCESSDEFINITION(PROCESSDEFINITIONID),

        INDEX(STATE),

       FOREIGN KEY (

              STATE

        )

       REFERENCES OBEPROCESSINSTANCESTATE(STATE)

);

 

 

CREATE TABLE obe.OBEACTIVITYINSTANCE (

       ACTIVITYINSTANCEID BIGINT NOT NULL,

       ACTIVITYDEFINITIONID VARCHAR(64) NOT NULL,

       STARTEDDATE DATETIME NULL,

       COMPLETEDDATE DATETIME NULL,

       DUEDATE DATETIME NULL,

       TARGETDATE DATETIME NULL,

       SERIALDATA LONGBLOB  NULL,

       NAME VARCHAR(64) NULL,

       PARTICIPANTS LONGBLOB  NULL,

       PRIORITY TINYINT NOT NULL,

       STATE TINYINT NOT NULL,

       PROCESSDEFINITIONID VARCHAR(64) NULL,

       PROCESSINSTANCEID BIGINT NULL,

       BLKACTIVITYINSTANCEID BIGINT NULL,

       TOOLINDEX TINYINT NOT NULL,

       PRIMARY KEY (

              ACTIVITYINSTANCEID

        ),

        INDEX(PROCESSDEFINITIONID),

       FOREIGN KEY (

              PROCESSDEFINITIONID

        )

       REFERENCES OBEPROCESSDEFINITION(PROCESSDEFINITIONID),

        INDEX(PROCESSINSTANCEID),

       FOREIGN KEY (

              PROCESSINSTANCEID

        )

       REFERENCES OBEPROCESSINSTANCE(PROCESSINSTANCEID),

        INDEX(STATE),

       FOREIGN KEY (

              STATE

        )

       REFERENCES OBEACTIVITYINSTANCESTATE(STATE)

) ;

 

CREATE INDEX OBEACTIVITYDEFINITIONID_IDX ON OBEACTIVITYINSTANCE (

        PROCESSINSTANCEID,

        ACTIVITYDEFINITIONID,

        BLKACTIVITYINSTANCEID

);

 

 

CREATE TABLE obe.OBEWORKITEM (

       WORKITEMID BIGINT NOT NULL,

       NAME VARCHAR(64),

       PARTICIPANT VARCHAR(64) NOT NULL,

       PERFORMER VARCHAR(64) NOT NULL,

       PRIORITY TINYINT NOT NULL,

       STARTEDDATE DATETIME NULL,

       COMPLETEDDATE DATETIME NULL,

       DUEDATE DATETIME NULL,

       TARGETDATE DATETIME NULL,

       STATE TINYINT NOT NULL,

       ACTIVITYINSTANCEID BIGINT NULL,

       PROCESSINSTANCEID BIGINT NULL,

       PROCESSDEFINITIONID VARCHAR(64) NULL,

       TOOLINDEX TINYINT NOT NULL,

       PRIMARY KEY (

              WORKITEMID

        ),

        INDEX(ACTIVITYINSTANCEID),

       FOREIGN KEY (

              ACTIVITYINSTANCEID

        )

       REFERENCES OBEACTIVITYINSTANCE(ACTIVITYINSTANCEID),

        INDEX(PROCESSINSTANCEID),

       FOREIGN KEY (

              PROCESSINSTANCEID

        )

       REFERENCES OBEPROCESSINSTANCE(PROCESSINSTANCEID),

        INDEX(PROCESSDEFINITIONID),

       FOREIGN KEY (

              PROCESSDEFINITIONID

        )

       REFERENCES OBEPROCESSDEFINITION(PROCESSDEFINITIONID),

        INDEX(STATE),

       FOREIGN KEY (

              STATE

        )

       REFERENCES OBEACTIVITYINSTANCESTATE(STATE)

) ;

 

CREATE INDEX ACTIVITYINSTANCEID_IDX ON OBEWORKITEM (

        ACTIVITYINSTANCEID

);

 

 

CREATE TABLE obe.OBEATTRIBUTEINSTANCE (

       OWNERID BIGINT NOT NULL,

       OWNERTYPE TINYINT NOT NULL,

       NAME VARCHAR(64) NOT NULL,

       PROCESSDEFINITIONID VARCHAR(64) NOT NULL,

       PROCESSINSTANCEID BIGINT NULL,

       TYPE TINYINT NOT NULL,

       BOOLVALUE BOOL NULL,

       DATEVALUE DATETIME NULL,

       DBLVALUE FLOAT NULL,

       INTVALUE SMALLINT NULL,

       OBJVALUE LONGBLOB  NULL,

       STRVALUE VARCHAR(254) NULL,

       PRIMARY KEY (

              OWNERID,

              OWNERTYPE,

              NAME

        ),

        INDEX(PROCESSINSTANCEID),

       FOREIGN KEY (

              PROCESSINSTANCEID

        )

       REFERENCES OBEPROCESSINSTANCE(PROCESSINSTANCEID),

        INDEX(OWNERTYPE),

       FOREIGN KEY (

              OWNERTYPE

        )

       REFERENCES OBEATTRIBUTEOWNER(OWNERTYPE),

        INDEX(TYPE),

       FOREIGN KEY (

              TYPE

        )

       REFERENCES OBEATTRIBUTETYPE(TYPE)

) ;

 

 

CREATE TABLE obe.OBEAUDITENTRY (

       AUDITENTRYID BIGINT NOT NULL,

       PROCESSDEFINITIONID VARCHAR(64) ,

       ACTIVITYDEFINITIONID VARCHAR(64) ,

       INITIALPROCESSINSTANCEID BIGINT ,

       CURRENTPROCESSINSTANCEID BIGINT ,

       ACTIVITYINSTANCEID BIGINT ,

       PROCESSSTATE TINYINT ,

       EVENT TINYINT NOT NULL,

       DOMAINID VARCHAR(64) NOT NULL,

       NODEID VARCHAR(64) NOT NULL,

       USERID VARCHAR(64) ,

       ROLEID VARCHAR(64) ,

       AUDITDATE DATETIME NOT NULL,

       AUDITENTRY LONGBLOB  NOT NULL,

       PRIMARY KEY (

              AUDITENTRYID

        ),

        INDEX(EVENT),

       FOREIGN KEY (

              EVENT

        )

       REFERENCES OBEAUDITEVENT(EVENT),

        INDEX(PROCESSSTATE),

       FOREIGN KEY (

              PROCESSSTATE

        )

       REFERENCES OBEPROCESSINSTANCESTATE(STATE)

) ;

 

CREATE INDEX OBEAUDITENTRY_INST_IDX ON OBEAUDITENTRY (

        INITIALPROCESSINSTANCEID,

        ACTIVITYINSTANCEID

);

0 0

相关博文

我的热门文章

img
取 消
img