--------------------------------------------------------
-- Tabele ROAAUTO versiunea 1.4.151		      --
-- Created by marius.atanasiu on 2/2/2006, 9:42:17 AM --
--------------------------------------------------------

spool tabele.log

prompt
prompt Creating table DEV_NOM_FURNIZORIMASINI
prompt ======================================
prompt
create table DEV_NOM_FURNIZORIMASINI
(
  ID_FURNIZOR NUMBER(5) not null,
  DENUMIRE    VARCHAR2(50),
  STERS       NUMBER(1) default 0 not null,
  INACTIV     NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_FURNIZORIMASINI
  add constraint PK_FURNIZOR primary key (ID_FURNIZOR)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_NOM_MARCI
prompt ============================
prompt
create table DEV_NOM_MARCI
(
  ID_MARCA NUMBER(5) not null,
  MARCA    VARCHAR2(24),
  STERS    NUMBER(1) default 0 not null,
  INACTIV  NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_MARCI
  add constraint PK_MARCA primary key (ID_MARCA)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_NOM_MASINI
prompt =============================
prompt
create table DEV_NOM_MASINI
(
  ID_MASINA NUMBER(5) not null,
  ID_MARCA  NUMBER(5) not null,
  MASINA    VARCHAR2(20),
  SCTIP     VARCHAR2(100),
  CLASA     VARCHAR2(10),
  STERS     NUMBER(1) default 0 not null,
  INACTIV   NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_MASINI
  add constraint PK_MASINA primary key (ID_MASINA)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_MASINI
  add constraint FK_MARCA foreign key (ID_MARCA)
  references DEV_NOM_MARCI (ID_MARCA);

prompt
prompt Creating table DEV_TIPURI_MOTOARE
prompt =================================
prompt
create table DEV_TIPURI_MOTOARE
(
  ID_TIPMOTOR NUMBER(5) not null,
  DENUMIRE    VARCHAR2(50),
  STERS       NUMBER(1) default 0 not null,
  INACTIV     NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_TIPURI_MOTOARE
  add constraint PK_TIPMOTOR primary key (ID_TIPMOTOR)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_MASINICLIENTI
prompt ================================
prompt
create table DEV_MASINICLIENTI
(
  ID_MASINICLIENT NUMBER(8) default 0 not null,
  ID_TIPMOTOR     NUMBER(5),
  ID_FURNIZOR     NUMBER(5),
  ID_MASINA       NUMBER(5),
  ID_PARTENER     NUMBER(5) default 0 not null,
  NRINMAT         VARCHAR2(10),
  SERIES          VARCHAR2(17),
  SERIEM          VARCHAR2(17),
  CULOARE         VARCHAR2(30),
  KMINT           NUMBER(10),
  DATAACHI        DATE,
  NRACHI          NUMBER(16),
  SERIEF          VARCHAR2(20),
  SERIECV         VARCHAR2(20),
  ANFABRICATIE    NUMBER(4),
  STERS           NUMBER(1) default 0 not null,
  INACTIV         NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_MASINICLIENTI
  add constraint PK_MASINICLIENT primary key (ID_MASINICLIENT)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_MASINICLIENTI
  add constraint FK_FURNIZOR foreign key (ID_FURNIZOR)
  references DEV_NOM_FURNIZORIMASINI (ID_FURNIZOR)
  disable;
alter table DEV_MASINICLIENTI
  add constraint FK_ID_PARTENER foreign key (ID_PARTENER)
  references NOM_PARTENERI (ID_PART)
  disable;
alter table DEV_MASINICLIENTI
  add constraint FK_MASINA foreign key (ID_MASINA)
  references DEV_NOM_MASINI (ID_MASINA)
  disable;
alter table DEV_MASINICLIENTI
  add constraint FK_TIPMOTOR foreign key (ID_TIPMOTOR)
  references DEV_TIPURI_MOTOARE (ID_TIPMOTOR)
  disable;
create index IDX_MASINICLIENT_00001 on DEV_MASINICLIENTI (ID_PARTENER)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
create index IDX_MASINICLIENT_00002 on DEV_MASINICLIENTI (ID_MASINA)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
create index IDX_MASINICLIENT_00003 on DEV_MASINICLIENTI (ID_FURNIZOR)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
create index IDX_MASINICLIENT_00004 on DEV_MASINICLIENTI (ID_TIPMOTOR)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_MECANICI
prompt ===========================
prompt
create table DEV_MECANICI
(
  ID_MECANIC  NUMBER(5) not null,
  ID_SALARIAT NUMBER(5),
  ID_SECTIE   NUMBER(5),
  STERS       NUMBER(1) default 0 not null,
  INACTIV     NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_MECANICI
  add constraint PK_MECANICI primary key (ID_MECANIC)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_NOM_ANSAMBLE
prompt ===============================
prompt
create table DEV_NOM_ANSAMBLE
(
  ID_ANSAMBLU NUMBER(5) not null,
  DENUMIRE    VARCHAR2(100),
  STERS       NUMBER(1) default 0 not null,
  INACTIV     NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_ANSAMBLE
  add constraint PK_ANSAMBLE primary key (ID_ANSAMBLU)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_NOM_ASIGURATORI
prompt ==================================
prompt
create table DEV_NOM_ASIGURATORI
(
  ID_ASIGURATOR NUMBER(5) not null,
  ASIGURATOR    VARCHAR2(24),
  STERS         NUMBER(1) default 0 not null,
  INACTIV       NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_ASIGURATORI
  add constraint PK_ASIGURATORI primary key (ID_ASIGURATOR)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_NOM_DELEGATI
prompt ===============================
prompt
create table DEV_NOM_DELEGATI
(
  ID_NOM_DELEGATI NUMBER(5) not null,
  DELEGAT         VARCHAR2(64),
  ELIBERATDE      VARCHAR2(64),
  ID_PARTENER     NUMBER(5) not null,
  STERS           NUMBER(1) default 0 not null,
  INACTIV         NUMBER(1) default 0 not null,
  BI              VARCHAR2(10)
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_DELEGATI
  add constraint PK_DELEGAT primary key (ID_NOM_DELEGATI)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_DELEGATI
  add constraint FK_PARTENER foreign key (ID_PARTENER)
  references NOM_PARTENERI (ID_PART)
  disable;

prompt
prompt Creating table DEV_NOM_INSPECTORI
prompt =================================
prompt
create table DEV_NOM_INSPECTORI
(
  ID_INSPECTOR  NUMBER(5) not null,
  INSPECTOR     VARCHAR2(24),
  ID_ASIGURATOR NUMBER(5),
  STERS         NUMBER(1) default 0 not null,
  INACTIV       NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_INSPECTORI
  add constraint PK_NOM_INSPECTORI primary key (ID_INSPECTOR)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_INSPECTORI
  add constraint FK_NOM_ASIGURATORI foreign key (ID_ASIGURATOR)
  references DEV_NOM_ASIGURATORI (ID_ASIGURATOR);

prompt
prompt Creating table DEV_NOM_NORME
prompt ============================
prompt
create table DEV_NOM_NORME
(
  ID_NORME    NUMBER(5) not null,
  ID_ANSAMBLU NUMBER(5),
  ID_MASINA   NUMBER(5),
  DENOP       VARCHAR2(100),
  CODOP       VARCHAR2(10),
  TIMPN       NUMBER(7,3),
  STERS       NUMBER(1) default 0 not null,
  INACTIV     NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_NORME
  add constraint PK_NORME primary key (ID_NORME)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_NORME
  add constraint FK_ANSAMBLE foreign key (ID_ANSAMBLU)
  references DEV_NOM_ANSAMBLE (ID_ANSAMBLU);

prompt
prompt Creating table DEV_NOM_PRETURI
prompt ==============================
prompt
create table DEV_NOM_PRETURI
(
  ID_PRET        NUMBER(5) not null,
  ID_MARCA       NUMBER(5),
  ID_ASIGURATORI NUMBER(5),
  PRET           NUMBER(18,4),
  PRET_VAL       NUMBER(10,4),
  ID_VALUTA      NUMBER(5),
  CURS           NUMBER(12,4),
  STERS          NUMBER(1) default 0 not null,
  INACTIV        NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_PRETURI
  add constraint PK_PRETURI primary key (ID_PRET)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_PRETURI
  add constraint FK_ASIGURATOR foreign key (ID_ASIGURATORI)
  references DEV_NOM_ASIGURATORI (ID_ASIGURATOR);
alter table DEV_NOM_PRETURI
  add constraint FK_MARCA1 foreign key (ID_MARCA)
  references DEV_NOM_MARCI (ID_MARCA);

prompt
prompt Creating table DEV_NOM_RESP
prompt ===========================
prompt
create table DEV_NOM_RESP
(
  ID_RESP NUMBER(5) not null,
  NUME    VARCHAR2(24) not null,
  BI      VARCHAR2(10),
  CNPRESP VARCHAR2(13),
  ALES    NUMBER(1) default 0 not null,
  STERS   NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_NOM_RESP
  add constraint PK_RESP primary key (ID_RESP)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_ORDL
prompt =======================
prompt
create table DEV_ORDL
(
  ID_ORDL         NUMBER(10) not null,
  LUNA            NUMBER(2) default 0 not null,
  AN              NUMBER(4) default 0 not null,
  ID_INSPECTOR    NUMBER(5) default 0 not null,
  ID_LUCRARE      NUMBER(10) not null,
  TERMEN          DATE,
  DATAI           DATE,
  ORAI            NUMBER(5),
  DATAE           DATE,
  ORAE            NUMBER(5),
  VALIDAT         NUMBER(1) default 0 not null,
  TIP_INCAS       VARCHAR2(24),
  ID_UTIL_AD      NUMBER(5) default 0 not null,
  ID_UTIL_VALID   NUMBER(5) default 0 not null,
  DATAORAAD       DATE,
  DATAORAVALID    DATE,
  ID_UTILS        NUMBER(5) default 0 not null,
  DATAORAS        DATE,
  ID_FACT         NUMBER(10) default 0 not null,
  ID_MASINICLIENT NUMBER(5) default 0 not null,
  ID_ASIGURATOR   NUMBER(5) default 0 not null,
  ID_CONTRACT     NUMBER(5) default 0 not null,
  AVANS           NUMBER(17,4),
  STERS           NUMBER(1) default 0 not null,
  VALCTVA         NUMBER(17,4) default 0 not null,
  ID_TIP          NUMBER(5) default 1 not null,
  INCHIS_FORTAT   NUMBER(1) default 0 not null,
  KMINT           NUMBER(10)
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_ORDL
  add constraint PK_ORDL primary key (ID_ORDL)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_ORDL
  add constraint FK_LUCR foreign key (ID_LUCRARE)
  references NOM_LUCRARI (ID_LUCRARE)
  disable;
create index IDX_ORDL_00001 on DEV_ORDL (ID_LUCRARE)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
create index IDX_ORDL_00002 on DEV_ORDL (ID_INSPECTOR)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
create index IDX_ORDL_00003 on DEV_ORDL (DATAORAVALID)
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_OPER
prompt =======================
prompt
create table DEV_OPER
(
  ID_OPER      NUMBER(10) not null,
  ID_ORDL      NUMBER(10) not null,
  ID_NORME     NUMBER(10) not null,
  ID_FACT      NUMBER(10),
  TIMPN        NUMBER(8,3) default 0 not null,
  PRET         NUMBER(17,4) default 0 not null,
  DATAI        DATE default sysdate not null,
  ID_SECTIE    NUMBER(5),
  ID_UTIL      NUMBER(5),
  DATAORA      DATE,
  ID_UTILS     NUMBER(5),
  DATAORAS     DATE,
  STERS        NUMBER(1) default 0 not null,
  VALIDAT      NUMBER(1) default 0 not null,
  NOU          NUMBER(1) default 0 not null,
  ID_UTILI     NUMBER(5),
  DATAI_ORIG   DATE,
  DATAORA_ORIG DATE
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_OPER
  add constraint PK_OPER primary key (ID_OPER)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_OPER
  add constraint FK_NORME foreign key (ID_NORME)
  references DEV_NOM_NORME (ID_NORME);
alter table DEV_OPER
  add constraint FK_ORDL foreign key (ID_ORDL)
  references DEV_ORDL (ID_ORDL);

prompt
prompt Creating table DEV_OPER_MECANICI
prompt ================================
prompt
create table DEV_OPER_MECANICI
(
  ID_OPERMECANIC NUMBER(10) not null,
  ID_MECANIC     NUMBER(5),
  ID_OPER        NUMBER(10),
  ORE            NUMBER(8,3),
  STERS          NUMBER(1) default 0 not null,
  INACTIV        NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_OPER_MECANICI
  add constraint PK_DEV_OPER_MECANICI primary key (ID_OPERMECANIC)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

prompt
prompt Creating table DEV_TIP_DEVIZ
prompt ============================
prompt
create table DEV_TIP_DEVIZ
(
  ID_TIP   NUMBER(5) not null,
  DENUMIRE VARCHAR2(50) not null,
  STERS    NUMBER(1) default 0 not null
)
tablespace ROA
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table DEV_TIP_DEVIZ
  add constraint PK_TIP_DEVIZ primary key (ID_TIP)
  using index 
  tablespace ROA
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );


spool off
