{"id":15,"date":"2020-10-14T13:47:44","date_gmt":"2020-10-14T05:47:44","guid":{"rendered":"https:\/\/www.db2go.net\/?p=15"},"modified":"2020-10-22T10:15:20","modified_gmt":"2020-10-22T02:15:20","slug":"adg-1%e6%8b%96n%e5%88%87%e6%8d%a2%e5%a1%ab%e5%9d%91%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/www.db2go.net\/?p=15","title":{"rendered":"adg-1\u62d6N\u5207\u6362\u586b\u5751\u8bb0\u5f55"},"content":{"rendered":"<p>\u586b\u4e86\u5982\u4e0b\u51e0\u4e2a\u5751\uff1a<\/p>\n<p>1.\u65b0\u7684\u4e3b\u5e93\u5982\u679c\u5bf9\u5176\u4ed6\u7684\u5907\u5e93\u4e0d\u80fdping\u7684\u8bdd,\u9700\u8981\u5c06fal_Server \u548c log_arhive_config\u4e2d\u6d89\u53ca\u5230\u7684\u5907\u5e93\u7684\u540d\u5b57\u53bb\u6389<\/p>\n<p>2.\u65b0\u7684\u4e3b\u5e93\u7684log_archive_dest_n\u53bb\u6389\u4e0d\u80fdping\u901a\u7684\u5907\u5e93<\/p>\n<p>3.\u4e3b\u5e93\u67e5\u770b\u5907\u5e93\u4f20\u8f93\u7684\u72b6\u6001<\/p>\n<pre><code class=\"language-sql line-numbers\">select error,dest_id frm v$archive_dest where rownum &lt; 6;\n<\/code><\/pre>\n<p>\u5982\u679c\u6709\u9519\u8bef\u63d0\u793a,\u5982ORA-16191,\u90a3\u8bf4\u660e\u662f\u5bc6\u7801\u7684\u95ee\u9898<br \/>\n\u53ef\u4ee5\u5c06\u4e3b\u5e93\u7684\u5bc6\u7801\u5237\u65b0\u540e,\u518d\u5168\u90e8\u91cd\u65b0\u4f20\u8f93\u4e00\u6b21\u5230\u6240\u6709\u7684\u4e3b\u5907\u5e93\u4e0a<br \/>\n\u5237\u65b0\u7684\u65b9\u6cd5\u5e94\u8be5\u91c7\u7528<code>alter user sys identified by xxx<\/code>,\u800c\u4e0d\u662f\u53bborapwd,\u56e0\u4e3a\u4fee\u6539\u4e86\u5bc6\u7801\u4f1a\u81ea\u52a8\u540c\u6b65\u5230\u5bc6\u7801\u6587\u4ef6\u4e5f\u540c\u65f6\u4f1a\u66f4\u65b0\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u5b57\u5178<br \/>\n\u4fee\u6539\u5b8c\u6210\u540e,\u518d\u53bb\u5c06\u76f8\u5e94\u7684\u5f52\u6863\u8def\u5f84\u7684state\u5148\u6539\u4e3adefer,\u518d\u6539\u4e3aenable,\u9694\u51e0\u5341\u79d2\u518d\u53bb\u6267\u884c<\/p>\n<pre><code class=\"language-sql line-numbers\">select error,dest_id frm v$archive_dest where rownum &lt; 6;\n<\/code><\/pre>\n<p>\u67e5\u770berror\u662f\u5426\u6d88\u9664<\/p>\n<p>4.\u4e3b\u5e93\u7684switchover_status\u4e3a<code>RESOLVABLE GAP<\/code>\u8bf4\u660e\u4e3b\u5e93\u548c\u5907\u5e93\u4e4b\u95f4\u5b58\u5728\u6570\u636e\u6ca1\u6709\u540c\u6b65,\u9700\u8981\u5148\u89e3\u51b3\u4e86\u624d\u80fd\u8fdb\u53bb\u5207\u6362<\/p>\n<p>\u6709\u51e0\u4e2a\u72b6\u6001:<br \/>\n&#8211; <code>NOT ALLOWED<\/code> &#8211; On a primary database, this status indicates that there are no valid and enabled standby databases. On a standby database, this status indicates that a switchover request has not been received from the primary database.<\/p>\n<ul>\n<li><code>SESSIONS ACTIVE<\/code> &#8211; The database has active sessions. On a physical standby database, the WITH SESSION SHUTDOWN SQL clause must be specified to perform a role transition while in this state. On a logical standby database, a role transition can be performed while in this state, but the role transition will not complete until all current transactions have committed.<\/p>\n<\/li>\n<li>\n<p><code>SWITCHOVER PENDING<\/code> &#8211; On a physical standby database, this status indicates that a switchover request has been received from the primary database and is being processed. A physical standby database cannot switch to the primary role while in this transient state.<\/p>\n<\/li>\n<li>\n<p><code>SWITCHOVER LATENT<\/code> &#8211; On a physical standby database, this status indicates that a switchover request was pending, but the original primary database has been switched back to the primary role.<\/p>\n<\/li>\n<li>\n<p><code>TO PRIMARY<\/code> &#8211; The database is ready to switch to the primary role.<\/p>\n<\/li>\n<li>\n<p><code>TO STANDBY<\/code> &#8211; The database is ready to switch to either the physical or logical standby role.<\/p>\n<\/li>\n<li>\n<p><code>TO LOGICAL STANDBY<\/code> &#8211; The database has received a data dictionary from a logical standby database and is ready to switch to the logical standby role.<\/p>\n<\/li>\n<li>\n<p><code>RECOVERY NEEDED<\/code> &#8211; On a physical standby database, this status indicates that additional redo must be applied before the database can switch to the primary role.<\/p>\n<\/li>\n<li>\n<p><code>PREPARING SWITCHOVER<\/code> &#8211; On a primary database, this status indicates that a data dictionary is being received from a logical standby database in preparation for switching to the logical standby role. On a logical standby database, this status indicates that the data dictionary has been sent to the primary database and other standby databases.<\/p>\n<\/li>\n<li>\n<p><code>PREPARING DICTIONARY<\/code> &#8211; On a logical standby database, this status indicates that the data dictionary is being sent to the primary database and other standby databases in preparation for switching to the primary role.<\/p>\n<\/li>\n<li>\n<p><code>FAILED DESTINATION<\/code> &#8211; On a primary database, this status indicates that one or more standby destinations are in an error state.<\/p>\n<\/li>\n<li>\n<p><code>RESOLVABLE GAP<\/code> &#8211; On a primary database, this status indicates that one or more standby databases have a redo gap that can be automatically resolved by fetching the missing redo from the primary database or from another standby database.<\/p>\n<\/li>\n<li>\n<p><code>UNRESOLVABLE GAP<\/code> &#8211; On a primary database, this status indicates that one or more standby databases have a redo gap that cannot be automatically resolved by fetching the missing redo from the primary database or from another standby database.<\/p>\n<\/li>\n<li>\n<p><code>LOG SWITCH GAP<\/code> &#8211; On a primary database, this status indicates that one or more standby databases are missing redo due to a recent log switch.<\/p>\n<\/li>\n<\/ul>\n<p>\u89e3\u51b3\u529e\u6cd5\u53ef\u4ee5\u5148\u53c2\u8003\u7b2c3\u6761,\u5982\u679c\u6ca1\u95ee\u9898\u4e86,\u90a3\u4e48\u53bb\u67e5\u8be2\u4e3b\u5907\u5e93\u7684\u6700\u5927\u65e5\u5fd7\u53f7\u662f\u5426\u4e00\u6837<\/p>\n<pre><code class=\"language-sql line-numbers\">select max(sequence#),inst_id from gv$archived_log group by inst_id;\n<\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u4e00\u81f4,\u53ef\u4ee5\u770b\u770b\u4e3b\u5907\u5e93\u7684alert\u65e5\u5fd7\u62a5\u4ec0\u4e48\u9519<br \/>\n\u5982\u679c\u4e00\u81f4\u4e86,\u53bb\u67e5\u5907\u5e93\u7684alert\u65e5\u5fd7,\u662f\u5426\u6709<code>media recovery<\/code>\u4e4b\u7c7b\u7684\u63d0\u793a,\u5982\u679c\u6709,\u8bf4\u660e\u5728\u5b9e\u65f6\u6062\u590d\u6ca1\u5982\u679c\u6ca1\u6709\u8bf4\u660e\u6ca1\u6709\u5b9e\u65f6\u5e94\u7528\u65e5\u5fd7\u8fdb\u884c\u6062\u590d.<br \/>\n\u8fd9\u4e2a\u65f6\u5019\u53bb\u67e5<\/p>\n<pre><code class=\"language-sql line-numbers\">select open_mode from v$database;\n<\/code><\/pre>\n<p>\u67e5\u770b\u662f\u5426\u5f00\u542f\u4e86\u5b9e\u65f6\u5e94\u7528,\u4ee5\u53ca\u67e5\u770bmrp\u8fdb\u7a0b\u662f\u5426\u5b58\u5728<\/p>\n<p>\u5982\u679c\u4f9d\u7136\u6709\u6b63\u786e,\u90a3\u5c31\u662f\u770b\u770blag\u6709\u591a\u5c11\u5ef6\u8fdf<\/p>\n<pre><code class=\"language-sql line-numbers\">set linesize 200\ncol ctime format a20\ncol value format a20\nselect to_char(SYSDATE,'yyyymmdd hh24:mi:ss') CTIME,NAME,VALUE,DATUM_TIME from V$DATAGUARD_STATS WHERE NAME LIKE '%lag';\n<\/code><\/pre>\n<p>\u6b63\u5e38\u7684\u5e94\u8be5\u662f0,\u4e0d\u6b63\u5e38\u7684\u5c31\u4f1a\u663e\u793a\u6709\u591a\u5c11\u5206\u591a\u5c11\u79d2\u7684\u5ef6\u8fdf.<br \/>\n\u8fd9\u4e2a\u65f6\u5019\u53bb\u67e5\u4e0b\u5907\u5e93\u7684standby redo log\u7684\u7ec4\u6570\u662f\u4e0d\u662f\u4e0d\u5bf9,RAC\u73af\u5883\u6709\u53ef\u80fd\u662f\u56e0\u4e3athread\u4e24\u8fb9\u7684\u7ec4\u6570\u4e0d\u4e00\u81f4.<br \/>\n\u5982\u679c\u4ee5\u4e0a\u518d\u6ca1\u6709\u95ee\u9898,\u90a3\u4e48\u5c31\u53ea\u6709\u91c7\u53d6\u7ec8\u6781\u5927\u6cd5,\u91cd\u542f\u5907\u5e93\u4e86!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u586b\u4e86\u5982\u4e0b\u51e0\u4e2a\u5751\uff1a 1.\u65b0\u7684\u4e3b\u5e93\u5982\u679c\u5bf9\u5176\u4ed6\u7684\u5907\u5e93\u4e0d\u80fdping\u7684\u8bdd,\u9700\u8981\u5c06fal_Server \u548c log_arh&hellip;<\/p>\n <a href=\"https:\/\/www.db2go.net\/?p=15\" title=\"adg-1\u62d6N\u5207\u6362\u586b\u5751\u8bb0\u5f55\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">adg-1\u62d6N\u5207\u6362\u586b\u5751\u8bb0\u5f55<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[4],"tags":[],"class_list":["entry","author-suredandan","post-15","post","type-post","status-publish","format-standard","category-oracle"],"views":1617,"_links":{"self":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":2,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}