create table UR_TASK_DW_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                     not null,
   VER_ID               VARCHAR2(36)                   default '*',
   RPT_STATUS           VARCHAR2(1)                    default '0',
   CUR_DW_ID            VARCHAR2(36),
   CUR_MAN_DW_ID        VARCHAR2(36),
   DATA_STATUS          VARCHAR2(1)                    default 'N',
   CHK_STATUS           VARCHAR2(1)                    default '0',
   RATION_CHK_STATUS    VARCHAR2(1)                    default '0',
   L_DO_USER_ID         VARCHAR2(36),
   L_DO_DATE            VARCHAR2(10),
   RPT_USER_ID          VARCHAR2(36),
   RPT_DATE             VARCHAR2(10),
   RPT_DW_ID            VARCHAR2(36),
   L_ADT_USER_ID        VARCHAR2(36),
   L_ADT_DATE           VARCHAR2(10),
   L_ADT_NODE           VARCHAR2(10),
   CUR_ADT_NODE         VARCHAR2(10),
   LOG_NO               INTEGER                        default 0,
   TRANS_DW_LOG_NO      INTEGER                        default 0,
   IS_RETURN            VARCHAR2(1)                    default '0',
   constraint PK_UR_TASK_DW_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID)
);


create index IDX_UR_TASK_DW_DW_B on UR_TASK_DW_B (
   DW_ID ASC
);


create table UR_TASK_DW_IMP_LOG  (
   IMP_ID               VARCHAR2(36)                     not null,
   IMP_FILE_NAME        VARCHAR2(255),
   IMP_TIME_S           VARCHAR2(20),
   IMP_TIME_E           VARCHAR2(20),
   USER_ID              VARCHAR2(36),
   constraint PK_UR_TASK_DW_IMP_LOG primary key (IMP_ID)
);

create table UR_TASK_DW_IMP_LOG_DE  (
   IMP_ID               VARCHAR2(36)                     not null,
   S_BAK_ID             VARCHAR2(36)                   default '*'  not null,
   DW_ID                VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   RPT_ID               VARCHAR2(36)                     not null,
   constraint PK_UR_TASK_DW_IMP_LOG_DE primary key (IMP_ID, DW_ID, PERD_CODE, S_BAK_ID, TRUNC_ID, TASK_ID, RPT_ID)
);

create index IDX_UR_TASK_DW_IMP_LOG_DE_DW on UR_TASK_DW_IMP_LOG_DE (
   IMP_ID ASC,
   TASK_ID ASC,
   PERD_CODE ASC,
   TRUNC_ID ASC,
   S_BAK_ID ASC,
   DW_ID ASC
);

create index IDX_UR_TASK_DW_IMP_LOG_DE_RPT on UR_TASK_DW_IMP_LOG_DE (
   IMP_ID ASC,
   TASK_ID ASC,
   PERD_CODE ASC,
   TRUNC_ID ASC,
   S_BAK_ID ASC,
   RPT_ID ASC
);


create table UR_TASK_DW_MARK_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                     not null,
   SEQ_NO               INTEGER                        default 0  not null,
   FILE_ID              VARCHAR2(36),
   RPT_MARK             VARCHAR2(1000),
   constraint PK_UR_TASK_DW_MARK_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID, SEQ_NO)
);


create index IDX_UR_TASK_DW_MARK_DW_B on UR_TASK_DW_MARK_B (
   DW_ID ASC
);

create table UR_TASK_DW_RPT_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                   default '*'  not null,
   RPT_ID               VARCHAR2(36)                     not null,
   RPT_USER_ID          VARCHAR2(36),
   RPT_DATE             VARCHAR2(10),
   DATA_STATUS          VARCHAR2(1)                    default 'N',
   CHK_STATUS           VARCHAR2(1)                    default '0',
   RATION_CHK_STATUS    VARCHAR2(1)                    default '0',
   CHK_USER_ID          VARCHAR2(36),
   CHK_DATE             VARCHAR2(10),
   UPD_USER_ID          VARCHAR2(36),
   UPD_TIME             VARCHAR2(20),
   constraint PK_UR_TASK_DW_RPT_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID, RPT_ID)
);


create index IDX_UR_TASK_DW_RPT_DW_B on UR_TASK_DW_RPT_B (
   DW_ID ASC
);

create table UR_TASK_DW_RPT_CHK_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                   default '*'  not null,
   RPT_ID               VARCHAR2(36)                     not null,
   F_ID                 VARCHAR2(36)                     not null,
   S_DATA_ID            VARCHAR2(36)                     not null,
   VER_ID               VARCHAR2(36)                   default '*',
   SEQ_NO               INTEGER                          not null,
   CHK_STATUS           VARCHAR2(1)                    default '1',
   F_RESULT             VARCHAR2(4000),
   F_LEFT_VAL           VARCHAR2(255),
   F_RIGHT_VAL          VARCHAR2(255),
   F_DIFF_VAL           VARCHAR2(255),
   IS_CTRL              VARCHAR2(1)                    default '0',
   constraint PK_UR_TASK_DW_RPT_CHK_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID, RPT_ID, F_ID, S_DATA_ID, SEQ_NO)
);


create index IDX_UR_TASK_DW_RPT_CHK_B on UR_TASK_DW_RPT_CHK_B (
   DW_ID ASC
);


create table UR_TASK_DW_RPT_CHK_REASON_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                   default '*'  not null,
   RPT_ID               VARCHAR2(36)                     not null,
   F_ID                 VARCHAR2(36)                     not null,
   S_DATA_ID            VARCHAR2(36)                     not null,
   SEQ_NO               INTEGER                          not null,
   CHK_USER_ID          VARCHAR2(36),
   CHK_DATE             VARCHAR2(10),
   REASON               VARCHAR2(4000),
   constraint PK_UR_TASK_RPT_CHK_REASON_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID, RPT_ID, F_ID, S_DATA_ID, SEQ_NO)
);


create index IDX_UR_TASK_RPT_CHK_REASON_B on UR_TASK_DW_RPT_CHK_REASON_B (
   DW_ID ASC
);


create table UR_TASK_LOG_B  (
   IMP_ID               VARCHAR2(36)                     not null,
   TASK_ID              VARCHAR2(36)                     not null,
   PERD_CODE            VARCHAR2(30)                     not null,
   DW_ID                VARCHAR2(36)                     not null,
   TRUNC_ID             VARCHAR2(36)                     not null,
   PROJ_ID              VARCHAR2(36)                     not null,
   LOG_NO               INTEGER                        default 0  not null,
   TRANS_DW_LOG_NO      INTEGER                        default 0,
   ADT_DW_ID            VARCHAR2(36),
   ADT_USER_ID          VARCHAR2(36),
   ADT_DATE             VARCHAR2(20),
   UPD_TYPE             VARCHAR2(1),
   ADT_OPINION          VARCHAR2(1000),
   BEF_ADT_NODE         VARCHAR2(10),
   ADT_NODE             VARCHAR2(10),
   AFT_ADT_NODE         VARCHAR2(10),
   IS_RETURN            VARCHAR2(1)                    default '0',
   constraint PK_UR_TASK_LOG_B primary key (IMP_ID, TASK_ID, PERD_CODE, DW_ID, TRUNC_ID, PROJ_ID, LOG_NO)
);

alter table UR_RPT_CELL  add INPUT_LIMIT varchar2(2);