﻿--------------------------------------------------------
--  DDL for Table CFG_ALARM
--------------------------------------------------------

  CREATE TABLE "MIRLE"."CFG_ALARM" 
  (	
	  "ALARM_CODE" VARCHAR2(10 CHAR), 
	  "ALARM_TYPE" VARCHAR2(3 CHAR), 
	  "ALARM_LEVEL" NUMBER(1,0), 
	  "ALARM_DESC" VARCHAR2(50 CHAR), 
	  "ALARM_CTS" VARCHAR2(255 CHAR), 
	  "CREATE_USER" VARCHAR2(30 CHAR), 
	  "CREATE_TIME" TIMESTAMP (6) DEFAULT systimestamp, 
	  "UPDATE_USER" VARCHAR2(30 CHAR), 
	  "UPDATE_TIME" TIMESTAMP (6) DEFAULT systimestamp, 
	  "STATUS" NUMBER(1,0) DEFAULT 0
  ) 
  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"."CFG_ALARM"."ALARM_CODE" IS '異常代碼';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."ALARM_TYPE" IS '異常類別';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."ALARM_LEVEL" IS '異常等級';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."ALARM_DESC" IS '異常敘述';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."ALARM_CTS" IS '異常對策';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."CREATE_USER" IS '建立人員';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."CREATE_TIME" IS '建立時間';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."UPDATE_USER" IS '更新人員';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."UPDATE_TIME" IS '更新時間';
  COMMENT ON COLUMN "MIRLE"."CFG_ALARM"."STATUS" IS '資料狀態';

--------------------------------------------------------
--  DDL for Index CFG_ALARM_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."CFG_ALARM_PK" ON "MIRLE"."CFG_ALARM" ("ALARM_CODE", "ALARM_TYPE") 
  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 CFG_ALARM
--------------------------------------------------------

  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("ALARM_CODE" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("ALARM_TYPE" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("ALARM_LEVEL" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("ALARM_DESC" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("CREATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("CREATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("UPDATE_USER" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("UPDATE_TIME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" MODIFY ("STATUS" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."CFG_ALARM" ADD CONSTRAINT "CFG_ALARM_PK" PRIMARY KEY ("ALARM_CODE", "ALARM_TYPE")
  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;