{"id":4275,"date":"2023-05-25T13:42:43","date_gmt":"2023-05-25T11:42:43","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=4275"},"modified":"2026-01-02T17:01:37","modified_gmt":"2026-01-02T15:01:37","slug":"je-mets-ma-base-de-donnees-ha-au-regime","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/zh\/je-mets-ma-base-de-donnees-ha-au-regime","title":{"rendered":"\u6211\u628a\u6211\u7684HA\u6570\u636e\u5e93\u653e\u5728\u996e\u98df\u4e0a\u3002"},"content":{"rendered":"<p>\u5982 Retex \u4e2d\u6240\u8ff0\u00a0<\/p>\r\n<ul>\r\n<li><a href=\"https:\/\/www.sigalou-domotique.fr\/zh\/verifier-la-taille-de-sa-base-de-donnees\/\" target=\"_blank\" rel=\"noopener\">\u6211\u68c0\u67e5\u6211\u7684\u6570\u636e\u5e93\u7684\u5927\u5c0f\u3002<\/a><\/li>\r\n<\/ul>\r\n<p>\u4ee4\u4eba\u60ca\u8bb6\u7684\u662f\uff0c\u6570\u636e\u5e93\u586b\u6ee1\u7684\u901f\u5ea6\u6709\u591a\u5feb\u3002<\/p>\r\n<p>\u5728\u6b64\u590d\u5370\u4e2d\uff0c\u6211\u5c06\u5c1d\u8bd5\u8bc6\u522b\u6ce8\u518c\u6700\u591a\u7684\u5b9e\u4f53\uff0c\u68c0\u67e5\u5176\u6ce8\u518c\u662f\u5426\u6709\u7528\uff0c\u5e76\u914d\u7f6eHA\u8bb0\u5f55\u5668\u4ee5\u9650\u5236\u57fa\u6570\u7684\u5927\u5c0f\u3002<!--more--><\/p>\r\n<h3>\u6211\u786e\u5b9a\u6ce8\u518c\u6700\u591a\u7684\u5b9e\u4f53<\/h3>\r\n<p>\u6211\u5c06\u8fde\u63a5\u5230SSH\u547d\u4ee4\u884c\uff0c\u6211\u8981\u67e5\u8be2\u6570\u636e\u5e93\u3002<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">CD ~\/ \u914d\u7f6e<\/pre>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">sqlite3 home-assistant_v2.db .header on .mode column .width 50, 10, SELECT state_meta.entity_id, COUNT(*)AS count FROM \u8868\u793a JOIN state_metadata_id = state_meta.metadata_id GROUP BY state_meta.entity _id ORDER BY count DESC LIMIT 20;<\/pre>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4279\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/bd1.png\" alt=\"\" width=\"533\" height=\"158\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/bd1.png 533w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/bd1-300x89.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/p>\r\n<p>\u6b64\u547d\u4ee4\u663e\u793a\u5177\u6709\u6700\u591a\u8bb0\u5f55\u768420\u4e2a\u5b9e\u4f53\uff08\u56e0\u6b64\u6570\u636e\u5e93\u5927\u5c0f\u6d88\u8017\u6700\u591a\u7684\u5b9e\u4f53\uff09\u3002<\/p>\r\n<p>\u901a\u8fc7\u5c06LIMIT 20\u66f4\u6539\u4e3aLIMIT 200\uff0c\u6211\u62e5\u6709200\u4e2a\u6ce8\u518c\u6700\u591a\u7684\u5b9e\u4f53\u3002\u00a0<\/p>\r\n<h3>\u6211\u914d\u7f6e\u8bb0\u5f55\u5668<\/h3>\r\n<ul>\r\n<li><a href=\"https:\/\/www.home-assistant.io\/integrations\/recorder\/\" target=\"_blank\" rel=\"noopener\">\u6587\u4ef6<\/a><\/li>\r\n<\/ul>\r\n<p>\u6211\u521b\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6 <a href=\"https:\/\/github.com\/sigalou\/home-assistant-config-fr\/blob\/main\/recorder.yaml\" target=\"_blank\" rel=\"noopener\">Recorder.yaml<\/a> \u4e0d\u5fd8\u8bb0\u5728\u91cc\u9762\u6307\u5b9a\u5b83 <a href=\"https:\/\/github.com\/sigalou\/home-assistant-config-fr\/blob\/main\/configuration.yaml\" target=\"_blank\" rel=\"noopener\">\u914d\u7f6e.yaml<\/a><\/p>\r\n<p>\u6b64\u6587\u4ef6\u5141\u8bb8\u60a8\u5305\u542b\u6216\u6392\u9664\u6211\u60f3\u8981\u4fdd\u5b58\uff08\u6216\u4e0d\uff09\u7684\u6240\u6709\u5185\u5bb9\u3002<\/p>\r\n<p>\u5728\u4e0d\u65ad\u53d1\u5c55\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4e0d\u628a\u4ee3\u7801\u7684\u526f\u672c\u653e\u5728\u8fd9\u91cc\uff0c\u4f46\u53ef\u4ee5\u5728\u6587\u4ef6\u4e0a\u67e5\u9605\u6587\u4ef6\u3002 <a href=\"https:\/\/github.com\/sigalou\/home-assistant-config-fr\" target=\"_blank\" rel=\"noopener\">GitHub \u7684<\/a>.<\/p>\r\n<p>\u901a\u8fc7\u9009\u62e9\u6211\u60f3\u4fdd\u5b58\u7684\u5185\u5bb9\uff0c\u6211\u53ef\u4ee5\u63a7\u5236\u6570\u636e\u5e93\u7684\u5927\u5c0f\u3002<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4089\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/sql3.png\" alt=\"\" width=\"381\" height=\"148\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/sql3.png 381w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/sql3-300x117.png 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5982\u5728\u590d\u9009\u4e2d\u63d0\u5230\u7684\uff0c\u6211\u68c0\u67e5\u6570\u636e\u5e93\u7684\u5927\u5c0f\uff0c\u770b\u5230\u6570\u636e\u5e93\u586b\u5145\u7684\u901f\u5ea6\u4ee4\u4eba\u60ca\u8bb6\u3002 \u5728\u6b64\u590d\u5370\u4e2d\uff0c\u6211\u5c06\u5c1d\u8bd5\u8bc6\u522b\u6ce8\u518c\u6700\u591a\u7684\u5b9e\u4f53\uff0c\u68c0\u67e5\u5176\u6ce8\u518c\u662f\u5426\u6709\u7528\uff0c\u5e76\u914d\u7f6eHA\u8bb0\u5f55\u5668\u4ee5\u9650\u5236[...]<\/p>","protected":false},"author":1,"featured_media":4089,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,53,166],"tags":[81],"class_list":["post-4275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-home-assistant","category-retex","tag-developpement"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts\/4275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/comments?post=4275"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts\/4275\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/media\/4089"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/media?parent=4275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/categories?post=4275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/tags?post=4275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}