-- ----------------------------
-- Table structure for xxl_job_group
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_group
(
    id           NUMBER(11, 0) NOT NULL,
    app_name     NVARCHAR2(64) NOT NULL,
    title        NVARCHAR2(64) NOT NULL,
    "order"      NUMBER(11, 0) NOT NULL,
    address_type NUMBER(4, 0)  NOT NULL,
    address_list NVARCHAR2(512)
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_group.app_name IS '执行器AppName';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_group.title IS '执行器名称';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_group."order" IS '排序';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_group.address_type IS '执行器地址类型：0=自动注册、1=手动录入';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_group.address_list IS '执行器地址列表，多地址逗号分隔';

-- ----------------------------
-- Records of xxl_job_group
-- ----------------------------
INSERT INTO "XXL_JOB".xxl_job_group (id, app_name, title, "order", address_type, address_list)
VALUES (15, 'phoenix', '新单体执行器', 1, 0, '10.42.1.209:7079');
INSERT INTO "XXL_JOB".xxl_job_group (id, app_name, title, "order", address_type, address_list)
VALUES (17, 'phoenix-posting', '单体过账Posting', 1, 0, '10.42.1.205:7227');

-- ----------------------------
-- Table structure for xxl_job_info
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_info
(
    id                        NUMBER(11, 0)  NOT NULL,
    job_group                 NUMBER(11, 0)  NOT NULL,
    job_cron                  NVARCHAR2(128) NOT NULL,
    job_desc                  NVARCHAR2(255) NOT NULL,
    add_time                  DATE,
    update_time               DATE,
    author                    NVARCHAR2(64),
    alarm_email               NVARCHAR2(255),
    executor_route_strategy   NVARCHAR2(50),
    executor_handler          NVARCHAR2(255),
    executor_param            NVARCHAR2(512),
    executor_block_strategy   NVARCHAR2(50),
    executor_timeout          NUMBER(11, 0)  NOT NULL,
    executor_fail_retry_count NUMBER(11, 0)  NOT NULL,
    glue_type                 NVARCHAR2(50)  NOT NULL,
    glue_source               NCLOB,
    glue_remark               NVARCHAR2(128),
    glue_updatetime           DATE,
    child_jobid               NVARCHAR2(255),
    trigger_status            NUMBER(4, 0)   NOT NULL,
    trigger_last_time         NUMBER(20, 0)  NOT NULL,
    trigger_next_time         NUMBER(20, 0)  NOT NULL
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.job_group IS '执行器主键ID';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.job_cron IS '任务执行CRON';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.author IS '作者';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.alarm_email IS '报警邮件';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_route_strategy IS '执行器路由策略';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_handler IS '执行器任务handler';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_param IS '执行器任务参数';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_block_strategy IS '阻塞处理策略';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_timeout IS '任务执行超时时间，单位秒';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.executor_fail_retry_count IS '失败重试次数';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.glue_type IS 'GLUE类型';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.glue_source IS 'GLUE源代码';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.glue_remark IS 'GLUE备注';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.glue_updatetime IS 'GLUE更新时间';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.child_jobid IS '子任务ID，多个逗号分隔';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.trigger_status IS '调度状态：0-停止，1-运行';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.trigger_last_time IS '上次调度时间';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_info.trigger_next_time IS '下次调度时间';

-- ----------------------------
-- Records of xxl_job_info
-- ----------------------------
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (36,
        15,
        '0 0 18 * * ?',
        '每天更新工位生产日历',
        TO_DATE('2021-12-21 13:28:38', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-01-17 09:26:55', 'yyyy-mm-dd hh24:mi:ss'),
        'qizheng.sun',
        '',
        'FIRST',
        'workstationCalendarJobHandler',
        '',
        'SERIAL_EXECUTION',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2021-12-21 13:28:38', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653559200000,
        1653645600000);
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (40,
        17,
        '0 0/6 * * * ?',
        '聚合工位原始采集数据',
        TO_DATE('2021-12-22 18:35:21', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-01-17 10:07:55', 'yyyy-mm-dd hh24:mi:ss'),
        'POSTING',
        '',
        'FIRST',
        'workStationAggregateJobHandler',
        '',
        'DISCARD_LATER',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2021-12-22 18:35:21', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653566040000,
        1653566400000);
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (41,
        17,
        '0 56 23 * * ?',
        '构建明日生产日历时间切片缓存',
        TO_DATE('2021-12-22 18:36:55', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-01-14 10:37:18', 'yyyy-mm-dd hh24:mi:ss'),
        'POSTING',
        '',
        'FIRST',
        'productionTimeCacheJobHandler',
        '',
        'DISCARD_LATER',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2021-12-22 18:36:55', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653559800000,
        1653646200000);
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (42,
        17,
        '0 30 23 * * ?',
        '构建工位状态明日班次固定点',
        TO_DATE('2021-12-22 18:38:25', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-01-14 10:36:59', 'yyyy-mm-dd hh24:mi:ss'),
        'POSTING',
        '',
        'FIRST',
        'stateFixPointJobHandler',
        '',
        'SERIAL_EXECUTION',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2021-12-22 18:38:25', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653559500000,
        1653645900000);
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (48,
        15,
        '0 56 23 * * ?',
        '生产日历切片缓存',
        TO_DATE('2022-03-23 18:32:50', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-03-23 18:39:03', 'yyyy-mm-dd hh24:mi:ss'),
        'wenchao.long',
        '',
        'FIRST',
        'calendarCacheJobHandler',
        '',
        'SERIAL_EXECUTION',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2022-03-23 18:32:50', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653494160000,
        1653580560000);

INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (49, 15, '0/5 * * * * ?', '同步当前时间全量参数', TO_DATE('2022-07-16 11:06:46', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-07-16 11:06:46', 'yyyy-mm-dd hh24:mi:ss'), 'wenchao.long', '', 'FIRST',
        'allDmpCollectDataJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化',
        TO_DATE('2022-07-16 11:06:46', 'yyyy-mm-dd hh24:mi:ss'), '',
        1, 0, 0);
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (44,
        15,
        '0 0 0 * * ?',
        '保养计划定时任务',
        TO_DATE('2022-03-02 15:07:10', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-03-02 15:07:36', 'yyyy-mm-dd hh24:mi:ss'),
        'jiangxiaodong',
        '',
        'FIRST',
        'maintainPlanJobHandler',
        '',
        'SERIAL_EXECUTION',
        0,
        0,
        'BEAN',
        '',
        'GLUE代码初始化',
        TO_DATE('2022-03-02 15:07:10', 'yyyy-mm-dd hh24:mi:ss'),
        '',
        1,
        1653494400000,
        1653580800000);
INSERT INTO "XXL_JOB"."XXL_JOB_INFO"
VALUES (50, 15, '0 30 8 * * ?', '逾期通知定时任务', TO_DATE('2022-08-26 13:17:03', 'SYYYY-MM-DD HH24:MI:SS'),
        TO_DATE('2022-08-26 15:15:53', 'SYYYY-MM-DD HH24:MI:SS'), 'haolv', NULL, 'FIRST', 'maintain-overdueJobHandler',
        NULL, 'SERIAL_EXECUTION', '0', '0', 'BEAN', NULL, 'GLUE代码初始化',
        TO_DATE('2022-08-26 13:17:03', 'SYYYY-MM-DD HH24:MI:SS'), NULL, '1', '1661585400000', '1661587200000');
INSERT INTO "XXL_JOB"."XXL_JOB_INFO"
VALUES (51, 15, '0 30 8 * * ?', '预警通知定时任务', TO_DATE('2022-08-26 13:18:07', 'SYYYY-MM-DD HH24:MI:SS'),
        TO_DATE('2022-08-26 15:15:50', 'SYYYY-MM-DD HH24:MI:SS'), 'haolv', NULL, 'FIRST',
        'maintenance-warningJobHandler', NULL, 'SERIAL_EXECUTION', '0', '0', 'BEAN', NULL, 'GLUE代码初始化',
        TO_DATE('2022-08-26 13:18:07', 'SYYYY-MM-DD HH24:MI:SS'), NULL, '1', '1661585400000', '1661587200000');
INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (53, 15, '0/2 * * * * ?', 'fms实时数据推送', TO_DATE('2022-08-29 10:13:30', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-08-29 10:13:30', 'yyyy-mm-dd hh24:mi:ss'), 'XXL', '', 'FIRST', 'fmsPushDataJob', '',
        'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', TO_DATE('2022-08-29 10:13:30', 'yyyy-mm-dd hh24:mi:ss'), '',
        1, 1661761462000, 1661761464000);

INSERT INTO "XXL_JOB".xxl_job_info (id,
                                    job_group,
                                    job_cron,
                                    job_desc,
                                    add_time,
                                    update_time,
                                    author,
                                    alarm_email,
                                    executor_route_strategy,
                                    executor_handler,
                                    executor_param,
                                    executor_block_strategy,
                                    executor_timeout,
                                    executor_fail_retry_count,
                                    glue_type,
                                    glue_source,
                                    glue_remark,
                                    glue_updatetime,
                                    child_jobid,
                                    trigger_status,
                                    trigger_last_time,
                                    trigger_next_time)
VALUES (54, 17, '0/10 * * * * ?', '定时扫描状态反馈执行记录', TO_DATE('2022-09-07 17:12:02', 'yyyy-mm-dd hh24:mi:ss'),
        TO_DATE('2022-09-15 13:19:56', 'yyyy-mm-dd hh24:mi:ss'), 'POSTING', '', 'FIRST', 'feedbackAnalyseJobHandler',
        '', 'DISCARD_LATER', 0, 0, 'BEAN', '', 'GLUE代码初始化', TO_DATE('2022-09-07 17:12:02', 'yyyy-mm-dd hh24:mi:ss'), '',
        1, 1663312480000, 1663312490000);
-- ----------------------------
-- Table structure for xxl_job_lock
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_lock
(
    lock_name NVARCHAR2(50) NOT NULL
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_lock.lock_name IS '锁名称';

-- ----------------------------
-- Records of xxl_job_lock
-- ----------------------------
INSERT INTO "XXL_JOB".xxl_job_lock
VALUES ('schedule_lock');

-- ----------------------------
-- Table structure for xxl_job_log
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_log
(
    id                        NUMBER(20, 0) NOT NULL,
    job_group                 NUMBER(11, 0) NOT NULL,
    job_id                    NUMBER(11, 0) NOT NULL,
    executor_address          NVARCHAR2(255),
    executor_handler          NVARCHAR2(255),
    executor_param            NVARCHAR2(512),
    executor_sharding_param   NVARCHAR2(20),
    executor_fail_retry_count NUMBER(11, 0) NOT NULL,
    trigger_time              DATE,
    trigger_code              NUMBER(11, 0) NOT NULL,
    trigger_msg               NCLOB,
    handle_time               DATE,
    handle_code               NUMBER(11, 0) NOT NULL,
    handle_msg                NCLOB,
    alarm_status              NUMBER(4, 0)  NOT NULL
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.job_group IS '执行器主键ID';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.job_id IS '任务，主键ID';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.executor_address IS '执行器地址，本次执行的地址';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.executor_handler IS '执行器任务handler';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.executor_param IS '执行器任务参数';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.executor_sharding_param IS '执行器任务分片参数，格式如 1/2';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.executor_fail_retry_count IS '失败重试次数';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.trigger_time IS '调度-时间';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.trigger_code IS '调度-结果';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.trigger_msg IS '调度-日志';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.handle_time IS '执行-时间';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.handle_code IS '执行-状态';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.handle_msg IS '执行-日志';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log.alarm_status IS '告警状态：0-默认、1-无需告警、2-告警成功、3-告警失败';

-- ----------------------------
-- Records of xxl_job_log
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_log_report
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_log_report
(
    id            NUMBER(11, 0) NOT NULL,
    trigger_day   DATE,
    running_count NUMBER(11, 0) NOT NULL,
    suc_count     NUMBER(11, 0) NOT NULL,
    fail_count    NUMBER(11, 0) NOT NULL
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log_report.trigger_day IS '调度-时间';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log_report.running_count IS '运行中-日志数量';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log_report.suc_count IS '执行成功-日志数量';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_log_report.fail_count IS '执行失败-日志数量';

-- ----------------------------
-- Records of xxl_job_log_report
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_logglue
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_logglue
(
    id          NUMBER(11, 0)  NOT NULL,
    job_id      NUMBER(11, 0)  NOT NULL,
    glue_type   NVARCHAR2(50),
    glue_source NCLOB,
    glue_remark NVARCHAR2(128) NOT NULL,
    add_time    DATE,
    update_time DATE
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_logglue.job_id IS '任务，主键ID';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_logglue.glue_type IS 'GLUE类型';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_logglue.glue_source IS 'GLUE源代码';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_logglue.glue_remark IS 'GLUE备注';

-- ----------------------------
-- Records of xxl_job_logglue
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_registry
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_registry
(
    id             NUMBER(11, 0)  NOT NULL,
    registry_group NVARCHAR2(50)  NOT NULL,
    registry_key   NVARCHAR2(255) NOT NULL,
    registry_value NVARCHAR2(255) NOT NULL,
    update_time    DATE
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Records of xxl_job_registry
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_user
-- ----------------------------

CREATE TABLE "XXL_JOB".xxl_job_user
(
    id         NUMBER(11, 0) NOT NULL,
    username   NVARCHAR2(50) NOT NULL,
    password   NVARCHAR2(50) NOT NULL,
    role       NUMBER(4, 0)  NOT NULL,
    permission NVARCHAR2(255)
) TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    PCTFREE 10
    INITRANS 1
    STORAGE
(
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
)
    PARALLEL 1
    NOCACHE
    DISABLE ROW MOVEMENT
;
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_user.username IS '账号';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_user.password IS '密码';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_user.role IS '角色：0-普通用户、1-管理员';
COMMENT
    ON COLUMN "XXL_JOB".xxl_job_user.permission IS '权限：执行器ID列表，多个逗号分割';


INSERT INTO "XXL_JOB".xxl_job_user
VALUES ('1', 'admin', 'e10adc3949ba59abbe56e057f20f883e', '1', NULL);



ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020572" PRIMARY KEY (id);


ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020534" CHECK (id IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020535" CHECK (app_name IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020536" CHECK (title IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020537" CHECK ("order" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "XXL_JOB".xxl_job_group
    ADD CONSTRAINT "SYS_C0020538" CHECK (address_type IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;



ALTER TABLE "XXL_JOB".xxl_job_info
    ADD CONSTRAINT "SYS_C0020573" PRIMARY KEY (id);



-- ----------------------------
-- Primary Key structure for table xxl_job_lock
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_lock
    ADD CONSTRAINT "SYS_C0020574" PRIMARY KEY (lock_name);



-- ----------------------------
-- Primary Key structure for table xxl_job_log
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_log
    ADD CONSTRAINT "SYS_C0020575" PRIMARY KEY (id);


-- ----------------------------
-- Indexes structure for table xxl_job_log
-- ----------------------------
CREATE INDEX I_handle_code
    ON "XXL_JOB".xxl_job_log (handle_code ASC) LOGGING
    TABLESPACE USERS
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );
CREATE INDEX I_trigger_time
    ON "XXL_JOB".xxl_job_log (trigger_time ASC) LOGGING
    TABLESPACE USERS
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );

-- ----------------------------
-- Primary Key structure for table xxl_job_log_report
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_log_report
    ADD CONSTRAINT "SYS_C0020576" PRIMARY KEY (id);


-- ----------------------------
-- Indexes structure for table xxl_job_log_report
-- ----------------------------
CREATE UNIQUE INDEX i_trigger_day
    ON "XXL_JOB".xxl_job_log_report (trigger_day ASC) LOGGING
    TABLESPACE USERS
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );

-- ----------------------------
-- Primary Key structure for table xxl_job_logglue
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_logglue
    ADD CONSTRAINT "SYS_C0020577" PRIMARY KEY (id);


-- ----------------------------
-- Primary Key structure for table xxl_job_registry
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_registry
    ADD CONSTRAINT "SYS_C0020578" PRIMARY KEY (id);


-- ----------------------------
-- Indexes structure for table xxl_job_registry
-- ----------------------------
CREATE INDEX i_g_k_v
    ON "XXL_JOB".xxl_job_registry (registry_group ASC, registry_key ASC, registry_value ASC) LOGGING
    TABLESPACE USERS
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    BUFFER_POOL DEFAULT
    );

-- ----------------------------
-- Primary Key structure for table xxl_job_user
-- ----------------------------
ALTER TABLE "XXL_JOB".xxl_job_user
    ADD CONSTRAINT "SYS_C0020579" PRIMARY KEY (id);


-- ----------------------------
-- Indexes structure for table xxl_job_user
-- ----------------------------
CREATE UNIQUE INDEX i_username
    ON "XXL_JOB".xxl_job_user (username ASC) LOGGING
    TABLESPACE USERS
    VISIBLE
    PCTFREE 10
    INITRANS 2
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    );

-- 创建自增序列
-- Create sequence
create sequence "XXL_JOB".XXL_JOB_GROUP_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_INFO_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_LOG_GLUE_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_LOG_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_REGISTRY_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_USER_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- Create sequence
create sequence "XXL_JOB".XXL_JOB_REPORT_ID_SEQ
    minvalue 100
    maxvalue 999999999999
    start with 100
    increment by 1 cache 20
    cycle;

-- 定时清除dmp日志任务
INSERT INTO "XXL_JOB"."XXL_JOB_INFO" (
    "ID",
    "JOB_GROUP",
    "JOB_CRON",
    "JOB_DESC",
    "ADD_TIME",
    "UPDATE_TIME",
    "AUTHOR",
    "ALARM_EMAIL",
    "EXECUTOR_ROUTE_STRATEGY",
    "EXECUTOR_HANDLER",
    "EXECUTOR_PARAM",
    "EXECUTOR_BLOCK_STRATEGY",
    "EXECUTOR_TIMEOUT",
    "EXECUTOR_FAIL_RETRY_COUNT",
    "GLUE_TYPE",
    "GLUE_SOURCE",
    "GLUE_REMARK",
    "GLUE_UPDATETIME",
    "CHILD_JOBID",
    "TRIGGER_STATUS",
    "TRIGGER_LAST_TIME",
    "TRIGGER_NEXT_TIME"
)
VALUES
(
    '12',
    '15',
    '0 0 2 L 3/3 ? ',
    'DMP日志定期清除任务',
    TO_DATE( '2022-10-11 19:45:11', 'SYYYY-MM-DD HH24:MI:SS' ),
    TO_DATE( '2022-10-11 19:45:47', 'SYYYY-MM-DD HH24:MI:SS' ),
    'wangshaofei',
    NULL,
    'FIRST',
    'dmpLogRegularCleanJobHandler',
    '3',
    'SERIAL_EXECUTION',
    '0',
    '0',
    'BEAN',
    NULL,
    'GLUE代码初始化',
    TO_DATE( '2022-10-11 19:45:11', 'SYYYY-MM-DD HH24:MI:SS' ),
    NULL,
    '0',
    '0',
    '0'
);
