CREATE TABLE ERRORLOG (
ERROR_ID NUMBER(20) NOT NULL,
TIMESTAMP DATE DEFAULT SYSDATE NOT NULL,
ORA_ERRNO NUMBER(10) NOT NULL,
ORA_ERRMSG VARCHAR2(255) NOT NULL,
SCHEMA_NAME VARCHAR2(30) NOT NULL,
MODULE_NAME VARCHAR2(80) NOT NULL,
NOTES VARCHAR2(4000),
CONSTRAINT PK_ERRORLOG PRIMARY KEY(ERROR_ID) USING INDEX TABLESPACE INDEXES
);
create index timestamp_idx on errorlog(timestamp) tablespace indexes;

grant select on errorlog to public;

CREATE TABLE ERRORLOG_VALUES (
ERROR_ID NUMBER(20) NOT NULL,
ELEMENT_OWNER VARCHAR2(30) NOT NULL,
ELEMENT_NAME VARCHAR2(30) NOT NULL,
ELEMENT_TYPE VARCHAR2(30) NOT NULL,
ELEMENT_VALUE VARCHAR2(4000) NOT NULL,
CONSTRAINT FK_ERRORLOG FOREIGN KEY(ERROR_ID) REFERENCES ERRORLOG(ERROR_ID)
);

create index fk_errorlog_values_idx on errorlog_values(error_id) tablespace indexes;

grant select on errorlog_values to public;

CREATE SEQUENCE SEQ_ERRORLOG INCREMENT BY 1 START
WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE
CACHE 20 NOORDER;

update version_number set version_number=149, min_version_number=149;
