﻿--------------------------------------------------------
--  DDL for Table HIS_COMMUNICATION_LOG
--------------------------------------------------------

  CREATE TABLE "MIRLE"."HIS_COMMUNICATION_LOG" 
  (	
	  "TIMETICK" TIMESTAMP (6), 
	  "HOST" VARCHAR2(7 CHAR), 
	  "CLIENT" VARCHAR2(7 CHAR), 
	  "MESSAGE_ID" VARCHAR2(10 BYTE)
	  "MESSAGE_CONTENT" CLOB, 
	  "STATUS" 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" 
  LOB ("MESSAGE_CONTENT") STORE AS BASICFILE (
  TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE 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)) ;

  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."TIMETICK" IS '時間戳記';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."HOST" IS '服務端';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."CLIENT" IS '客戶端';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."MESSAGE_ID" IS '訊息編號';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."MESSAGE_CONTENT" IS '訊息內容';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."STATUS" IS '傳送狀態';
  COMMENT ON COLUMN "MIRLE"."HIS_COMMUNICATION_LOG"."PROGRAM_NAME" IS '程式名稱';

--------------------------------------------------------
--  DDL for Index HIS_COMMUNICATION_LOG_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "MIRLE"."HIS_COMMUNICATION_LOG_PK" ON "MIRLE"."HIS_COMMUNICATION_LOG" ("TIMETICK", "HOST", "CLIENT") 
  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 HIS_COMMUNICATION_LOG
--------------------------------------------------------

  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" MODIFY ("TIMETICK" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" MODIFY ("HOST" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" MODIFY ("CLIENT" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" MODIFY ("STATUS" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" MODIFY ("PROGRAM_NAME" NOT NULL ENABLE);
  ALTER TABLE "MIRLE"."HIS_COMMUNICATION_LOG" ADD CONSTRAINT "HIS_COMMUNICATION_LOG_PK" PRIMARY KEY ("TIMETICK", "HOST", "CLIENT")
  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;