{"id":18255,"date":"2026-07-06T16:59:52","date_gmt":"2026-07-06T08:59:52","guid":{"rendered":"https:\/\/kbwp.transwarp.cn\/?p=18255"},"modified":"2026-07-06T16:59:52","modified_gmt":"2026-07-06T08:59:52","slug":"3-x-tdt%e6%89%a7%e8%a1%8c%e8%ae%b0%e5%bd%95%e6%95%b0%e6%8d%ae%e6%b8%85%e7%90%86","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=18255","title":{"rendered":"3.X TDT\u6267\u884c\u8bb0\u5f55\u6570\u636e\u6e05\u7406"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>1\u3001TDT\u4e00\u76f4\u6ca1\u6709\u81ea\u52a8\u6e05\u7406\u6267\u884c\u8bb0\u5f55\u7684\u903b\u8f91\uff0c\u5bfc\u81f4\u6267\u884c\u8bb0\u5f55\u4f1a\u4e00\u76f4\u7d2f\u52a0\u3002<\/p>\n<p>2\u3001\u7279\u522b\u662f\u7248\u672c\u5347\u7ea7\u65f6\uff0c\u5bf9\u6570\u636e\u5e93\u505a\u5907\u4efd\uff0c\u6216\u8005\u4ee3\u7801\u4e2d\u6709\u5bf9\u8868\u7684DDL\u64cd\u4f5c\uff0c\u4f1a\u5bfc\u81f4\u975e\u5e38\u8017\u65f6\u3002<\/p>\n<p>3\u3001\u5efa\u8bae\u73b0\u573a\u5728\u5347\u7ea7\u524d\uff0c\u505c\u670d\u540e\uff0c\u6e05\u7406\u5386\u53f2\u6570\u636e\uff0c\u518d\u505a\u6570\u636e\u5907\u4efd\u3002<\/p>\n<p>4\u3001\u672c\u6e05\u7406\u65b9\u6848\uff0c\u9002\u7528\u4e8eTDS2.X\u53ca\u4ee5\u540e\u5f97\u6240\u6709\u7248\u672c\u3002<\/p>\n<p>\u6e05\u7406\u64cd\u4f5c\u8bf4\u660e\uff08\u63a8\u8350\u4fdd\u7559\u4e00\u4e2a\u6708\u6570\u636e\uff09<br \/>\n\u76f8\u5173\u6570\u636e\u8868\uff1atdt_solution_execution\u3001tdt_solution_sub_job<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<p>1\u3001\u4e0d\u505c\u673a\u6e05\u7406<\/p>\n<p>\u4ee5\u4e0b\u65b9\u5f0f\u6bcf\u6b21\u6e05\u740610000\u6761\u4efb\u52a1\u6267\u884c\u8bb0\u5f55\uff0c\u8d85\u51fa\u90e8\u5206\u9700\u8981\u518d\u6b21\u6267\u884c\u3002\u5047\u8bbe\u9700\u8981\u4fdd\u7559\u4ece2024.1.1\u5f00\u59cb\u7684\u6267\u884c\u8bb0\u5f55\u3002<\/p>\n<pre><code class=\"language-sql\">\/\/ \u5148\u6267\u884c\u8fd9\u4e2aSQL\uff0c\u5206\u6279\u6574\u7406\u6570\u636e\ndelete from tdt_solution_sub_job where sol_exec_uuid in (select unique_id from tdt_solution_execution where schedule_time < '2024-01-01 00:00:00' order by id limit 10000);\n\n\/\/ \u4e0a\u4e00\u6761sql\u5df2\u7ecf\u5c06\u6570\u636e\u6e05\u7406\u5b8c\u4e4b\u540e\uff08select count\u4e3a0\uff09\uff0c\u518d\u6267\u884c\u672csql\ndelete from tdt_solution_sub_job_log where  create_time < '2024-01-01 00:00:00' order by id limit 10000;\n\n\/\/ \u4e0a\u4e00\u6761sql\u5df2\u7ecf\u5c06\u6570\u636e\u6e05\u7406\u5b8c\u4e4b\u540e\uff08select count\u4e3a0\uff09\uff0c\u518d\u6267\u884c\u672csql\ndelete from tdt_solution_execution where schedule_time < '2024-01-01 00:00:00';<\/code><\/pre>\n<p>2\u3001\u505c\u673a\u6e05\u7406<\/p>\n<p>\uff081\uff09\u505c\u6b62TDT\u670d\u52a1<\/p>\n<p>\uff082\uff09\u5c06\u9700\u8981\u4fdd\u7559\u7684\u6570\u636e\u5199\u5165\u65b0\u7684\u8bb0\u5f55\u8868\uff0c\u5047\u8bbe\u9700\u8981\u4fdd\u7559\u4ece2024.1.1\u5f00\u59cb\u7684\u6267\u884c\u8bb0\u5f55\u3002<\/p>\n<pre><code class=\"language-sql\">rename table tdt_solution_sub_job_log to tdt_solution_sub_job_log_bak;\nrename table tdt_solution_sub_job to tdt_solution_sub_job_bak;\nrename table tdt_solution_execution to tdt_solution_execution_bak;\ncreate table tdt_solution_sub_job_log like tdt_solution_sub_job_log_bak;\ncreate table tdt_solution_sub_job like tdt_solution_sub_job_bak;\ncreate table tdt_solution_execution like tdt_solution_execution_bak;\ninsert into tdt_solution_sub_job_log select * from tdt_solution_sub_job_log_bak where create_time >= '2024-01-01 00:00:00';\ninsert into tdt_solution_execution select * from tdt_solution_execution_bak where schedule_time >= '2024-01-01 00:00:00';\ninsert into tdt_solution_sub_job select * from tdt_solution_sub_job_bak where sol_exec_uuid in (select unique_id  from tdt_solution_execution);<\/code><\/pre>\n<p>\uff083\uff09\u5220\u9664\u65e7\u8868\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u64cd\u4f5c\uff0c\u5982\u679c\u9700\u8981\u4fdd\u7559\u5386\u53f2\u6570\u636e\uff0c\u4e14\u6570\u636e\u76d8\u7a7a\u95f4\u5145\u88d5\uff0c\u4e0d\u9700\u8981\u53e6\u5916\u5220\u9664\uff0c\u4e4b\u540e\u8fdb\u884c\u5347\u7ea7\u3001\u8fc1\u79fb\u7b49\u64cd\u4f5c\u65f6\uff0c\u6ce8\u610f\u6392\u9664\u5907\u4efd\u8868\u3002<\/p>\n<pre><code class=\"language-sql\">drop table tdt_solution_sub_job_bak;\ndrop table tdt_solution_sub_job_bak;\ndrop table tdt_solution_execution_bak;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 1\u3001TDT\u4e00\u76f4\u6ca1\u6709\u81ea\u52a8\u6e05\u7406\u6267\u884c\u8bb0\u5f55\u7684\u903b\u8f91\uff0c\u5bfc\u81f4\u6267\u884c\u8bb0\u5f55\u4f1a\u4e00\u76f4\u7d2f\u52a0\u3002 2\u3001\u7279\u522b\u662f\u7248\u672c\u5347\u7ea7\u65f6\uff0c\u5bf9\u6570\u636e\u5e93\u505a ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=18255\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":161,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18255","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/18255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18255"}],"version-history":[{"count":2,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/18255\/revisions"}],"predecessor-version":[{"id":18257,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/18255\/revisions\/18257"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}