{"id":5677,"date":"2024-11-14T08:10:43","date_gmt":"2024-11-14T00:10:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5677\/"},"modified":"2024-11-14T08:10:43","modified_gmt":"2024-11-14T00:10:43","slug":"sql%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%ba%93%e6%80%8e%e4%b9%88%e7%9c%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5677\/","title":{"rendered":"sql\u5907\u4efd\u6570\u636e\u5e93\u600e\u4e48\u770b"},"content":{"rendered":"<blockquote><p>\n  \u6709\u4e09\u79cd\u65b9\u6cd5\u67e5\u770b sql \u6570\u636e\u5e93\u5907\u4efd\uff1a\u5728 sql server management studio \u4e2d\u67e5\u770b\u201c\u5c5e\u6027\u201d\u9009\u9879\u5361\u3001\u6267\u884c t-sql \u67e5\u8be2\uff0c\u6216\u4f7f\u7528 sql server management studio \u754c\u9762\u4e0a\u7684\u201c\u5907\u4efd\u4fe1\u606f\u201d\u9009\u9879\u5361\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/30\/2024053020272636990.jpg\" class=\"aligncenter\" title=\"sql\u5907\u4efd\u6570\u636e\u5e93\u600e\u4e48\u770b\u63d2\u56fe\" alt=\"sql\u5907\u4efd\u6570\u636e\u5e93\u600e\u4e48\u770b\u63d2\u56fe\" \/><\/p>\n<p><strong>\u67e5\u770b SQL \u6570\u636e\u5e93\u5907\u4efd\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>\u8981\u67e5\u770b SQL \u6570\u636e\u5e93\u5907\u4efd\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u786e\u8ba4\u5907\u4efd\u5b58\u5728<\/strong><\/p>\n<ul>\n<li>\u5728 SQL Server Management Studio \u4e2d\uff0c\u8fde\u63a5\u5230\u8981\u67e5\u770b\u5907\u4efd\u7684\u670d\u52a1\u5668\u3002<\/li>\n<li>\u5728\u201c\u5bf9\u8c61\u8d44\u6e90\u7ba1\u7406\u5668\u201d\u4e2d\uff0c\u5c55\u5f00\u201c\u6570\u636e\u5e93\u201d\u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9\u8981\u68c0\u67e5\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u7136\u540e\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u5728\u201c\u5c5e\u6027\u201d\u7a97\u53e3\u7684\u201c\u5907\u4efd\u201d\u9009\u9879\u5361\u4e0b\uff0c\u67e5\u770b\u662f\u5426\u6709\u5907\u4efd\u3002<\/li>\n<\/ul>\n<p><strong>2. \u4f7f\u7528 T-SQL \u67e5\u8be2\u67e5\u770b\u5907\u4efd<\/strong><\/p>\n<ul>\n<li>\u5728 SQL Server Management Studio \u4e2d\uff0c\u6253\u5f00\u65b0\u67e5\u8be2\u7a97\u53e3\u3002<\/li>\n<li>\u6267\u884c\u4ee5\u4e0b T-SQL \u67e5\u8be2\uff1a<\/li>\n<\/ul>\n<pre>SELECT * FROM msdb.dbo.backupset\nWHERE database_name = '&lt;database_name&gt;'\nAND backup_type = 'Full'\nORDER BY backup_start_date DESC;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ul>\n<li>\u5176\u4e2d  \u66ff\u6362\u4e3a\u8981\u68c0\u67e5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002  <\/li>\n<\/ul>\n<p>\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u6709\u5173\u5907\u4efd\u7684\u4fe1\u606f\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5907\u4efd\u540d\u79f0<\/li>\n<li>\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>\u5907\u4efd\u7c7b\u578b<\/li>\n<li>\u5907\u4efd\u5f00\u59cb\u65e5\u671f<\/li>\n<\/ul>\n<p><strong>3. \u4f7f\u7528 SQL Server Management Studio \u754c\u9762\u67e5\u770b\u5907\u4efd<\/strong><\/p>\n<ul>\n<li>\u5728\u201c\u5bf9\u8c61\u8d44\u6e90\u7ba1\u7406\u5668\u201d\u4e2d\uff0c\u5c55\u5f00\u201c\u7ba1\u7406\u201d\u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9\u201c\u5907\u4efd\u201d\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u201c\u5907\u4efd\u201d\u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9\u201c\u6062\u590d\u201d\u3002<\/li>\n<li>\u5728\u201c\u6062\u590d\u6570\u636e\u5e93\u201d\u7a97\u53e3\u7684\u201c\u5907\u4efd\u533a\u57df\u201d\u4e0b\uff0c\u9009\u62e9\u8981\u67e5\u770b\u7684\u5907\u4efd\u3002<\/li>\n<li>\u5355\u51fb\u201c\u9009\u9879\u201d\u6309\u94ae\uff0c\u7136\u540e\u9009\u62e9\u201c\u5907\u4efd\u4fe1\u606f\u201d\u9009\u9879\u5361\u3002<\/li>\n<\/ul>\n<p>\u6b64\u9009\u9879\u5361\u5c06\u663e\u793a\u6709\u5173\u5907\u4efd\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\u5907\u4efd\u540d\u79f0<\/li>\n<li>\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>\u5907\u4efd\u7c7b\u578b<\/li>\n<li>\u5907\u4efd\u5927\u5c0f<\/li>\n<li>\u5907\u4efd\u65e5\u671f<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fsql\u5907\u4efd\u6570\u636e\u5e93\u600e\u4e48\u770b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4e09\u79cd\u65b9\u6cd5\u67e5\u770b sql \u6570\u636e\u5e93\u5907\u4efd\uff1a\u5728 sql server management studio \u4e2d\u67e5\u770b\u201c\u5c5e\u6027\u201d\u9009\u9879\u5361\u3001\u6267\u884c t-sql \u67e5\u8be2\uff0c\u6216\u4f7f\u7528 sql server management studio \u754c\u9762\u4e0a\u7684\u201c\u5907\u4efd\u4fe1\u606f\u201d\u9009\u9879\u5361\u3002 \u67e5\u770b SQL \u6570\u636e\u5e93\u5907\u4efd\u7684\u65b9\u6cd5 \u8981\u67e5\u770b SQL \u6570\u636e\u5e93\u5907\u4efd\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u786e\u8ba4\u5907\u4efd\u5b58\u5728 \u5728 SQL Server Management Studio \u4e2d\uff0c\u8fde\u63a5\u5230\u8981\u67e5\u770b\u5907\u4efd\u7684\u670d\u52a1\u5668\u3002 \u5728\u201c\u5bf9\u8c61\u8d44\u6e90\u7ba1\u7406\u5668\u201d\u4e2d\uff0c\u5c55\u5f00\u201c\u6570\u636e\u5e93\u201d\u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9\u8981\u68c0\u67e5\u7684\u6570\u636e\u5e93\u3002 \u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u7136\u540e\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002 \u5728\u201c\u5c5e\u6027\u201d\u7a97\u53e3\u7684\u201c\u5907\u4efd\u201d\u9009\u9879\u5361\u4e0b\uff0c\u67e5\u770b\u662f\u5426\u6709\u5907\u4efd\u3002 2. \u4f7f\u7528 T-SQL \u67e5\u8be2\u67e5\u770b\u5907\u4efd \u5728 SQL Server Management Studio \u4e2d\uff0c\u6253\u5f00\u65b0\u67e5\u8be2\u7a97\u53e3\u3002 \u6267\u884c\u4ee5\u4e0b T-SQL \u67e5\u8be2\uff1a SELECT * FROM msdb.dbo.backupset WHERE database_name = &#8216;&lt;database_name&gt;&#8217; AND backup_type [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5677","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5677"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5677\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}