kettle-scheduler.sql 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. SET FOREIGN_KEY_CHECKS=0;
  2. -- ----------------------------
  3. -- Table structure for `k_category`
  4. -- ----------------------------
  5. DROP TABLE IF EXISTS `k_category`;
  6. CREATE TABLE `k_category` (
  7. `category_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分类ID',
  8. `category_name` varchar(50) DEFAULT NULL COMMENT '分类名称',
  9. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  10. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  11. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  12. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  13. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  14. PRIMARY KEY (`category_id`)
  15. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  16. -- ----------------------------
  17. -- Table structure for `k_job`
  18. -- ----------------------------
  19. DROP TABLE IF EXISTS `k_job`;
  20. CREATE TABLE `k_job` (
  21. `job_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '作业ID',
  22. `category_id` int(11) DEFAULT NULL,
  23. `job_name` varchar(50) DEFAULT NULL COMMENT '作业名称',
  24. `job_description` varchar(500) DEFAULT NULL COMMENT '任务描述',
  25. `job_type` int(11) DEFAULT NULL COMMENT '1:数据库资源库;2:上传的文件',
  26. `job_path` varchar(200) DEFAULT NULL COMMENT '作业保存路径(可以是资源库中的路径也可以是服务器中保存作业文件的路径)',
  27. `job_repository_id` int(11) DEFAULT NULL COMMENT '作业的资源库ID',
  28. `job_quartz` int(11) DEFAULT '1' COMMENT '定时策略(外键ID)',
  29. `job_record` int(11) DEFAULT NULL COMMENT '作业执行记录(外键ID)',
  30. `job_log_level` varchar(10) DEFAULT NULL COMMENT '日志级别(basic,detail,error,debug,minimal,rowlevel)',
  31. `job_status` int(11) DEFAULT NULL COMMENT '状态(1:正在运行;2:已停止)',
  32. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  33. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  34. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  35. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  36. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  37. PRIMARY KEY (`job_id`)
  38. ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
  39. -- ----------------------------
  40. -- Table structure for `k_job_monitor`
  41. -- ----------------------------
  42. DROP TABLE IF EXISTS `k_job_monitor`;
  43. CREATE TABLE `k_job_monitor` (
  44. `monitor_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '监控作业ID',
  45. `monitor_job` int(11) DEFAULT NULL COMMENT '监控的作业ID',
  46. `monitor_success` int(11) DEFAULT NULL COMMENT '成功次数',
  47. `monitor_fail` int(11) DEFAULT NULL COMMENT '失败次数',
  48. `add_user` int(11) DEFAULT NULL COMMENT '添加人',
  49. `monitor_status` int(11) DEFAULT NULL COMMENT '监控状态(是否启动,1:启动;2:停止)',
  50. `run_status` text COMMENT '运行状态(起始时间-结束时间,起始时间-结束时间……)',
  51. `last_execute_time` datetime DEFAULT NULL,
  52. `next_execute_time` datetime DEFAULT NULL,
  53. PRIMARY KEY (`monitor_id`)
  54. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
  55. -- ----------------------------
  56. -- Table structure for `k_job_record`
  57. -- ----------------------------
  58. DROP TABLE IF EXISTS `k_job_record`;
  59. CREATE TABLE `k_job_record` (
  60. `record_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '作业记录ID',
  61. `record_job` int(11) DEFAULT NULL COMMENT '作业ID',
  62. `start_time` datetime DEFAULT NULL COMMENT '启动时间',
  63. `stop_time` datetime DEFAULT NULL COMMENT '停止时间',
  64. `record_status` int(11) DEFAULT NULL COMMENT '任务执行结果(1:成功;2:失败)',
  65. `log_file_path` varchar(100) DEFAULT NULL COMMENT '作业日志记录文件保存位置',
  66. `add_user` int(11) DEFAULT NULL COMMENT '添加人',
  67. PRIMARY KEY (`record_id`)
  68. ) ENGINE=InnoDB AUTO_INCREMENT=390 DEFAULT CHARSET=utf8;
  69. -- ----------------------------
  70. -- Table structure for `k_quartz`
  71. -- ----------------------------
  72. DROP TABLE IF EXISTS `k_quartz`;
  73. CREATE TABLE `k_quartz` (
  74. `quartz_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
  75. `quartz_description` varchar(500) DEFAULT NULL COMMENT '任务描述',
  76. `quartz_cron` varchar(100) DEFAULT NULL COMMENT '定时策略',
  77. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  78. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  79. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  80. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  81. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  82. PRIMARY KEY (`quartz_id`)
  83. ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
  84. -- ----------------------------
  85. -- Records of k_quartz
  86. -- ----------------------------
  87. INSERT INTO `k_quartz` VALUES ('1', '立即执行一次', null, '2017-05-27 14:44:13', '1', '2017-05-27 14:44:13', null, '1');
  88. INSERT INTO `k_quartz` VALUES ('2', '每周一0点执行一次', '0 0 0 ? * 2', '2017-05-27 14:56:38', '1', '2017-05-27 14:56:38', null, '1');
  89. INSERT INTO `k_quartz` VALUES ('3', '每月1日0点执行一次', '0 0 0 1 * ?', '2017-05-27 14:56:38', '1', '2017-05-27 14:56:38', null, '1');
  90. INSERT INTO `k_quartz` VALUES ('4', '每日0点执行一次', '0 0 0 * * ?', '2017-05-27 14:44:13', '1', '2017-05-27 14:44:15', null, '1');
  91. INSERT INTO `k_quartz` VALUES ('31', '每分钟执行一次', '0 * * * * ?', '2018-10-16 14:12:44', '6', '2018-10-16 14:12:44', '6', '1');
  92. -- ----------------------------
  93. -- Table structure for `k_repository`
  94. -- ----------------------------
  95. DROP TABLE IF EXISTS `k_repository`;
  96. CREATE TABLE `k_repository` (
  97. `repository_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  98. `repository_name` varchar(50) DEFAULT NULL COMMENT '资源库名称',
  99. `repository_username` varchar(50) DEFAULT NULL COMMENT '登录用户名',
  100. `repository_password` varchar(50) DEFAULT NULL COMMENT '登录密码',
  101. `repository_type` varchar(10) DEFAULT NULL COMMENT '资源库数据库类型(MYSQL、ORACLE)',
  102. `database_access` varchar(10) DEFAULT NULL COMMENT '资源库数据库访问模式("Native", "ODBC", "OCI", "Plugin", "JNDI")',
  103. `database_host` varchar(50) DEFAULT NULL COMMENT '资源库数据库主机名或者IP地址',
  104. `database_port` varchar(10) DEFAULT NULL COMMENT '资源库数据库端口号',
  105. `database_name` varchar(20) DEFAULT NULL COMMENT '资源库数据库名称',
  106. `database_username` varchar(50) DEFAULT NULL COMMENT '数据库登录账号',
  107. `database_password` varchar(50) DEFAULT NULL COMMENT '数据库登录密码',
  108. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  109. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  110. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  111. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  112. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  113. PRIMARY KEY (`repository_id`)
  114. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  115. -- ----------------------------
  116. -- Table structure for `k_repository_type`
  117. -- ----------------------------
  118. DROP TABLE IF EXISTS `k_repository_type`;
  119. CREATE TABLE `k_repository_type` (
  120. `repository_type_id` int(11) NOT NULL,
  121. `repository_type_code` varchar(30) DEFAULT NULL,
  122. `repository_type_des` varchar(100) DEFAULT NULL,
  123. PRIMARY KEY (`repository_type_id`)
  124. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  125. -- ----------------------------
  126. -- Records of k_repository_type
  127. -- ----------------------------
  128. INSERT INTO `k_repository_type` VALUES ('1', 'INGRES', 'Ingres');
  129. INSERT INTO `k_repository_type` VALUES ('2', 'INTERBASE', 'Borland Interbase');
  130. INSERT INTO `k_repository_type` VALUES ('3', 'INFOBRIGHT', 'Infobright');
  131. INSERT INTO `k_repository_type` VALUES ('4', 'ORACLE', 'Oracle');
  132. INSERT INTO `k_repository_type` VALUES ('5', 'EXTENDB', 'ExtenDB');
  133. INSERT INTO `k_repository_type` VALUES ('6', 'MSACCESS', 'MS Access');
  134. INSERT INTO `k_repository_type` VALUES ('7', 'SYBASE', 'Sybase');
  135. INSERT INTO `k_repository_type` VALUES ('8', 'PALO', 'Palo MOLAP Server');
  136. INSERT INTO `k_repository_type` VALUES ('9', 'INFORMIX', 'Informix');
  137. INSERT INTO `k_repository_type` VALUES ('10', 'LucidDB', 'LucidDB');
  138. INSERT INTO `k_repository_type` VALUES ('11', 'TERADATA', 'Teradata');
  139. INSERT INTO `k_repository_type` VALUES ('12', 'UNIVERSE', 'UniVerse database');
  140. INSERT INTO `k_repository_type` VALUES ('13', 'MONETDB', 'MonetDB');
  141. INSERT INTO `k_repository_type` VALUES ('14', 'CACHE', 'Intersystems Cache');
  142. INSERT INTO `k_repository_type` VALUES ('15', 'MSSQL', 'MS SQL Server');
  143. INSERT INTO `k_repository_type` VALUES ('16', 'KettleThin', 'Pentaho Data Services');
  144. INSERT INTO `k_repository_type` VALUES ('17', 'GREENPLUM', 'Greenplum');
  145. INSERT INTO `k_repository_type` VALUES ('18', 'GENERIC', 'Generic database');
  146. INSERT INTO `k_repository_type` VALUES ('19', 'IMPALA', 'Impala');
  147. INSERT INTO `k_repository_type` VALUES ('20', 'SQLITE', 'SQLite');
  148. INSERT INTO `k_repository_type` VALUES ('21', 'REMEDY-AR-SYSTEM', 'Remedy Action Request System');
  149. INSERT INTO `k_repository_type` VALUES ('22', 'MONDRIAN', 'Native Mondrian');
  150. INSERT INTO `k_repository_type` VALUES ('23', 'HIVE2', 'Hadoop Hive 2');
  151. INSERT INTO `k_repository_type` VALUES ('24', 'NETEZZA', 'Netezza');
  152. INSERT INTO `k_repository_type` VALUES ('25', 'VERTICA5', 'Vertica 5+');
  153. INSERT INTO `k_repository_type` VALUES ('26', 'POSTGRESQL', 'PostgreSQL');
  154. INSERT INTO `k_repository_type` VALUES ('27', 'EXASOL4', 'Exasol 4');
  155. INSERT INTO `k_repository_type` VALUES ('28', 'HYPERSONIC', 'Hypersonic');
  156. INSERT INTO `k_repository_type` VALUES ('29', 'AS/400', 'AS/400');
  157. INSERT INTO `k_repository_type` VALUES ('30', 'ORACLERDB', 'Oracle RDB');
  158. INSERT INTO `k_repository_type` VALUES ('31', 'DBASE', 'dBase III, IV or 5');
  159. INSERT INTO `k_repository_type` VALUES ('32', 'IMPALASIMBA', 'Cloudera Impala');
  160. INSERT INTO `k_repository_type` VALUES ('33', 'KINGBASEES', 'KingbaseES');
  161. INSERT INTO `k_repository_type` VALUES ('34', 'SAPR3', 'SAP ERP System');
  162. INSERT INTO `k_repository_type` VALUES ('35', 'SQLBASE', 'Gupta SQL Base');
  163. INSERT INTO `k_repository_type` VALUES ('36', 'DERBY', 'Apache Derby');
  164. INSERT INTO `k_repository_type` VALUES ('37', 'VERTICA', 'Vertica');
  165. INSERT INTO `k_repository_type` VALUES ('38', 'INFINIDB', 'Calpont InfiniDB');
  166. INSERT INTO `k_repository_type` VALUES ('39', 'HIVE', 'Hadoop Hive');
  167. INSERT INTO `k_repository_type` VALUES ('40', 'MYSQL', 'MySQL');
  168. INSERT INTO `k_repository_type` VALUES ('41', 'MSSQLNATIVE', 'MS SQL Server (Native)');
  169. INSERT INTO `k_repository_type` VALUES ('42', 'H2', 'H2');
  170. INSERT INTO `k_repository_type` VALUES ('43', 'SAPDB', 'MaxDB (SAP DB)');
  171. INSERT INTO `k_repository_type` VALUES ('44', 'SPARKSIMBA', 'SparkSQL');
  172. INSERT INTO `k_repository_type` VALUES ('45', 'VECTORWISE', 'Ingres VectorWise');
  173. INSERT INTO `k_repository_type` VALUES ('46', 'DB2', 'IBM DB2');
  174. INSERT INTO `k_repository_type` VALUES ('47', 'NEOVIEW', 'Neoview');
  175. INSERT INTO `k_repository_type` VALUES ('48', 'SYBASEIQ', 'SybaseIQ');
  176. INSERT INTO `k_repository_type` VALUES ('49', 'REDSHIFT', 'Redshift');
  177. INSERT INTO `k_repository_type` VALUES ('50', 'FIREBIRD', 'Firebird SQL');
  178. INSERT INTO `k_repository_type` VALUES ('51', 'OpenERPDatabaseMeta', 'OpenERP Server');
  179. -- ----------------------------
  180. -- Table structure for `k_trans`
  181. -- ----------------------------
  182. DROP TABLE IF EXISTS `k_trans`;
  183. CREATE TABLE `k_trans` (
  184. `trans_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '转换ID',
  185. `category_id` int(11) DEFAULT NULL,
  186. `trans_name` varchar(50) DEFAULT NULL COMMENT '转换名称',
  187. `trans_description` varchar(500) DEFAULT NULL COMMENT '转换描述',
  188. `trans_type` int(11) DEFAULT NULL COMMENT '1:数据库资源库;2:上传的文件',
  189. `trans_path` varchar(200) DEFAULT NULL COMMENT '转换保存路径(可以是资源库中的路径也可以是服务器中保存作业文件的路径)',
  190. `trans_repository_id` int(11) DEFAULT NULL COMMENT '转换的资源库ID',
  191. `trans_quartz` int(11) DEFAULT '1' COMMENT '定时策略(外键ID)',
  192. `trans_record` int(11) DEFAULT NULL COMMENT '转换执行记录(外键ID)',
  193. `trans_log_level` varchar(10) DEFAULT NULL COMMENT '日志级别(basic,detail,error,debug,minimal,rowlevel)',
  194. `trans_status` int(11) DEFAULT NULL COMMENT '状态(1:正在运行;2:已停止)',
  195. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  196. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  197. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  198. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  199. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  200. PRIMARY KEY (`trans_id`)
  201. ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
  202. -- ----------------------------
  203. -- Table structure for `k_trans_monitor`
  204. -- ----------------------------
  205. DROP TABLE IF EXISTS `k_trans_monitor`;
  206. CREATE TABLE `k_trans_monitor` (
  207. `monitor_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '监控转换ID',
  208. `monitor_trans` int(11) DEFAULT NULL COMMENT '监控的转换的ID',
  209. `monitor_success` int(11) DEFAULT NULL COMMENT '成功次数',
  210. `monitor_fail` int(11) DEFAULT NULL COMMENT '失败次数',
  211. `add_user` int(11) DEFAULT NULL COMMENT '添加人',
  212. `monitor_status` int(11) DEFAULT NULL COMMENT '监控状态(是否启动,1:启动;2:停止)',
  213. `run_status` text COMMENT '运行状态(起始时间-结束时间,起始时间-结束时间……)',
  214. `last_execute_time` datetime DEFAULT NULL,
  215. `next_execute_time` datetime DEFAULT NULL,
  216. PRIMARY KEY (`monitor_id`)
  217. ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
  218. -- ----------------------------
  219. -- Table structure for `k_trans_record`
  220. -- ----------------------------
  221. DROP TABLE IF EXISTS `k_trans_record`;
  222. CREATE TABLE `k_trans_record` (
  223. `record_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '转换记录ID',
  224. `record_trans` int(11) DEFAULT NULL COMMENT '转换ID',
  225. `start_time` datetime DEFAULT NULL COMMENT '启动时间',
  226. `stop_time` datetime DEFAULT NULL COMMENT '停止时间',
  227. `record_status` int(11) DEFAULT NULL COMMENT '任务执行结果(1:成功;2:失败)',
  228. `log_file_path` varchar(100) DEFAULT NULL COMMENT '转换日志记录文件保存位置',
  229. `add_user` int(11) DEFAULT NULL COMMENT '添加人',
  230. PRIMARY KEY (`record_id`)
  231. ) ENGINE=InnoDB AUTO_INCREMENT=546 DEFAULT CHARSET=utf8;
  232. -- ----------------------------
  233. -- Table structure for `k_user`
  234. -- ----------------------------
  235. DROP TABLE IF EXISTS `k_user`;
  236. CREATE TABLE `k_user` (
  237. `u_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  238. `u_nickname` varchar(50) DEFAULT NULL COMMENT '用户昵称',
  239. `u_email` varchar(30) DEFAULT NULL COMMENT '用户邮箱',
  240. `u_phone` varchar(50) DEFAULT NULL COMMENT '用于电话',
  241. `u_account` varchar(50) DEFAULT NULL COMMENT '用户账号',
  242. `u_password` varchar(50) DEFAULT NULL COMMENT '用户密码',
  243. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  244. `add_user` int(11) DEFAULT NULL COMMENT '添加者',
  245. `edit_time` datetime DEFAULT NULL COMMENT '编辑时间',
  246. `edit_user` int(11) DEFAULT NULL COMMENT '编辑者',
  247. `del_flag` int(11) DEFAULT NULL COMMENT '是否删除(1:存在;0:删除)',
  248. PRIMARY KEY (`u_id`)
  249. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
  250. -- ----------------------------
  251. -- Records of k_user
  252. -- ----------------------------
  253. INSERT INTO `k_user` VALUES ('1', 'admin', null, null, 'admin', 'b1276925a59fd8d9e1a53c10637f271d', null, null, null, null, '1');