__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'CI_UT_INSTL'
/


__ELSE__
CREATE TABLE CI_UT_INSTL
(
  INSTL_LOG_ID    NUMBER(10)                    NOT NULL,
  TARGET_VER_ID   VARCHAR2(20)             DEFAULT ' '                   NOT NULL,
  UPG_COUNT       NUMBER(3)                     DEFAULT 0                     NOT NULL,
  PREV_VER_ID     VARCHAR2(20)             DEFAULT ' '                   NOT NULL,
  START_DTTM      DATE                          NOT NULL,
  END_DTTM        DATE,
  RUN_STATUS_FLG  CHAR(2)                  DEFAULT ' '                   NOT NULL,
  VERSION         NUMBER(5)                     DEFAULT 1                     NOT NULL,
  SR_NO           VARCHAR2(30)             DEFAULT '*'                   NOT NULL,
  OWNER_FLG       CHAR(4)                  DEFAULT ' '                   NOT NULL
)
/
__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'CI_UT_INSTL_DTL'
/

__ELSE__

CREATE TABLE CI_UT_INSTL_DTL
(
  INSTL_LOG_ID      NUMBER(10)                  NOT NULL,
  SEQ_NUM           NUMBER(3)                   NOT NULL,
  SCRIPT_FILE_NAME  VARCHAR2(100)          DEFAULT ' '                   NOT NULL,
  START_DTTM        DATE                        NOT NULL,
  END_DTTM          DATE,
  RUN_STATUS_FLG    CHAR(2)                DEFAULT ' '                   NOT NULL,
  VERSION           NUMBER(5)                   DEFAULT 1                     NOT NULL,
  OWNER_FLG         CHAR(4)                DEFAULT ' '                   NOT NULL
)
/
__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'CI_MD_TBL'
/

__ELSE__

CREATE TABLE CI_MD_TBL
(
  TBL_NAME          CHAR(30)               NOT NULL,
  OWNER_FLG         CHAR(4 )                DEFAULT ' '                   NOT NULL
)
/
__ENDIF__
