在哪里可以找到SQL来在我的数据库中创建Spring Batch框架所需的所有元数据结构。应用程序没有数据库的权限来超越它们。
正如文档中所建议的,我尝试使用org.springframework.batch.core
repository中提供的sql,但它似乎不完整。例如,它遗漏了BATCH_JOB_EXECUTION .JOB_CONFIGURATION_LOCATION VARCHAR(2500)
列,而这个列在文档片段中
我知道这个结构是最新的版本4.1,但是(migration script)[https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle.sql]似乎不正确,因为它假设列已经在那里了:
ALTER TABLE BATCH_JOB_EXECUTION MODIFY JOB_CONFIGURATION_LOCATION VARCHAR2(2500 char);
字符串
我在哪里可以找到创建框架版本4.3.6所需结构的完整oracle sql脚本?
2条答案
按热度按时间pzfprimi1#
如果查看https://github.com/spring-projects/spring-batch/blob/4.3.x/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-oracle10g.sql,可以看到BATCH_JOB_EXECUTION.JOB_CONFIGURATION_LOCATION列。因此,您可以从类路径使用/org/springframework/batch/core/schema-oracle 10 g. sql,因为它包含在spring-batch-core-4.3.6.jar中。
vfh0ocws2#
--自动生成:不编辑此文件
CREATE TABLE BATCH_JOB_INSTANCE(JOB_INSTANCE_ID号(19,0)NOT NULL PRIMARY KEY,Version号(19,0),JOB_NAME VARCHAR2(100 char)NOT NULL,JOB_KEY VARCHAR2(32 char)NOT NULL,约束JOB_INST_UN unique(JOB_NAME,JOB_KEY))SEGMENT CREATION IMMEDIATE;
创建表BATCH_JOB_EXECUTION(JOB_EXECUTION_ID号(19,0)NOT NULL主键,版本号(19,0),JOB_INSTANCE_ID编号(19,0)NOT NULL,CREATE_TIME TIMESTAMP(9)NOT NULL,START_TIME时间戳(9)DEFAULT NULL,END_TIME TIMESTAMP(9)DEFAULT NULL,STATUS VARCHAR2(10 char),EXIT_CODE VARCHAR2(2500 char),EXIT_MESSAGE VARCHAR2(2500 char),LAST_UPDATED TIMESTAMP(9),约束JOB_INST_EXEC_FK外键(JOB_INSTANCE_ID)引用BATCH_JOB_INSTANCE(JOB_INSTANCE_ID))SEGMENT CREATION IMMEDIATE;
CREATE TABLE BATCH_JOB_EXECUTION_PARAMS(JOB_EXECUTION_ID号(19,0)NOT NULL,PARAMETER_NAME VARCHAR(100 char)NOT NULL,PARAMETER_TYPE VARCHAR(100 char)NOT NULL,PARAMETER_VALUE VARCHAR(2500 char),IDENTIFYING CHAR(1)NOT NULL,约束JOB_EXECUTION_ID)引用BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)SEGMENT CREATION IMMEDIATE;
创建表BATCH_STEP_EXECUTION(STEP_EXECUTION_ID NUMBER(19,0)NOT NULL主键,版本号(19,0)NOT NULL,STEP_NAME VARCHAR2(100个字符)NOT NULL,JOB_EXECUTION_ID编号(19,0)NOT NULL,CREATE_TIME TIMESTAMP(9)NOT NULL,START_TIME时间戳(9)DEFAULT NULL,END_TIME TIMESTAMP(9)DEFAULT NULL,STATUS VARCHAR2(10 char),COMMIT_COUNT编号(19,0),READ_COUNT编号(19,0),FILTER_COUNT编号(19,0),WRITE_COUNT编号(19,0),READ_SKIP_COUNT编号(19,0),WRITE_SKIP_COUNT编号(19,0),PROCESS_SKIP_COUNT编号(19,0),ROLLBACK_COUNT编号(19,0),EXIT_CODE VARCHAR2(2500 char),EXIT_MESSAGE VARCHAR2(2500 char),LAST_UPDATED TIMESTAMP(9),约束JOB_EXEC_STEP_FK外键(JOB_EXECUTION_ID)引用BATCH_JOB_EXECUTION(JOB_EXECUTION_ID))SEGMENT CREATION IMMEDIATE;
CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT(STEP_EXECUTION_ID NUMBER(19,0)NOT NULL PRIMARY KEY,SHORT_CONTEXT VARCHAR2(2500 char)NOT NULL,SERIALIZED_CONTEXT CLOB,constraint STEP_EXEC_CTX_FK foreign key(STEP_EXECUTION_ID)references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID))SEGMENT CREATION IMMEDIATE;
CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT(JOB_EXECUTION_ID NUMBER(19,0)NOT NULL PRIMARY KEY,SHORT_CONTEXT VARCHAR2(2500 char)NOT NULL,SERIALIZED_CONTEXT CLOB,constraint JOB_EXEC_CTX_FK foreign key(JOB_EXECUTION_ID)references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID))SEGMENT CREATION IMMEDIATE;
CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 ORDER NOCYCLE;创建序列BATCH_JOB_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 ORDER NOCYCLE; CREATE SEQUENCE BATCH_JOB_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 ORDER NOCYCLE;