{"id":5182,"date":"2021-06-03T08:50:19","date_gmt":"2021-06-03T08:50:19","guid":{"rendered":"https:\/\/swiv.com.br\/converting-a-snapshot-database-into-a-physical-standby-database-using-sql-plus\/"},"modified":"2026-05-27T20:02:31","modified_gmt":"2026-05-27T19:02:31","slug":"converting-a-snapshot-database-into-a-physical-standby-database-using-sql-plus","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/06\/03\/converting-a-snapshot-database-into-a-physical-standby-database-using-sql-plus\/","title":{"rendered":"Converting a Snapshot Database into a Physical Standby Database (using SQL *Plus)"},"content":{"rendered":"\n<p>A convers\u00e3o em quest\u00e3o \u00e9 extremamente simples, uma vez que todos os Redos enviados pelo primary estejam j\u00e1 no ambiente Standby. Assim, durante o processo, o GRP ser\u00e1 usado e os Redos, aplicados.<\/p>\n\n\n\n<p>Validando ambientes que ser\u00e3o usados neste artigo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nPrimary:\n \n&#x5B;oracle@fornix1 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 3 05:39:07 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.3.0.0.0\n \nSQL&gt; SELECT DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE FROM V$DATABASE;\n \nDB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE\n------------------------------ ---------------- --------------------\ncortex                         PRIMARY          READ WRITE\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSnapshot:\n \n&#x5B;oracle@fornix2 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 3 05:40:13 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.3.0.0.0\n \nSQL&gt; SELECT DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE FROM V$DATABASE;\n \nDB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE\n------------------------------ ---------------- --------------------\ncortexDR                       SNAPSHOT STANDBY READ WRITE\n<\/pre><\/div>\n\n\n<p>Montando o Snapshot Database:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SHU IMMEDIATE;\nDatabase closed.\nDatabase dismounted.\nORACLE instance shut down.\nSQL&gt; STARTUP MOUNT;\nORACLE instance started.\n \nTotal System Global Area 2583690520 bytes\nFixed Size                  8899864 bytes\nVariable Size             553648128 bytes\nDatabase Buffers         2013265920 bytes\nRedo Buffers                7876608 bytes\nDatabase mounted.\n<\/pre><\/div>\n\n\n<p>Emitindo comando para a convers\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER DATABASE CONVERT TO PHYSICAL STANDBY;\n \nDatabase altered.\n<\/pre><\/div>\n\n\n<p>O alert nos reporta informa\u00e7\u00f5es interessantes sobre o processo em si:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n2021-06-03 05:44:35.545000 -03:00\nALTER DATABASE CONVERT TO PHYSICAL STANDBY\nALTER DATABASE CONVERT TO PHYSICAL STANDBY (CORTEXDR)\n.... (PID:8900): Killing 2 processes (PIDS:8917,8919) (all RFS) in order to disallow current and future RFS connections. Requested by OS process 8900\nProcess termination requested for pid 8917 &#x5B;source = rdbms], &#x5B;info = 2] &#x5B;request issued by pid: 8900, uid: 54321]\nProcess termination requested for pid 8919 &#x5B;source = rdbms], &#x5B;info = 2] &#x5B;request issued by pid: 8900, uid: 54321]\n2021-06-03 05:44:37.879000 -03:00\nFlashback Restore Start\n2021-06-03 05:44:39.381000 -03:00\nFlashback Restore Complete\nDrop guaranteed restore point\nGuaranteed restore point  dropped\n.... (PID:8900): Database role cleared from SNAPSHOT STANDBY &#x5B;kcvs.c:8837]\nClearing standby activation ID 584140392 (0x22d14668)\nThe primary database controlfile was created using the\n&#039;MAXLOGFILES 16&#039; clause.\nThere is space for up to 13 standby redo logfiles\nUse the following SQL commands on the standby database to create\nstandby redo logfiles that match the primary database:\nALTER DATABASE ADD STANDBY LOGFILE &#039;srl1.f&#039; SIZE 209715200;\nALTER DATABASE ADD STANDBY LOGFILE &#039;srl2.f&#039; SIZE 209715200;\nALTER DATABASE ADD STANDBY LOGFILE &#039;srl3.f&#039; SIZE 209715200;\nALTER DATABASE ADD STANDBY LOGFILE &#039;srl4.f&#039; SIZE 209715200;\n.... (PID:8900): Database role changed from PRIMARY to PHYSICAL STANDBY &#x5B;kcvs.c:8842]\n.... (PID:8900): RT: Role transition work is not done\n.... (PID:8900): Redo network throttle feature is disabled at mount time\nPhysical Standby Database mounted.\nIn-memory operation on ADG is currently only supported on Engineered systems and PaaS.\ninmemory_adg_enabled is turned off automatically.\nPlease contact our support team for EXADATA solutions\nCONVERT TO PHYSICAL STANDBY: Complete - Database mounted as physical standby\nCompleted: ALTER DATABASE CONVERT TO PHYSICAL STANDBY\n rfs (PID:8975): Primary database is in MAXIMUM PERFORMANCE mode\n rfs (PID:8975): Selected LNO:4 for T-1.S-101 dbid 548968087 branch 1039033628\n<\/pre><\/div>\n\n\n<p>No primary, gerando um novo Redo e checando a sua sequence:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE FROM V$DATABASE;\n \nDB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE\n------------------------------ ---------------- --------------------\ncortex                         PRIMARY          READ WRITE\n \nSQL&gt; ALTER SYSTEM SWITCH LOGFILE ;\n \nSystem altered.\n \nSQL&gt; SELECT THREAD#, MAX(SEQUENCE#) FROM V$LOG GROUP BY THREAD# ;\n \n   THREAD# MAX(SEQUENCE#)\n---------- --------------\n         1            102\n<\/pre><\/div>\n\n\n<p>No standby, j\u00e1 \u00e9 poss\u00edvel ver o reflexo da convers\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT PROCESS,STATUS,SEQUENCE# FROM V$MANAGED_STANDBY;\n \nPROCESS   STATUS        SEQUENCE#\n--------- ------------ ----------\nARCH      CONNECTED             0\nDGRD      ALLOCATED             0\nDGRD      ALLOCATED             0\nARCH      CONNECTED             0\nARCH      CONNECTED             0\nARCH      CLOSING             101\nRFS       IDLE                  0\nRFS       IDLE                102\n \n8 rows selected.\n \nSQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;\n \nDatabase altered.\n \nSQL&gt; SELECT PROCESS,STATUS,SEQUENCE# FROM V$MANAGED_STANDBY;\n \nPROCESS   STATUS        SEQUENCE#\n--------- ------------ ----------\nARCH      CONNECTED             0\nDGRD      ALLOCATED             0\nDGRD      ALLOCATED             0\nARCH      CONNECTED             0\nARCH      CONNECTED             0\nARCH      CLOSING             101\nRFS       IDLE                  0\nRFS       IDLE                102\nMRP0      APPLYING_LOG        102\n \n9 rows selected.\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A convers\u00e3o em quest\u00e3o \u00e9 extremamente simples, uma vez que todos os Redos enviados pelo primary estejam j\u00e1 no ambiente Standby. Assim, durante o processo, o GRP ser\u00e1 usado e os Redos, aplicados. Validando ambientes que ser\u00e3o usados neste artigo: Montando o Snapshot Database: Emitindo comando para a convers\u00e3o: O alert nos reporta informa\u00e7\u00f5es interessantes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-5182","post","type-post","status-publish","format-standard","hentry","category-high-availability"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=5182"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5182\/revisions"}],"predecessor-version":[{"id":9112,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5182\/revisions\/9112"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=5182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=5182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=5182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}