{"id":1443,"date":"2018-07-03T09:40:45","date_gmt":"2018-07-03T01:40:45","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=1443"},"modified":"2019-05-03T09:44:27","modified_gmt":"2019-05-03T01:44:27","slug":"dataguard%e7%ae%a1%e7%90%86%e6%93%8d%e4%bd%9c%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=1443","title":{"rendered":"DataGuard\u7ba1\u7406\u64cd\u4f5c\u547d\u4ee4"},"content":{"rendered":"<p>1.\u76f8\u5173\u8fdb\u7a0b:<br \/>\n1.RFS(Remote File Server Process):\u63a5\u6536\u7531Primary\u6570\u636e\u5e93\u7684lgwr\u6216arch\u901a\u8fc7Oracle Net\u4f20\u6765\u7684redo\u6570\u636e,\u5199\u5165standby redo logs\u6216standby archived redo logs;<br \/>\n2.MRP(Managed Recovery Process):\u7ba1\u7406\u6062\u590d\u8fdb\u7a0b;<br \/>\n3.FAL(Fetch Archive Log):\u5728Primary\u548cStandby\u6570\u636e\u5e93\u7684\u4e24\u7aef\u540c\u65f6\u914d\u7f6e;Primary\u7aef\u662ffetch archive log server,standby\u7aef\u662ffetch archive log client,FAL\u662f\u81ea\u52a8\u63a2\u6d4bPrimary\/Standby\u6570\u636e\u5e93\u4e4b\u95f4archived logs\u662f\u5426\u6709\u6709\u95f4\u9694\u7684\u4e00\u4e2a\u8fdb\u7a0b;<br \/>\n2.\u4e3b\u5907\u5e93\u5207\u6362:<br \/>\n1.\u4e3b\u5e93\u5207\u5230\u5907\u5e93(SWITCHOVER):<br \/>\nALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;<br \/>\nSTARTUP NOMOUNT;<br \/>\nALTER DATABASE MOUNT STANDBY DATABASE;<br \/>\nSELECT name, open_mode, protection_mode, database_role, switchover_status from v$DATABASE;<br \/>\nALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;<br \/>\n2.\u5907\u5e93\u5207\u5230\u4e3b\u5e93(SWITCHOVER):<br \/>\nALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;<br \/>\nSTARTUP<br \/>\nSELECT name, open_mode, protection_mode, database_role, switchover_status from v$DATABASE;<br \/>\n3.FAILOVER\u5207\u6362:<br \/>\nALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;<br \/>\nALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;<br \/>\nALTER DATABASE OPEN;<br \/>\nSELECT name, open_mode, protection_mode, database_role, switchover_status from v$DATABASE;<br \/>\n3.\u5207\u6362\u6570\u636e\u5e93\u6a21\u5f0f:<br \/>\nSTARTUP IMMEDIATE;<br \/>\nSTARTUP MOUNT;<br \/>\nALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE\/AVAILABILITY\/PROTECTION;<br \/>\nALTER DATABASE OPEN;<br \/>\n4.\u6d4b\u8bd5Primary\u7684\u5f52\u6863\u80fd\u5426\u5e94\u7528\u5230Standby:<br \/>\n1.\u67e5\u770bv$archive_gap:SELECT * FROM v$archive_gap;<br \/>\n2.ARCHIVE LOG LIST;<br \/>\n5.\u7ba1\u7406\u64cd\u4f5c:<br \/>\n1.\u505c\u6b62Standby:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;STARTUP IMMEDIATE;<br \/>\n2.\u5207\u6362\u5230\u53ea\u8bfb\u6a21\u5f0f:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;ALTER DATABASE OPEN READ ONLY;<br \/>\n3.\u5207\u6362\u5230\u7ba1\u7406\u6062\u590d\u6a21\u5f0f:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE [PARALLEL 8] [USING CURRENT LOGFILE] DISCONNECT FROM SESSION;<br \/>\n4.\u67e5\u8be2\u5907\u673a\u5f52\u6863\u65e5\u5fd7\u5e94\u7528\u60c5\u51b5:SELECT sequence#, applied FROM v$archived_log;<br \/>\n5.\u5728\u4e3b\u5e93\u4e0a\u5f52\u6863\u5f53\u524d\u65e5\u5fd7:ALTER SYSTEM ARCHIVE LOG CURRENT;<br \/>\n6.\u8bbe\u7f6e\u5f52\u6863\u9891\u7387,\u5f3a\u5236Primary\u4e00\u5206\u79cd\u5f52\u6863\u4e00\u6b21:ALTER SYSTEM SET ARCHIVE_LAG_TARGET=60 SCOPE=BOTH;<br \/>\n6.\u6ce8\u610f\u4e8b\u9879:<br \/>\n1.\u5982\u679c\u5728\u4e3b\u5e93\u6267\u884cALTER DATABASE CLEAR UNARCHIVED LOGFILE\u6216ALTER DATABASE OPEN RESETLOGS,\u5219DataGuard\u8981\u91cd\u5efa;<br \/>\n2.\u51fa\u73b0\u5f52\u6863\u65e5\u5fd7gap\u65f6,\u9700\u8981\u627e\u51fa\u76f8\u5e94\u7684\u5f52\u6863\u65e5\u5fd7,\u7136\u540e\u5c06\u8fd9\u4e9b\u5f52\u6863\u65e5\u5fd7copy\u5230\u5907\u7528\u8282\u70b9\u7684standby_archive_dest\u548clog_archive_dest\u76ee\u5f55\u4e0b\u9762;\u9700\u8981\u6ce8\u610f\u7684\u662flog_archive_dest\u76ee\u5f55\u4e0b\u4e5f\u9700\u8981copy,\u7136\u540eALTER DATABASE RECOVER AUTOMATIC STANDBY DATABASE;<br \/>\n3.\u65b0\u5efa\u8868\/\u8868\u7a7a\u95f4\/datafile\u90fd\u80fd\u901a\u8fc7\u65e5\u5fd7\u5e94\u7528\u5230\u5907\u5e93,\u4f46\u65b0\u5efa\u4e00\u4e2a\u4e34\u65f6\u8868\u7a7a\u95f4\/rename datafile\u5747\u4e0d\u80fd\u5e94\u7528\u5230\u5907\u5e93\u4e0a;<br \/>\n4.\u5e94\u5f53\u5b9e\u65f6\u5bdf\u770bstandby\u5e93\u7684alert\u6587\u4ef6,\u5c31\u80fd\u6e05\u6670\u660e\u4e86\u5730\u77e5\u9053\u4e3b\u5907\u66f4\u65b0\u7684\u60c5\u51b5,\u8fd9\u4e5f\u662f\u6392\u9519\u7684\u91cd\u8981\u65b9\u6cd5;<br \/>\n7.\u76f8\u5173\u89c6\u56fe:<br \/>\nDBA_LOGSTDBY_EVENTS (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_LOG (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_NOT_UNIQUE (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_PARAMETERS (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_PROGRESS (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_SKIP (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_SKIP_TRANSACTION (Logical Standby Databases Only)<br \/>\nDBA_LOGSTDBY_UNSUPPORTED (Logical Standby Databases Only)<br \/>\nV$ARCHIVE_DEST<br \/>\nV$ARCHIVE_DEST_STATUS<br \/>\nV$ARCHIVE_GAP<br \/>\nV$ARCHIVED_LOG<br \/>\nV$DATABASE<br \/>\nV$DATAFILE<br \/>\nV$DATAGUARD_STATUS<br \/>\nV$LOG<br \/>\nV$LOGFILE<br \/>\nV$LOG_HISTORY<br \/>\nV$LOGSTDBY (Logical Standby Databases Only)<br \/>\nV$LOGSTDBY_STATS (Logical Standby Databases Only)<br \/>\nV$MANAGED_STANDBY (Physical Standby Databases Only)<br \/>\nV$STANDBY_LOG<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u76f8\u5173\u8fdb\u7a0b: 1.RFS(Remote File Server Process):\u63a5\u6536\u7531Primary\u6570\u636e\u5e93 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1443","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1443"}],"version-history":[{"count":1,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions"}],"predecessor-version":[{"id":1444,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions\/1444"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1443"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}