--¼ÇÂ¼ÈÕÖ¾
create table UR_BA_OPER_TYPE  (
   OPER_TYPE            VARCHAR2(60)                     not null,
   L_CODE               VARCHAR2(30),
   OPER_NAME            VARCHAR2(120),
   IS_LOG               VARCHAR2(1)                    default '0',
   IS_LOG_CONT          VARCHAR2(1)                    default '0',
   IS_PROHIBIT          VARCHAR2(1)                    default '0',
   CAN_LOG_CONT         VARCHAR2(1)                    default '0',
   CAN_FORCE_STOP       VARCHAR2(1)                    default '0',
   CAN_FORCE_ROLLBACK   VARCHAR2(1)                    default '0',
   constraint PK_UR_BA_OPER_TYPE primary key (OPER_TYPE)
);

create table UR_SYS_LOG  (
   LOG_ID               VARCHAR2(36)                     not null,
   USER_ID              VARCHAR2(36),
   USER_NAME            VARCHAR2(120),
   DW_ID                VARCHAR2(36),
   DW_NAME              VARCHAR2(120),
   CLIENT_ADDR          VARCHAR2(30),
   HOST_ADDR            VARCHAR2(30),
   LOG_S_TIME           VARCHAR2(24),
   LOG_E_TIME           VARCHAR2(24),
   OPER_TYPE            VARCHAR2(60),
   MARK                 VARCHAR2(4000),
   IS_DETAIL            VARCHAR2(60)                   default '0',
   LOG_STATUS           VARCHAR2(1)                    default '0',
   FORCE_USER_ID        VARCHAR2(36),
   FORCE_TIME           VARCHAR2(24),
   FORCE_REASON         VARCHAR2(1000),
   LOG_RESULT           VARCHAR2(2000),
   constraint PK_UR_SYS_LOG primary key (LOG_ID)
);

create index IDX_UR_SYS_LOG_TYPE on UR_SYS_LOG (
   LOG_S_TIME ASC,
   OPER_TYPE ASC,
   LOG_STATUS ASC
);

create index IDX_UR_SYS_LOG_USER on UR_SYS_LOG (
   LOG_S_TIME ASC,
   USER_ID ASC,
   LOG_STATUS ASC
);


create table UR_SYS_LOG_D  (
   LOG_ID               VARCHAR2(36)                     not null,
   SEQ_NO               INTEGER                          not null,
   LOG_S_TIME           VARCHAR2(20),
   LOG_E_TIME           VARCHAR2(20),
   OPER_TYPE            VARCHAR2(60),
   TASK_ID              VARCHAR2(36),
   PERD_CODE            VARCHAR2(30),
   DW_ID                VARCHAR2(36),
   TRUNC_ID             VARCHAR2(36),
   PROJ_ID              VARCHAR2(36),
   RPT_ID               VARCHAR2(36),
   MARK                 VARCHAR2(4000),
   LOG_RESULT           VARCHAR2(2000),
   constraint PK_UR_SYS_LOG_D primary key (LOG_ID, SEQ_NO)
);
