CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE CACHED TABLE HISTORY(HISTORYID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,SESSIONID BIGINT NOT NULL,HISTTYPE INTEGER DEFAULT 1,STATUSCODE INTEGER DEFAULT 0,TIMESENTMILLIS BIGINT DEFAULT 0,TIMEELAPSEDMILLIS INTEGER DEFAULT 0,METHOD VARCHAR DEFAULT '',URI VARCHAR DEFAULT '',REQHEADER VARCHAR DEFAULT '',REQBODY VARCHAR DEFAULT '',RESHEADER VARCHAR DEFAULT '',RESBODY VARCHAR DEFAULT '',TAG VARCHAR DEFAULT '')
CREATE INDEX HISTORY_INDEX ON HISTORY(URI,METHOD,REQBODY,SESSIONID,HISTTYPE,HISTORYID,STATUSCODE)
CREATE CACHED TABLE SESSION(SESSIONID BIGINT NOT NULL PRIMARY KEY,SESSIONNAME VARCHAR DEFAULT '',LASTACCESS TIMESTAMP DEFAULT NOW NOT NULL)
CREATE CACHED TABLE ALERT(ALERTID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,SCANID INTEGER NOT NULL,PLUGINID INTEGER DEFAULT 0,ALERT VARCHAR DEFAULT '',RISK INTEGER DEFAULT 0,RELIABILITY INTEGER DEFAULT 1,DESCRIPTION VARCHAR DEFAULT '',URI VARCHAR DEFAULT '',PARAM VARCHAR DEFAULT '',OTHERINFO VARCHAR DEFAULT '',SOLUTION VARCHAR DEFAULT '',REFERENCE VARCHAR DEFAULT '',HISTORYID INTEGER)
CREATE CACHED TABLE SCAN(SCANID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,SESSIONID BIGINT NOT NULL,SCANNAME VARCHAR DEFAULT '',SCANTIME TIMESTAMP DEFAULT NOW NOT NULL)
CREATE CACHED TABLE DUMMY(DUMMYID INTEGER NOT NULL)
SET TABLE DUMMY INDEX'32 0'
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 20
