{"id":370,"date":"2014-11-12T11:03:11","date_gmt":"2014-11-12T11:03:11","guid":{"rendered":"d709f38ef758b5066ef31b18039b8ce5"},"modified":"2014-11-12T11:03:11","modified_gmt":"2014-11-12T11:03:11","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/370","title":{"rendered":"SQL Server \u9519\u8bef\u65e5\u5fd7"},"content":{"rendered":"<p>sp_cycle_errorlog <\/p>\n<p>&nbsp;<\/p>\n<p>\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\u66b4\u589e:<\/p>\n<p>\u8fd9\u91cc\u6211\u8bf4\u7684\u4e0d\u4ec5\u4ec5\u6307\u67d0\u4e2a\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u6587\u4ef6\u66b4\u589e\uff0c\u4e5f\u6307\u76ee\u5f55Program Files\\Microsoft SQL Server\\MSSQL.n\\MSSQL\\LOG\u6240\u5360\u7a7a\u95f4\u66b4\u589e\uff0c\u5982\u679c\u4f60\u5e73\u65f6\u90fd\u4e0d\u5173\u6ce8\u8fd9\u4e9b\u9519\u8bef\u65e5\u5fd7\uff0c\u4e5f\u4ece\u4e0d\u7ef4\u62a4\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u6587\u4ef6\uff0c\u90a3\u4e48\u5f88\u6709\u53ef\u80fd\u5b83\u6240\u5360\u7684\u7a7a\u95f4\u975e\u5e38\u5927\uff0c\u5927\u5230\u8ba9\u4f60\u5403\u60ca\u7684\u5730\u6b65\u3002\u51e0\u5341G\u7684\u6211\u4e5f\u89c1\u8fc7\uff0c\u90a3\u4e48\u5177\u4f53\u539f\u56e0\u53ef\u80fd\u6709\u4ee5\u4e0b\u79cd\uff1a<\/p>\n<p>&nbsp;1\uff1aSQL \u5185\u90e8\u9519\u8bef\u7684\u65f6\u5019\u4f1a\u4ea7\u751f\u975e\u5e38\u591a\u7684DUMP\u6587\u4ef6<\/p>\n<p>2\uff1a\u9ad8\u53ef\u7528\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u53ef\u80fd\u5f88\u5c11\u505c\u673a\uff0c\u800c\u4f60\u53c8\u6ca1\u6709\u5b9a\u671f\u6e05\u7406\u3001\u6e05\u7a7a\u8fd9\u4e9b\u9519\u8bef\u65e5\u5fd7\u4fe1\u606f\uff0c\u90a3\u4e48ERRORLOG.n\/SQLAGENT.n\u6587\u4ef6\u589e\u957f\u4f1a\u975e\u5e38\u5927\u3002\u8fd9\u6837\u5bf9\u4e8eDBA\u4f7f\u7528\u9519\u8bef\u65e5\u5fd7\u67e5\u627e\u4fe1\u606f\u5c31\u4f1a\u6bd4\u8f83\u56f0\u96be\uff0c\u800c\u4e14\u65e5\u5fd7\u5927\u4e86\u52a0\u8f7d\u3001\u5199\u5165\u4ee5\u540e\u6027\u80fd\u4e5f\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n<p>3\uff1a\u8fd8\u6709\u4e00\u4e2a\u60c5\u51b5\uff0c\u5982\u679c\u4f60\u6570\u636e\u5e93IP\u5730\u5740\u66dd\u9732\u5728\u5916\u7f51\u65f6\uff0c\u4f1a\u906d\u5230\u5927\u91cf\u5c1d\u8bd5\u767b\u5f55sa\u7684\u653b\u51fb\uff0c\u4e5f\u4f1a\u4ea7\u751f\u5927\u91cf\u7684\u5ba1\u6838\u5931\u8d25\u65e5\u5fd7\u4fe1\u606f\u3002<\/p>\n<p>4\uff1a\u5c31\u662f\u4e00\u4e9bSQL SERVER PROFILE\u6587\u4ef6\u6ca1\u6709\u5220\u9664\uff0c\u5f53\u7136\uff0c\u8fd9\u4e2a\u672c\u8d28\u8ddf\u65e5\u5fd7\u6587\u4ef6\u66b4\u589e\u6ca1\u5565\u5173\u7cfb\uff0c\u4f46\u662f\u8ddfLOG\u6587\u4ef6\u5939\u7684\u5927\u5c0f\u6709\u4e9b\u5173\u7cfb\u3002<\/p>\n<p>\u5982\u4f55\u6e05\u7406\u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<p><strong>\u5bf9\u4e8eSQL SERVER\u65e5\u5fd7\u3001SQL SERVER AGENT\u65e5\u5fd7\u8bb0\u5f55\uff0c\u5fae\u8f6f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b58\u50a8\u8fc7\u7a0bsp_cycle_errorlog\u53ef\u4ee5\u5b9e\u73b0\u65e5\u5fd7\u7684\u5faa\u73af\u3002 \u8fd9\u4e2a\u5b58\u50a8\u8fc7\u7a0b\u7684\u4f5c\u7528\u662f\u5173\u95ed\u5f53\u524d\u7684\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\uff0c\u5e76\u5faa\u73af\u9519\u8bef\u65e5\u5fd7\u6269\u5c55\u7f16\u53f7\uff08\u5c31\u50cf\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\uff09\u3002\u6bcf\u6b21\u542f\u52a8SQL Server \u65f6\uff0c\u90fd\u4f1a\u5c06\u5f53\u524d\u9519\u8bef\u65e5\u5fd7\u91cd\u547d\u540d\u4e3aerrorlog.1\uff1berrorlog.1 \u53d8\u4e3aerrorlog.2\uff0cerrorlog.2 \u53d8\u4e3aerrorlog.3\uff0c\u4f9d\u6b21\u7c7b\u63a8\u3002\u6700\u540e\u4e00\u4e2aerrorlog.n\u5c06\u4f1a\u88ab\u5220\u9664\u3002sp_cycle_errorlog \u53ef\u4f7f\u60a8\u5faa\u73af\u8bbf\u95ee\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\uff0c\u800c\u4e0d\u5fc5\u505c\u6b62\u548c\u542f\u52a8\u670d\u52a1\u5668\u3002<\/strong><\/p>\n<p>\u53e6\u5916\uff1a\u65e5\u5fd7\u8fc7\u5927\u8bf4\u660e\u4f60\u6ca1\u6709\u622a\u65ad\u9519\u8bef\u65e5\u5fd7\uff0c\u9519\u8bef\u65e5\u5fd7\u662f\u53ef\u4ee5\u622a\u65ad\u7684\uff0c\u8fdb\u5165\u4f60\u7684\u6570\u636e\u5e93\u8f93\u5165DBCC ERRORLOG<\/p>\n<p>\u6bcf\u6267\u884c\u4e00\u6b21\uff0c\u5f53\u524d\u7684\u9519\u8bef\u65e5\u5fd7\u9000\u51fa\uff0c\u8ba9\u540e\u5efa\u7acb\u65b0\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u4f60\u53ea\u80fd\u5220\u9664 ERRORLOGn\u7684\u9519\u8bef\u65e5\u5fd7\u6ca1\u6709\u53f7\u7801\u7684\u662f\u6b63\u5728\u4f7f\u7528\u7684\u65e5\u5fd7\uff0c\u5220\u9664\u4f1a\u62a5\u9519\uff0c\u5982\u679c\u5b83\u6bd4\u8f83\u5927\uff0c\u5c31DBCC ERRORLOG\uff0c\u800c\u540e\u4ed6\u4f1a\u53d8\u6210ERRORLOG+\u7f16\u53f7\uff0c\u4f60\u5c31\u53ef\u4ee5\u5220\u9664\u4e86\uff0c\u53e6\u5916\u5efa\u8bae\u4f60\u628a\u8fd9\u4e9bERRORLOG \u653e\u5230\u5176\u4ed6\u76d8\u7b26\uff0c\u6bd4\u8f83\u597d\u7ba1\u7406\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sp_cycle_errorlog <\/p>\n<p>&nbsp;<\/p>\n<p>\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\u66b4\u589e:<\/p>\n<p>\u8fd9\u91cc\u6211\u8bf4\u7684\u4e0d\u4ec5\u4ec5\u6307\u67d0\u4e2a\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u6587\u4ef6\u66b4\u589e\uff0c\u4e5f\u6307\u76ee\u5f55Program Files\\Microsoft SQL Server\\MSSQL.n\\MSSQL\\LOG\u6240\u5360\u7a7a\u95f4\u66b4\u589e\uff0c\u5982\u679c\u4f60\u5e73\u65f6\u90fd\u4e0d\u5173\u6ce8\u8fd9\u4e9b\u9519\u8bef\u65e5\u5fd7\uff0c\u4e5f\u4ece\u4e0d\u7ef4\u62a4\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u6587\u4ef6\uff0c\u90a3\u4e48\u5f88\u6709\u53ef\u80fd\u5b83\u6240\u5360\u7684\u7a7a\u95f4\u975e\u5e38\u5927\uff0c\u5927\u5230\u8ba9\u4f60\u5403\u60ca\u7684\u5730\u6b65\u3002\u51e0\u5341G\u7684\u6211\u4e5f\u89c1\u8fc7\uff0c\u90a3\u4e48\u5177\u4f53\u539f\u56e0\u53ef\u80fd\u6709\u4ee5\u4e0b\u79cd\uff1a<\/p>\n<p>&nbsp;1\uff1aSQL \u5185\u90e8\u9519\u8bef\u7684\u65f6\u5019\u4f1a\u4ea7\u751f\u975e\u5e38\u591a\u7684DUMP\u6587\u4ef6<\/p>\n<p>2\uff1a\u9ad8\u53ef\u7528\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u53ef\u80fd\u5f88\u5c11\u505c\u673a\uff0c\u800c\u4f60\u53c8\u6ca1\u6709\u5b9a\u671f\u6e05\u7406\u3001\u6e05\u7a7a\u8fd9\u4e9b\u9519\u8bef\u65e5\u5fd7\u4fe1\u606f\uff0c\u90a3\u4e48ERRORLOG.n\/SQLAGENT.n\u6587\u4ef6\u589e\u957f\u4f1a...<\/p>\n<p> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/370\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[288],"tags":[171,113,3],"class_list":["post-370","post","type-post","status-publish","format-standard","hentry","category-db","tag-log","tag-server","tag-SQL"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/370\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}