
{"id":957,"date":"2021-09-24T17:09:00","date_gmt":"2021-09-24T09:09:00","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=957"},"modified":"2021-10-14T07:42:19","modified_gmt":"2021-10-13T23:42:19","slug":"dataguard%e5%bf%ab%e7%85%a7snapshot%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=957","title":{"rendered":"DataGuard\u5feb\u7167(snapshot)\u6570\u636e\u5e93"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-69f49f185c5a3\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f49f185c5a3\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#1_%E5%B0%86%E7%89%A9%E7%90%86%E5%A4%87%E5%BA%93%E5%88%87%E6%8D%A2%E4%B8%BA%E5%BF%AB%E7%85%A7%E6%95%B0%E6%8D%AE%E5%BA%93\" >1. \u5c06\u7269\u7406\u5907\u5e93\u5207\u6362\u4e3a\u5feb\u7167\u6570\u636e\u5e93<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#11_%E5%A4%87%E5%BA%93%E9%85%8D%E7%BD%AE%E5%BF%AB%E9%80%9F%E6%81%A2%E5%A4%8D%E5%8C%BA\" >1.1. \u5907\u5e93\u914d\u7f6e\u5feb\u901f\u6062\u590d\u533a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#12_%E5%A4%87%E5%BA%93%E5%85%B3%E9%97%ADredo_apply%E5%BA%94%E7%94%A8\" >1.2. \u5907\u5e93\u5173\u95edredo apply\u5e94\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#13_%E5%88%87%E6%8D%A2%E4%B8%BA%E5%BF%AB%E7%85%A7snapshot%E6%95%B0%E6%8D%AE%E5%BA%93\" >1.3. \u5207\u6362\u4e3a\u5feb\u7167(snapshot)\u6570\u636e\u5e93<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#14_%E6%9F%A5%E7%9C%8B%E7%8A%B6%E6%80%81\" >1.4. \u67e5\u770b\u72b6\u6001<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#2_%E5%B0%86%E5%BF%AB%E7%85%A7snapshot%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%87%E5%9B%9E%E7%89%A9%E7%90%86%E5%A4%87%E5%BA%93\" >2. \u5c06\u5feb\u7167(snapshot)\u6570\u636e\u5e93\u5207\u56de\u7269\u7406\u5907\u5e93<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#21_%E5%85%B3%E9%97%AD%E5%A4%87%E5%BA%93%EF%BC%8C%E5%B0%86%E5%A4%87%E5%BA%93%E5%90%AF%E5%8A%A8%E5%88%B0mount%E7%8A%B6%E6%80%81\" >2.1. \u5173\u95ed\u5907\u5e93\uff0c\u5c06\u5907\u5e93\u542f\u52a8\u5230mount\u72b6\u6001<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#22_%E6%89%A7%E8%A1%8C%E5%88%87%E5%9B%9E%E5%91%BD%E4%BB%A4\" >2.2. \u6267\u884c\u5207\u56de\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#23_%E5%86%8D%E6%AC%A1%E5%85%B3%E9%97%AD%E5%A4%87%E5%BA%93%EF%BC%8C%E5%90%AF%E5%8A%A8%E5%88%B0open%E7%8A%B6%E6%80%81%EF%BC%8C%E5%BC%80%E5%90%AF%E5%AE%9E%E6%97%B6%E5%BA%94%E7%94%A8\" >2.3. \u518d\u6b21\u5173\u95ed\u5907\u5e93\uff0c\u542f\u52a8\u5230open\u72b6\u6001\uff0c\u5f00\u542f\u5b9e\u65f6\u5e94\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/dba.qishuo.xin\/?p=957\/#24_%E6%9F%A5%E7%9C%8B%E5%A4%87%E5%BA%93%E7%8A%B6%E6%80%81\" >2.4. \u67e5\u770b\u5907\u5e93\u72b6\u6001<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p><strong>\u5728Dataguard\u4e2d\uff0c\u53ef\u4ee5\u5c06standby\u5907\u5e93\u5207\u6362\u4e3asnapshot\u5feb\u7167\u6570\u636e\u5e93\uff0c\u5728\u5207\u6362\u4e3asnapshot\u6570\u636e\u5e93\u540e\uff0c\u5907\u5e93\u5c06\u7f6e\u4e8e\u53ef\u8bfb\u5199\u7684\u6a21\u5f0f\u3002\u53ef\u7528\u4e8e\u6a21\u62df\u4e1a\u52a1\u529f\u80fd\u6d4b\u8bd5\u3002\u5728\u4f7f\u7528\u5b8c\u6210\u4e4b\u540e\uff0c\u53ef\u4ee5\u5c06\u5feb\u7167\u6570\u636e\u5e93\u5207\u6362\u4e3a\u7269\u7406\u5907\u5e93\u3002\u5728\u6b64\u671f\u95f4\uff0c\u5907\u5e93\u53ef\u4ee5\u63a5\u53d7\u4e3b\u5e93\u4f20\u8f93\u8fc7\u6765\u7684\u65e5\u5fd7\uff0c\u4f46\u662f\u4e0d\u80fd\u5e94\u7528\u65e5\u5fd7\uff0c\u9700\u8981\u5904\u4e8e\u7269\u7406\u5907\u5e93\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u5e94\u7528\u3002<\/strong><\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_%E5%B0%86%E7%89%A9%E7%90%86%E5%A4%87%E5%BA%93%E5%88%87%E6%8D%A2%E4%B8%BA%E5%BF%AB%E7%85%A7%E6%95%B0%E6%8D%AE%E5%BA%93\"><\/span>1. \u5c06\u7269\u7406\u5907\u5e93\u5207\u6362\u4e3a\u5feb\u7167\u6570\u636e\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"11_%E5%A4%87%E5%BA%93%E9%85%8D%E7%BD%AE%E5%BF%AB%E9%80%9F%E6%81%A2%E5%A4%8D%E5%8C%BA\"><\/span>1.1. \u5907\u5e93\u914d\u7f6e\u5feb\u901f\u6062\u590d\u533a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">SQL&gt; show parameter db_recovery\n\nNAME                           TYPE          VALUE\n---------------------------  ----------- ---------------------\ndb_recovery_file_dest         string\ndb_recovery_file_dest_size    big integer      0\nSQL&gt;\nSQL&gt; alter system set db_recovery_file_dest_size=500g;\n\nSystem altered.\n\nSQL&gt; alter system set db_recovery_file_dest='\/dbData\/OracleArch\/fast_recovery_area';\n\nSystem altered.\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"12_%E5%A4%87%E5%BA%93%E5%85%B3%E9%97%ADredo_apply%E5%BA%94%E7%94%A8\"><\/span>1.2. \u5907\u5e93\u5173\u95edredo apply\u5e94\u7528<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">--\u5728\u5173\u95ed\u4e4b\u524d\uff0c\u5907\u5e93\u7684\u5f00\u542f\u72b6\u6001\u4e3a\uff1aREAD ONLY WITH APPLY\n--\u5173\u95edredo apply\u540e\uff0c\u5907\u5e93\u7684\u5f00\u542f\u72b6\u6001\u4e3a\uff1aREAD ONLY\nalter database recover managed standby database cancel;\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"13_%E5%88%87%E6%8D%A2%E4%B8%BA%E5%BF%AB%E7%85%A7snapshot%E6%95%B0%E6%8D%AE%E5%BA%93\"><\/span>1.3. \u5207\u6362\u4e3a\u5feb\u7167(snapshot)\u6570\u636e\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">--\u6267\u884c\u8f6c\u6362\u4e3a\u5feb\u7167\u6570\u636e\u5e93\u540e\uff0c\u5907\u5e93\u7684\u5f00\u542f\u72b6\u6001\u4e3a\uff1aMOUNTED\nalter database convert to snapshot standby;\n\n--\u5f00\u542f\u5907\u5e93\u540e\uff0c\u6570\u636e\u5e93\u5f00\u542f\u72b6\u6001\u4e3a\uff1aREAD WRITE\nalter database open;\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"14_%E6%9F%A5%E7%9C%8B%E7%8A%B6%E6%80%81\"><\/span>1.4. \u67e5\u770b\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">SELECT open_mode,database_role,protection_mode,protection_level\n  FROM v$database;\n\nOPEN_MODE             DATABASE_ROLE    PROTECTION_MODE       PROTECTION_LEVEL\n-------------------- ---------------- -------------------- --------------------\nREAD WRITE            SNAPSHOT STANDBY MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"2_%E5%B0%86%E5%BF%AB%E7%85%A7snapshot%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%87%E5%9B%9E%E7%89%A9%E7%90%86%E5%A4%87%E5%BA%93\"><\/span>2. \u5c06\u5feb\u7167(snapshot)\u6570\u636e\u5e93\u5207\u56de\u7269\u7406\u5907\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"21_%E5%85%B3%E9%97%AD%E5%A4%87%E5%BA%93%EF%BC%8C%E5%B0%86%E5%A4%87%E5%BA%93%E5%90%AF%E5%8A%A8%E5%88%B0mount%E7%8A%B6%E6%80%81\"><\/span>2.1. \u5173\u95ed\u5907\u5e93\uff0c\u5c06\u5907\u5e93\u542f\u52a8\u5230mount\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">shutdown immediate;\nstartup mount;\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"22_%E6%89%A7%E8%A1%8C%E5%88%87%E5%9B%9E%E5%91%BD%E4%BB%A4\"><\/span>2.2. \u6267\u884c\u5207\u56de\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">alter database convert to physical standby;\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"23_%E5%86%8D%E6%AC%A1%E5%85%B3%E9%97%AD%E5%A4%87%E5%BA%93%EF%BC%8C%E5%90%AF%E5%8A%A8%E5%88%B0open%E7%8A%B6%E6%80%81%EF%BC%8C%E5%BC%80%E5%90%AF%E5%AE%9E%E6%97%B6%E5%BA%94%E7%94%A8\"><\/span>2.3. \u518d\u6b21\u5173\u95ed\u5907\u5e93\uff0c\u542f\u52a8\u5230open\u72b6\u6001\uff0c\u5f00\u542f\u5b9e\u65f6\u5e94\u7528<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">--\u5173\u95ed\u5907\u5e93\nshutdown immediate\n\n--\u542f\u52a8\u6570\u636e\u5e93\u5230open\u72b6\u6001\nstartup\n\n--\u5f00\u59cb\u5907\u5e93\u5b9e\u65f6\u5e94\u7528\nalter database recover managed standby database using current logfile disconnect;\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"24_%E6%9F%A5%E7%9C%8B%E5%A4%87%E5%BA%93%E7%8A%B6%E6%80%81\"><\/span>2.4. \u67e5\u770b\u5907\u5e93\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql line-numbers\">SELECT open_mode,database_role,protection_mode,protection_level\n  FROM v$database;\n\nNAME      OPEN_MODE            DATABASE_ROLE    PROTECTION_MODE\n--------- -------------------- ---------------- --------------------\nADGDB     READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM AVAILABILITY\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Dataguard\u4e2d\uff0c\u53ef\u4ee5\u5c06standby\u5907\u5e93\u5207&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,2],"tags":[68,16,128],"class_list":{"0":"post-957","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-oracle","8":"tag-dataguard","9":"tag-oracle","10":"tag-snapshot"},"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=957"}],"version-history":[{"count":2,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":999,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/957\/revisions\/999"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}