--------------------------------------------------------
--  DDL for Table SRC_OCI_COST_AND_USAGE_TB
--------------------------------------------------------
CREATE TABLE "OTHQ_OWN"."SRC_OCI_COST_AND_USAGE_TB"
(
  "AVAILABILITYZONE"     VARCHAR2(32 BYTE),
  "BILLINGACCOUNTID"     VARCHAR2(128 BYTE),
  "BILLINGPERIODEND"     DATE,
  "BILLINGPERIODSTART"   DATE,
  "CHARGEDESCRIPTION"    VARCHAR2(128 BYTE),
  "CHARGEPERIODEND"      DATE,
  "CHARGEPERIODSTART"    DATE,
  "EFFECTIVECOST"        NUMBER,
  "LISTCOST"             NUMBER,
  "LISTUNITPRICE"        NUMBER,
  "PRICINGQUANTITY"      NUMBER,
  "PRICINGUNIT"          VARCHAR2(64 BYTE),
  "REGIONID"             VARCHAR2(16 BYTE),
  "REGIONNAME"           VARCHAR2(64 BYTE),
  "RESOURCEID"           VARCHAR2(256 BYTE),
  "RESOURCETYPE"         VARCHAR2(32 BYTE),
  "SERVICECATEGORY"      VARCHAR2(32 BYTE),
  "SERVICENAME"          VARCHAR2(64 BYTE),
  "SKUID"                VARCHAR2(16 BYTE),
  "SUBACCOUNTID"         VARCHAR2(128 BYTE),
  "SUBACCOUNTNAME"       VARCHAR2(16 BYTE),
  "TAGS"                 VARCHAR2(2048 BYTE),
  "CONSUMEDQUANTITY"     NUMBER,
  "CONSUMEDUNIT"         VARCHAR2(64 BYTE),
  "X_REFERENCENUMBER"  VARCHAR2(64 BYTE),
  "X_COMPARTMENTID"    VARCHAR2(128 BYTE),
  "X_COMPARTMENTNAME"  VARCHAR2(64 BYTE),
  "X_ATTRIBUTEDUSAGE"  NUMBER,
  "X_ATTRIBUTEDCOST"   NUMBER,
  "ID"                   VARCHAR2(64 BYTE)
) 
DEFAULT COLLATION "USING_NLS_COMP" SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255
COLUMN STORE COMPRESS FOR QUERY HIGH ROW LEVEL LOCKING 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 "DATA"
PARTITION BY RANGE ("CHARGEPERIODSTART")
INTERVAL (NUMTODSINTERVAL(1, 'DAY'))
(
  PARTITION p_base VALUES LESS THAN (DATE '2025-01-01')
);
--------------------------------------------------------
--  DDL for Index SRC_OCI_COST_AND_USAGE_TB
--------------------------------------------------------

  CREATE UNIQUE INDEX "OTHQ_OWN"."SRC_OCI_COST_AND_USAGE_TB" ON "OTHQ_OWN"."SRC_OCI_COST_AND_USAGE_TB" ("ID") 
  PCTFREE 10 INITRANS 20 MAXTRANS 255 COMPUTE STATISTICS 
  TABLESPACE "DATA" ;
--------------------------------------------------------
--  Constraints for Table RC_OCI_COST_AND_USAGE_TB
--------------------------------------------------------

  ALTER TABLE "OTHQ_OWN"."SRC_OCI_COST_AND_USAGE_TB" MODIFY ("ID" NOT NULL ENABLE);
  ALTER TABLE "OTHQ_OWN"."SRC_OCI_COST_AND_USAGE_TB" ADD CONSTRAINT "SRC_OCI_COST_AND_USAGE_TB" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 40 INITRANS 20 MAXTRANS 255 COMPUTE STATISTICS 
  TABLESPACE "DATA"  ENABLE;