﻿--------------------------------------------------------
--  DDL for Table CUR_SOFTWARE_OPERATION_MODE
--------------------------------------------------------

  CREATE TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" 
  (	
	  "SOFTWARE_ID" VARCHAR2(7 CHAR), 
	  "START_TIME" TIMESTAMP (6), 
	  "END_TIME" TIMESTAMP (6), 
	  "OPERATION_MODE" NUMBER(1,0), 
	  "PROGRAM_NAME" VARCHAR2(30 CHAR)
  ) 
  SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
  NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;

  COMMENT ON COLUMN "MIRLE"."CUR_SOFTWARE_OPERATION_MODE"."SOFTWARE_ID" IS '軟體編號';
  COMMENT ON COLUMN "MIRLE"."CUR_SOFTWARE_OPERATION_MODE"."START_TIME" IS '起始時間';
  COMMENT ON COLUMN "MIRLE"."CUR_SOFTWARE_OPERATION_MODE"."END_TIME" IS '結束時間';
  COMMENT ON COLUMN "MIRLE"."CUR_SOFTWARE_OPERATION_MODE"."OPERATION_MODE" IS '操作模式';
  COMMENT ON COLUMN "MIRLE"."CUR_SOFTWARE_OPERATION_MODE"."PROGRAM_NAME" IS '程式名稱';

--------------------------------------------------------
--  DDL for Index CUR_SOFTWARE_OPERATION_MODE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."CUR_SOFTWARE_OPERATION_MODE_PK" ON "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" ("SOFTWARE_ID", "START_TIME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" ;

--------------------------------------------------------
--  Constraints for Table CUR_SOFTWARE_OPERATION_MODE
--------------------------------------------------------

  ALTER TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" MODIFY ("SOFTWARE_ID" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" MODIFY ("START_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" MODIFY ("OPERATION_MODE" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" MODIFY ("PROGRAM_NAME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CUR_SOFTWARE_OPERATION_MODE" ADD CONSTRAINT "CUR_SOFTWARE_OPERATION_MODE_PK" PRIMARY KEY ("SOFTWARE_ID", "START_TIME")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM"  ENABLE;
