MINI MINI MANI MO
rem ffeli 12/12/16 - add modelalg$ table for algorithm registration
rem mmcracke 08/24/12 - proj 47099 partitioned model
rem pstengar 06/30/11 - add attrspec to modelatt$
rem traney 03/21/11 - 35209: long identifiers dictionary upgrade
rem xbarr 01/06/11 - use SYSTEM tablespace (bug10640550)
rem pstengar 05/22/06 - add audit$ column to model$
rem mmcracke 03/14/05 - creation
rem data mining model table
create table model$
(
obj# number not null, /* unique model object id */
func number, /* mining function (bit flags) */
alg number, /* mining algorithm (bit flags) */
bdur number, /* time to build */
msize number, /* size of model (MB) */
version number, /* model version */
audit$ varchar2("S_OPFL") not null, /* auditing options */
pseq# number, /* sequence number for partitions */
pco number, /* partition column count */
properties number /* misc properties for the overall model */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create unique index model$idx
on model$ (obj#)
storage (maxextents unlimited)
tablespace SYSTEM
/
rem data mining model components table
create table modeltab$
(
mod# number not null, /* model object id */
obj# number not null, /* table object id */
typ# number not null, /* model table type */
siz number /* model table size */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create unique index modeltab$idx
on modeltab$ (mod#, typ#)
storage (maxextents unlimited)
tablespace SYSTEM
/
rem data mining model attribute table
create table modelatt$
(
mod# number not null, /* model object id */
name varchar2("M_IDEN") not null, /* attribute name */
atyp number, /* attribute type */
dtyp number not null, /* data type */
length number, /* data length */
precision# number, /* precision */
scale number, /* scale */
properties number, /* properties */
attrspec varchar2(4000) /* attribute spec */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create index modelatt$idx
on modelatt$ (mod#)
storage (maxextents unlimited)
tablespace SYSTEM
/
rem data mining model settings table
create table modelset$
(
mod# number not null, /* model object id */
name varchar2(30) not null, /* setting name */
value varchar2(4000), /* setting value */
properties number /* properties */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create index modelset$idx
on modelset$ (mod#)
storage (maxextents unlimited)
tablespace SYSTEM
/
Rem
Rem Sequence for export/import
create sequence DM$EXPIMP_ID_SEQ
/
grant select on DM$EXPIMP_ID_SEQ to public
/
rem data mining model partition information
rem The content of modelpart$.bhiboundval must remain platform neutral.
rem A model partition key ay be composed of multiple columns, with each
rem column value occupying a separate for in modelpart$ with a different
rem column pos#. The bhiboundval contains the byte array of the data in
rem raw. The only supported partition column datatypes (at present) are
rem Oracle number and char/varchar2, and these are stored in the table
rem in platform-neutral representation.
create table modelpart$
(
mod# number not null, /* model object id */
obj# number not null, /* partition object id */
part# number not null, /* partition number */
pos# number, /* column position number */
bhiboundval blob, /* binary form of high bound */
hiboundlen number, /* length of high bound value */
hiboundval varchar2(4000) /* text of high bound value */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create unique index modelpart$idx
on modelpart$ (mod#, part#, pos#)
storage (maxextents unlimited)
tablespace SYSTEM
/
create index modelpart$idx2
on modelpart$ (mod#, obj#)
storage (maxextents unlimited)
tablespace SYSTEM
/
create table modelpartcol$
(
obj# number not null, /* partition object id */
pos# number not null, /* column position number */
name varchar2("M_IDEN") not null, /* partition column name */
dty number /* partition column data type */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create unique index modelpartcol$idx
on modelpartcol$ (obj#, pos#)
storage (maxextents unlimited)
tablespace SYSTEM
/
create table modelxfm$
(
mod# number not null, /* model object id */
attr varchar2("M_IDEN"), /* attribute name */
subn varchar2(4000), /* attribute subname for nested xform */
properties number, /* properties */
idty number, /* input datatype for rxform */
ibfl number, /* input buffer length for rxform */
dtyp number, /* result datatype */
bufl number, /* result buffer len */
attrspec varchar2(4000), /* attribute spec */
expr clob /* expression */
)
storage (maxextents unlimited)
tablespace SYSTEM
/
create index modelxfm$idx
on modelxfm$ (mod#)
storage (maxextents unlimited)
tablespace SYSTEM
/
create table modelalg$(
owner NUMBER,
name varchar2(128),
num NUMBER not null,
func NUMBER,
type varchar2(20),
mdata clob
CONSTRAINT ensure_json CHECK (mdata IS JSON),
des varchar2(4000))
storage (maxextents unlimited)
tablespace SYSTEM
/
create unique index modelalg$idx
on modelalg$ (num)
storage (maxextents unlimited)
tablespace SYSTEM
/
rem The content of modelgttraw$.CHUNKDATA does not need to be platform
rem neutral since this table is used as an temporary holer within
rem a create/alter mining model DDL operation. At the end of the operation,
rem the table is truncated.
create global temporary table modelgttraw$
(
PARTNUMBER NUMBER,
CONTROLVAL NUMBER,
SLAVENUMBER NUMBER,
ROWNUMBER NUMBER,
CHUNKNUMBER NUMBER,
CHUNKDATA RAW(2000)
)
on commit preserve rows
;
grant select on modelgttraw$ to public;
grant insert on modelgttraw$ to public;
CREATE SEQUENCE modelalg_seq$
START WITH 1000
INCREMENT BY 1
NOCACHE
NOCYCLE;
insert into modelalg$
(owner, name, num, func, type, mdata, des)
values(NULL, NULL, 0, NULL, NULL, NULL, NULL);
commit;
OHA YOOOO