鼎鼎知识库
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2020云端场景数据库.md 6.9KB

4 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. - 创建定时任务数据库quartznet
  2. ```
  3. 数据库名:ddquartz
  4. 字符集:utf8mb4--UTF-8 Unicode
  5. 排序规则:utf8mbs_general_ci
  6. ```
  7. 执行sql语句
  8. ```
  9. # By: Ron Cordell - roncordell
  10. # I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM.
  11. # make sure you have UTF-8 collaction for best .NET interoperability
  12. # CREATE DATABASE quartznet CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  13. DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
  14. DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
  15. DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
  16. DROP TABLE IF EXISTS QRTZ_LOCKS;
  17. DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
  18. DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
  19. DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
  20. DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
  21. DROP TABLE IF EXISTS QRTZ_TRIGGERS;
  22. DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
  23. DROP TABLE IF EXISTS QRTZ_CALENDARS;
  24. CREATE TABLE QRTZ_JOB_DETAILS(
  25. SCHED_NAME VARCHAR(60) NOT NULL,
  26. JOB_NAME VARCHAR(60) NOT NULL,
  27. JOB_GROUP VARCHAR(60) NOT NULL,
  28. DESCRIPTION VARCHAR(250) NULL,
  29. JOB_CLASS_NAME VARCHAR(250) NOT NULL,
  30. IS_DURABLE BOOLEAN NOT NULL,
  31. IS_NONCONCURRENT BOOLEAN NOT NULL,
  32. IS_UPDATE_DATA BOOLEAN NOT NULL,
  33. REQUESTS_RECOVERY BOOLEAN NOT NULL,
  34. JOB_DATA BLOB NULL,
  35. PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
  36. ENGINE=InnoDB;
  37. CREATE TABLE QRTZ_TRIGGERS (
  38. SCHED_NAME VARCHAR(60) NOT NULL,
  39. TRIGGER_NAME VARCHAR(60) NOT NULL,
  40. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  41. JOB_NAME VARCHAR(60) NOT NULL,
  42. JOB_GROUP VARCHAR(60) NOT NULL,
  43. DESCRIPTION VARCHAR(250) NULL,
  44. NEXT_FIRE_TIME BIGINT(19) NULL,
  45. PREV_FIRE_TIME BIGINT(19) NULL,
  46. PRIORITY INTEGER NULL,
  47. TRIGGER_STATE VARCHAR(16) NOT NULL,
  48. TRIGGER_TYPE VARCHAR(8) NOT NULL,
  49. START_TIME BIGINT(19) NOT NULL,
  50. END_TIME BIGINT(19) NULL,
  51. CALENDAR_NAME VARCHAR(60) NULL,
  52. MISFIRE_INSTR SMALLINT(2) NULL,
  53. JOB_DATA BLOB NULL,
  54. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  55. FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
  56. REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
  57. ENGINE=InnoDB;
  58. CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
  59. SCHED_NAME VARCHAR(60) NOT NULL,
  60. TRIGGER_NAME VARCHAR(60) NOT NULL,
  61. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  62. REPEAT_COUNT BIGINT(7) NOT NULL,
  63. REPEAT_INTERVAL BIGINT(12) NOT NULL,
  64. TIMES_TRIGGERED BIGINT(10) NOT NULL,
  65. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  66. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  67. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  68. ENGINE=InnoDB;
  69. CREATE TABLE QRTZ_CRON_TRIGGERS (
  70. SCHED_NAME VARCHAR(60) NOT NULL,
  71. TRIGGER_NAME VARCHAR(60) NOT NULL,
  72. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  73. CRON_EXPRESSION VARCHAR(120) NOT NULL,
  74. TIME_ZONE_ID VARCHAR(80),
  75. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  76. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  77. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  78. ENGINE=InnoDB;
  79. CREATE TABLE QRTZ_SIMPROP_TRIGGERS
  80. (
  81. SCHED_NAME VARCHAR(60) NOT NULL,
  82. TRIGGER_NAME VARCHAR(60) NOT NULL,
  83. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  84. STR_PROP_1 VARCHAR(512) NULL,
  85. STR_PROP_2 VARCHAR(512) NULL,
  86. STR_PROP_3 VARCHAR(512) NULL,
  87. INT_PROP_1 INT NULL,
  88. INT_PROP_2 INT NULL,
  89. LONG_PROP_1 BIGINT NULL,
  90. LONG_PROP_2 BIGINT NULL,
  91. DEC_PROP_1 NUMERIC(13,4) NULL,
  92. DEC_PROP_2 NUMERIC(13,4) NULL,
  93. BOOL_PROP_1 BOOLEAN NULL,
  94. BOOL_PROP_2 BOOLEAN NULL,
  95. TIME_ZONE_ID VARCHAR(80) NULL,
  96. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  97. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  98. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  99. ENGINE=InnoDB;
  100. CREATE TABLE QRTZ_BLOB_TRIGGERS (
  101. SCHED_NAME VARCHAR(60) NOT NULL,
  102. TRIGGER_NAME VARCHAR(60) NOT NULL,
  103. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  104. BLOB_DATA BLOB NULL,
  105. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  106. INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
  107. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  108. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  109. ENGINE=InnoDB;
  110. CREATE TABLE QRTZ_CALENDARS (
  111. SCHED_NAME VARCHAR(60) NOT NULL,
  112. CALENDAR_NAME VARCHAR(60) NOT NULL,
  113. CALENDAR BLOB NOT NULL,
  114. PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
  115. ENGINE=InnoDB;
  116. CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
  117. SCHED_NAME VARCHAR(60) NOT NULL,
  118. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  119. PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
  120. ENGINE=InnoDB;
  121. CREATE TABLE QRTZ_FIRED_TRIGGERS (
  122. SCHED_NAME VARCHAR(60) NOT NULL,
  123. ENTRY_ID VARCHAR(140) NOT NULL,
  124. TRIGGER_NAME VARCHAR(60) NOT NULL,
  125. TRIGGER_GROUP VARCHAR(60) NOT NULL,
  126. INSTANCE_NAME VARCHAR(60) NOT NULL,
  127. FIRED_TIME BIGINT(19) NOT NULL,
  128. SCHED_TIME BIGINT(19) NOT NULL,
  129. PRIORITY INTEGER NOT NULL,
  130. STATE VARCHAR(16) NOT NULL,
  131. JOB_NAME VARCHAR(60) NULL,
  132. JOB_GROUP VARCHAR(60) NULL,
  133. IS_NONCONCURRENT BOOLEAN NULL,
  134. REQUESTS_RECOVERY BOOLEAN NULL,
  135. PRIMARY KEY (SCHED_NAME,ENTRY_ID))
  136. ENGINE=InnoDB;
  137. CREATE TABLE QRTZ_SCHEDULER_STATE (
  138. SCHED_NAME VARCHAR(60) NOT NULL,
  139. INSTANCE_NAME VARCHAR(60) NOT NULL,
  140. LAST_CHECKIN_TIME BIGINT(19) NOT NULL,
  141. CHECKIN_INTERVAL BIGINT(19) NOT NULL,
  142. PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
  143. ENGINE=InnoDB;
  144. CREATE TABLE QRTZ_LOCKS (
  145. SCHED_NAME VARCHAR(60) NOT NULL,
  146. LOCK_NAME VARCHAR(40) NOT NULL,
  147. PRIMARY KEY (SCHED_NAME,LOCK_NAME))
  148. ENGINE=InnoDB;
  149. CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
  150. CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
  151. CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  152. CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
  153. CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
  154. CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  155. CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
  156. CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  157. CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  158. CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
  159. CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
  160. CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
  161. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
  162. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
  163. CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
  164. CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
  165. CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  166. CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
  167. CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  168. CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  169. commit;
  170. ```