
{"id":502,"date":"2021-09-11T04:59:14","date_gmt":"2021-09-10T20:59:14","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=502"},"modified":"2022-04-23T22:15:05","modified_gmt":"2022-04-23T14:15:05","slug":"oracle-dataguard-%e7%9b%91%e6%8e%a7%e6%97%a5%e5%bf%97%e5%90%8c%e6%ad%a5%e6%98%af%e5%90%a6%e6%ad%a3%e5%b8%b8","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=502","title":{"rendered":"Oracle DataGuard \u76d1\u63a7\u65e5\u5fd7\u540c\u6b65\u662f\u5426\u6b63\u5e38"},"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-69f73185ebb59\" 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-69f73185ebb59\" 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-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=502\/#1_%E6%9F%A5%E7%9C%8B%E5%A4%87%E5%BA%93%EF%BC%88%E6%88%96%E8%80%85%E4%B8%BB%E5%BA%93%EF%BC%89%E7%9A%84%E7%8A%B6%E6%80%81\" >1. \u67e5\u770b\u5907\u5e93\uff08\u6216\u8005\u4e3b\u5e93\uff09\u7684\u72b6\u6001<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=502\/#2_%E6%9F%A5%E8%AF%A2%E4%B8%BB%E5%BA%93%E6%97%A5%E5%BF%97%E4%BC%A0%E8%BE%93%E5%BA%8F%E5%88%97%E5%8F%B7%E3%80%81%E5%A4%87%E5%BA%93%E6%97%A5%E5%BF%97%E5%BA%94%E7%94%A8%E5%BA%8F%E5%88%97%E5%8F%B7\" >2. \u67e5\u8be2\u4e3b\u5e93\u65e5\u5fd7\u4f20\u8f93\u5e8f\u5217\u53f7\u3001\u5907\u5e93\u65e5\u5fd7\u5e94\u7528\u5e8f\u5217\u53f7<\/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=502\/#3_%E6%A3%80%E6%9F%A5%E5%A4%87%E5%BA%93%E6%98%AF%E5%90%A6%E6%9C%89MRP0%E8%BF%9B%E7%A8%8B%E4%BB%A5%E5%8F%8A%E8%BF%9B%E7%A8%8B%E7%9A%84%E6%B4%BB%E5%8A%A8%E7%8A%B6%E6%80%81\" >3. \u68c0\u67e5\u5907\u5e93\u662f\u5426\u6709MRP0\u8fdb\u7a0b\u4ee5\u53ca\u8fdb\u7a0b\u7684\u6d3b\u52a8\u72b6\u6001<\/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=502\/#4_%E6%A3%80%E6%9F%A5%E5%A4%87%E5%BA%93%E6%97%A5%E5%BF%97%E5%BA%94%E7%94%A8%E7%9A%84%E6%83%85%E5%86%B5\" >4. \u68c0\u67e5\u5907\u5e93\u65e5\u5fd7\u5e94\u7528\u7684\u60c5\u51b5<\/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=502\/#5_%E6%A3%80%E6%9F%A5real-time_apply_%E5%BA%94%E7%94%A8%E6%97%A5%E5%BF%97%E7%9A%84%E8%BF%9B%E5%BA%A6\" >5. \u68c0\u67e5real-time apply \u5e94\u7528\u65e5\u5fd7\u7684\u8fdb\u5ea6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=502\/#6_%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E6%9C%89GAP\" >6. \u68c0\u67e5\u662f\u5426\u6709GAP<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"1_%E6%9F%A5%E7%9C%8B%E5%A4%87%E5%BA%93%EF%BC%88%E6%88%96%E8%80%85%E4%B8%BB%E5%BA%93%EF%BC%89%E7%9A%84%E7%8A%B6%E6%80%81\"><\/span>1. \u67e5\u770b\u5907\u5e93\uff08\u6216\u8005\u4e3b\u5e93\uff09\u7684\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SET feed off\nSET lines 300\nSET pages 999\nCOLUMN database_name      heading &quot;Database|Name&quot;     FORMAT  a12\nCOLUMN database_role      heading &quot;Database|Role&quot;     FORMAT  a30\nCOLUMN protection_mode    heading &quot;Protection|Mode&quot;   FORMAT  a30\nCOLUMN force_logging      heading &quot;Force|Logging&quot;     FORMAT  a7\nCOLUMN open_mode          heading &quot;Open|Mode&quot;         FORMAT  a30\nCOLUMN switchover_status  heading &quot;Switchover|Status&quot; FORMAT  a30\nSELECT name              AS database_name,\n       protection_mode,\n       database_role,\n       force_logging,\n       open_mode,\n       switchover_status\n  FROM v$database;<\/code><\/pre>\n<ul>\n<li>\n<p>\u4e3b\u5e93\uff1a<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_7bc951acd188c3059d31cfef0d73837f.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_7bc951acd188c3059d31cfef0d73837f.jpg\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>\u5907\u5e93\uff1a<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_f1c3b3d3e7c79920508d4e92fbc59f4c.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_f1c3b3d3e7c79920508d4e92fbc59f4c.jpg\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"2_%E6%9F%A5%E8%AF%A2%E4%B8%BB%E5%BA%93%E6%97%A5%E5%BF%97%E4%BC%A0%E8%BE%93%E5%BA%8F%E5%88%97%E5%8F%B7%E3%80%81%E5%A4%87%E5%BA%93%E6%97%A5%E5%BF%97%E5%BA%94%E7%94%A8%E5%BA%8F%E5%88%97%E5%8F%B7\"><\/span>2. \u67e5\u8be2\u4e3b\u5e93\u65e5\u5fd7\u4f20\u8f93\u5e8f\u5217\u53f7\u3001\u5907\u5e93\u65e5\u5fd7\u5e94\u7528\u5e8f\u5217\u53f7<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SELECT AL.THRD &quot;Thread&quot;,\n       ALMAX   &quot;Last Seq Received&quot;,\n       LHMAX   &quot;Last Seq Applied&quot;\n  FROM (SELECT THREAD# THRD, MAX(SEQUENCE#) ALMAX\n          FROM V$ARCHIVED_LOG\n         WHERE RESETLOGS_CHANGE# =\n               (SELECT RESETLOGS_CHANGE# FROM V$DATABASE)\n         GROUP BY THREAD#) AL,\n       (SELECT THREAD# THRD, MAX(SEQUENCE#) LHMAX\n          FROM V$LOG_HISTORY\n         WHERE RESETLOGS_CHANGE# =\n               (SELECT RESETLOGS_CHANGE# FROM V$DATABASE)\n         GROUP BY THREAD#) LH\n WHERE AL.THRD = LH.THRD;<\/code><\/pre>\n<p>\u5982\u679c\u76f8\u7b49\u5219\u8868\u793a\u4e3b\u3001\u5907\u5e93\u6570\u636e\u4e00\u81f4\u3002\u53cd\u4e4b\u5219\u4e3b\u3001\u5907\u5e93\u6570\u636e\u4e0d\u4e00\u81f4\u3002<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_58f4efd5c02dc392e108b7cfcd6570e4.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_58f4efd5c02dc392e108b7cfcd6570e4.jpg\" alt=\"\" \/><\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"3_%E6%A3%80%E6%9F%A5%E5%A4%87%E5%BA%93%E6%98%AF%E5%90%A6%E6%9C%89MRP0%E8%BF%9B%E7%A8%8B%E4%BB%A5%E5%8F%8A%E8%BF%9B%E7%A8%8B%E7%9A%84%E6%B4%BB%E5%8A%A8%E7%8A%B6%E6%80%81\"><\/span>3. \u68c0\u67e5\u5907\u5e93\u662f\u5426\u6709MRP0\u8fdb\u7a0b\u4ee5\u53ca\u8fdb\u7a0b\u7684\u6d3b\u52a8\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SELECT process,client_process,sequence#,status\n  FROM v$managed_standby;<\/code><\/pre>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_b6c39d12d542e138cdf5862674bf2610.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_b6c39d12d542e138cdf5862674bf2610.jpg\" alt=\"\" \/><\/a><\/p>\n<p><span style='color:red'><br \/>\n\u7279\u522b\u8bf4\u660e\uff1a<br \/>\nRFS\uff08remote file server\uff09\uff1a\u8fd0\u884c\u5728\u5907\u5e93\u4e0a\u7684\u8fdb\u7a0b\uff0c\u7528\u4e8e\u5728\u5907\u5e93\u4e0a\u8fdb\u884c\u4e3b\u5e93\u7684\u65e5\u5fd7\u6062\u590d\u3002\u9ed8\u8ba4\uff0c\u8fd9\u4e2a\u8fdb\u7a0b\u7528\u4e8e\u63a5\u6536\u4ece\u4e3b\u5e93\u4f20\u9001\u8fc7\u6765\u7684\u5f52\u6863\u65e5\u5fd7\u3002<br \/>\nMRP\uff1a\u5f53\u7269\u7406\u5907\u5e93\u542f\u7528\u4e86\u5b9e\u65f6\u5e94\u7528\u7684\u65f6\u5019\uff0c\u4f1a\u521b\u5efa\u8fd9\u4e2a\u8fdb\u7a0b\uff0c\u7528\u4e8e\u65e5\u5fd7\u7684\u5b9e\u65f6\u5e94\u7528\u3002<\/p>\n<p>1\uff09\u542f\u7528MRP \u8fdb\u7a0b\uff0c\u540e\u53f0\u6062\u590d\u8fdb\u7a0b\u5e94\u7528standby redo logfile\u8fdb\u884c\u6062\u590d:<\/p>\n<pre><code class=\"language-sql\">SQL&gt; alter database recover managed standby database using current logfile disconnect from session;<\/code><\/pre>\n<p>2\uff09\u53d6\u6d88MRP\u8fdb\u7a0b\u5e94\u7528\uff1a<\/p>\n<pre><code class=\"language-sql\">SQL&gt; alter database recover managed standby database cancel;<\/code><\/pre>\n<p><\/span><\/p>\n<pre><code>2021-09-11T15:07:02.974994+08:00\n rfs (PID:48850): Selected LNO:12 for T-1.S-420302 dbid 4207424032 branch 1007720356\n2021-09-11T15:07:03.050442+08:00\nARC2 (PID:29688): Archived Log entry 533128 added for T-1.S-420301 ID 0xfae8807e LAD:1\n2021-09-11T15:07:03.235054+08:00\nPR00 (PID:30407): Media Recovery Waiting for T-1.S-420302 (in transit)\n2021-09-11T15:07:03.235977+08:00\nRecovery of Online Redo Log: Thread 1 Group 12 Seq 420302 Reading mem 0\n  Mem# 0: \/dbData\/OracleArch\/LZUDG\/onlinelog\/group_12.890.1009669475\n<\/code><\/pre>\n<ul>\n<li>CLIENT_PROCESS \u5bf9\u5e94 Primary \u6570\u636e\u5e93\u4e2d\u7684\u8fdb\u7a0b\u5982 ARCH\\LGWR\u7b49<\/li>\n<li>SEQUENCE#\uff1a\u5f52\u6863\u5e8f\u53f7<\/li>\n<li>STATUS \u5f53\u524d\u8fdb\u7a0b\u72b6\u6001\uff1a<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u8fdb\u7a0b\u72b6\u6001\u540d\u79f0<\/th>\n<th style=\"text-align: left;\">\u8fdb\u7a0b\u72b6\u6001\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">CONNECTED<\/td>\n<td style=\"text-align: left;\">\u5df2\u8fde\u63a5\u81f3 PRIMARY \u6570\u636e\u5e93<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">ALLOCATED<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u51c6\u5907\u8fde\u63a5PRIMARY\u6570\u636e\u5e93<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">ATTACHED<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u8fde\u63a5PRIMARY\u6570\u636e\u5e93<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">IDLE<\/td>\n<td style=\"text-align: left;\">\u7a7a\u95f2\u4e2d<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">RECEIVING<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u63a5\u6536\u5f52\u6863\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">OPENNING<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u5904\u7406\u5f52\u6863\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">CLOSING<\/td>\n<td style=\"text-align: left;\">\u5f52\u6863\u6587\u4ef6\u5df2\u5904\u7406\u5b8c\uff0c\u6536\u5c3e\u4e2d<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">WRITING<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u5411\u5f52\u6863\u6587\u4ef6\u4e2d\u5199\u5165redo\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">WAIT_FOR_LOG<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u7b49\u5f85\u65b0\u7684REDO\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">WAIT_FOR_GAP<\/td>\n<td style=\"text-align: left;\">\u5f52\u6863\u53d1\u751f\u4e2d\u65ad\uff0c\u6b63\u5728\u7b49\u5f85\u65b0\u7684REDO \u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">APPLYING_LOG<\/td>\n<td style=\"text-align: left;\">\u6b63\u5728\u5e94\u7528REDO\u6570\u636e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span class=\"ez-toc-section\" id=\"4_%E6%A3%80%E6%9F%A5%E5%A4%87%E5%BA%93%E6%97%A5%E5%BF%97%E5%BA%94%E7%94%A8%E7%9A%84%E6%83%85%E5%86%B5\"><\/span>4. \u68c0\u67e5\u5907\u5e93\u65e5\u5fd7\u5e94\u7528\u7684\u60c5\u51b5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SELECT registrar,\n       creator,\n       thread#,\n       applied,\n       sequence#,\n       first_change#,\n       next_change#,\n       completion_timE\n  FROM v$archived_log\n WHERE completion_time &gt; TRUNC(SYSDATE);<\/code><\/pre>\n<p>\u65e5\u5fd7\u5e94\u7528\u7684\u65e5\u671f\u8303\u56f4\u81ea\u5df1\u624b\u52a8\u8c03\u6574.<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_3b98549f1f2e160e7fd0ee4d407e3d79.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_3b98549f1f2e160e7fd0ee4d407e3d79.jpg\" alt=\"\" \/><\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"5_%E6%A3%80%E6%9F%A5real-time_apply_%E5%BA%94%E7%94%A8%E6%97%A5%E5%BF%97%E7%9A%84%E8%BF%9B%E5%BA%A6\"><\/span>5. \u68c0\u67e5real-time apply \u5e94\u7528\u65e5\u5fd7\u7684\u8fdb\u5ea6<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SET feed off\nSET lines 300\nSET pages 999\nSELECT to_char(sysdate, &#039;yyyymmdd hh24:mi:ss&#039;) ctime,\n       name,\n       value,\n       datum_time\n  FROM v$dataguard_stats\n WHERE NAME LIKE &#039;%lag&#039;;<\/code><\/pre>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_b5ffb53ed4938066036d801025beba91.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_b5ffb53ed4938066036d801025beba91.jpg\" alt=\"\" \/><\/a><br \/>\n<span style='color:red'><br \/>\n\u5176\u4e2d\u5982\u679capply lag\u5bf9\u5e94\u7684value\u5927\u4e8e0\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u6ce8\u610f\u68c0\u67e5\u662f\u5426\u540c\u6b65\u6b63\u5e38\u3002\u5982\u679c\u76f8\u5dee\u65f6\u95f4\u975e\u5e38\u591a\uff0cvalue\u503c\u7b49\u4e8e\u51e0\u5206\u949f\uff0c\u751a\u81f3\u8fbe\u52301\u4e2a\u5c0f\u65f6\uff0c\u90a3\u53ef\u80fd\u5b9e\u65f6\u540c\u6b65\u6709\u95ee\u9898\uff0c\u9700\u8981\u68c0\u67e5 alert log \u6587\u4ef6\uff0c\u5176\u4e2d\u4f1a\u63d0\u793a\u662f\u5426\u542f\u52a8\u4e86real time apply\u3002<br \/>\n<\/span><\/p>\n<p>\u5982\u679c\u5df2\u7ecf\u542f\u52a8\u4e86real time apply,apply lag \u8fd8\u662f\u5e38\u5e38\u5927\u4e8e0\uff0c\u90a3\u4e48\u53ef\u80fd\u662fDG\u4e0astandby redo log \u7684\u95ee\u9898\uff0c\u5982\u679cstandby redo log\u589e\u52a0\u4e0d\u6b63\u786e\uff0c\u90a3\u4e48\u53ef\u4ee5\u5728alert log\u4e2d\u627e\u5230\u7c7b\u4f3c\u5982\u4e0b\u7684\u8bed\u53e5\uff1a<\/p>\n<pre><code>RFS[1]: No Standby redo logfiles created for thread 1<\/code><\/pre>\n<p>\u90a3\u4e48\u53ef\u80fd\u662fstandby redo log\u6ca1\u6709\u5728DG\u4e0a\u521b\u5efa\uff0c\u4e5f\u6709\u53ef\u80fd\u521b\u5efa\u4e86\uff0c\u4f46\u662fthread\u9519\u8bef\u5bfc\u81f4\u3002 \u53ef\u4ee5\u901a\u8fc7\u67e5\u770b<\/p>\n<pre><code class=\"language-sql\">set lines 200 pages 9999 LONG 5000\ncol member for a80\nSELECT a.thread#,a.group#,b.member,b.type,a.bytes\/1024\/1024 MB, a.sequence#, a.status\n  FROM v$log a,v$logfile b\n WHERE a.group# = b.group#\n UNION ALL\nSELECT a.thread#,a.group#,b.member,b.type,a.bytes\/1024\/1024 MB, a.sequence#, a.status\n  FROM v$standby_log a,v$logfile b\n WHERE a.group# = b.group#;<\/code><\/pre>\n<p><span style='color:red'><br \/>\n\u5982\u679c\u521b\u5efa\u4e86standby redo log , \u90a3\u4e48\u5728\u5e94\u7528redo\u65f6\uff0c\u4e00\u5b9a\u6709\u81f3\u5c111\u4e2astandby redo log\u7684\u72b6\u6001\u662f ACTIVE \u7684\uff0c\u5176\u4ed6\u5927\u591a\u6570\u662f unassigned . \u5982\u679c\u90fd\u662f UNASSIGNED \uff0c\u90a3\u4e48\u5c31\u662fstandby redo log\u7684\u95ee\u9898\u3002<br \/>\n<\/span><\/p>\n<h4><span class=\"ez-toc-section\" id=\"6_%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E6%9C%89GAP\"><\/span>6. \u68c0\u67e5\u662f\u5426\u6709GAP<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-sql\">SELECT *\n  FROM v$archive_gap;<\/code><\/pre>\n<p>\u7269\u7406\u5907\u5e93\u4e0a\u7684 <code>V$ARCHIVE_GAP<\/code> \u56fa\u5b9a\u89c6\u56fe\u53ea\u8fd4\u56de\u5f53\u524d\u963b\u6b62\u91cd\u505a\u5e94\u7528\u7ee7\u7eed\u7684\u4e0b\u4e00\u4e2a\u95f4\u9699<br \/>\n\u4e0a\u4e00\u523b\u5907\u5e93\u662f\u6ca1\u6709GAP\u7684\uff0c\u4f46\u662f\u4e0b\u4e00\u79d2\u4e2d\u5374\u51fa\u73b0\u4e86GAP\uff1a<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_e89465ae5e509cdad9c7467f000ece91.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_e89465ae5e509cdad9c7467f000ece91.jpg\" alt=\"\" \/><\/a><br \/>\n\u5728\u89e3\u51b3\u6807\u8bc6\u7684\u95f4\u9699\uff08GAP\uff09\u5e76\u542f\u52a8redo apply\u4e4b\u540e\uff0c\u518d\u6b21\u67e5\u8be2\u7269\u7406\u5907\u7528\u6570\u636e\u5e93\u4e0a\u7684 <code>V$ARCHIVE_gap<\/code> \u89c6\u56fe\uff0c\u4ee5\u786e\u5b9a\u4e0b\u4e00\u4e2a\u95f4\u9699\u5e8f\u5217\uff08\u5982\u679c\u6709\uff09\u3002\u91cd\u590d\u6b64\u8fc7\u7a0b\uff0c\u76f4\u5230\u6ca1\u6709\u66f4\u591a\u95f4\u9699\u3002<\/p>\n<pre><code class=\"language-sql\">WITH prod AS\n (SELECT dest_id, MAX(sequence#) AS seq\n    FROM v_$archived_log\n   WHERE resetlogs_time = (SELECT resetlogs_time FROM v_$database)\n GROUP BY dest_id),\nstby AS\n (SELECT MAX(sequence#) AS seq, dest_id dest_id\n    FROM v_$archived_log\n   WHERE first_change# &gt; (SELECT resetlogs_change# FROM v_$database)\n     AND applied = &#039;YES&#039;\n     AND dest_id IN (1, 2)\n   GROUP BY dest_id)\nSELECT prod.seq - stby.seq, stby.dest_id\n  FROM prod, stby\n WHERE prod.dest_id = stby.dest_id;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u67e5\u770b\u5907\u5e93\uff08\u6216\u8005\u4e3b\u5e93\uff09\u7684\u72b6\u6001 SET feed&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,69],"class_list":{"0":"post-502","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-oracle","8":"tag-dataguard","9":"tag-oracle","10":"tag-69"},"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/502","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=502"}],"version-history":[{"count":22,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions"}],"predecessor-version":[{"id":1553,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions\/1553"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}