zoukankan      html  css  js  c++  java
  • oracle 19c 主备切换

    主库:

    SQL> alter database commit to switchover to physical standby with session shutdown;
    
    Database altered.
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area 2466250400 bytes
    Fixed Size                  9137824 bytes
    Variable Size             536870912 bytes
    Database Buffers         1912602624 bytes
    Redo Buffers                7639040 bytes
    Database mounted.
    Database opened.
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    ------------------------------------------------------------
    READ ONLY
    
    SQL>  select name,database_role,switchover_status from v$database;
    
    NAME                        DATABASE_ROLE                                    SWITCHOVER_STATUS
    --------------------------- ------------------------------------------------ ------------------------------------------------------------
    MTXDB                       PHYSICAL STANDBY                                 RECOVERY NEEDED
    
    SQL>  alter database recover managed standby database disconnect from session;
    
    Database altered.
    
    SQL> select name,database_role,switchover_status from v$database;
    
    NAME                        DATABASE_ROLE                                    SWITCHOVER_STATUS
    --------------------------- ------------------------------------------------ ------------------------------------------------------------
    MTXDB                       PHYSICAL STANDBY                                 NOT ALLOWED


    SQL> SELECT UNIQUE THREAD#, MAX(SEQUENCE#) OVER(PARTITION BY THREAD#) LAST FROM v$archived_log;

       THREAD#       LAST
    ---------- ----------
             1         39

    备库:

    SQL> alter database commit to switchover to primary;
    
    Database altered.
    
    SQL> alter database open;
    
    Database altered.
    
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    ------------------------------------------------------------
    READ WRITE
    
    SQL> select name,database_role,switchover_status from v$database;
    
    NAME                        DATABASE_ROLE                                    SWITCHOVER_STATUS
    --------------------------- ------------------------------------------------ ------------------------------------------------------------
    MTXDB                       PRIMARY                                          TO STANDBY
    
    SQL> SELECT UNIQUE THREAD#, MAX(SEQUENCE#) OVER(PARTITION BY THREAD#) LAST FROM v$archived_log;
    
       THREAD#       LAST
    ---------- ----------
             1         39
  • 相关阅读:
    BZOJ 2152 聪聪可可
    hdu 1028 && hdu 1398 && hdu 1085 && hdu 1171 ——生成函数
    bzoj 4827 [Hnoi2017]礼物——FFT
    bzoj 4503 两个串——FFT
    bzoj 3527 [Zjoi2014]力——FFT
    bzoj 3160 万径人踪灭——FFT
    bzoj 2194 快速傅立叶之二
    bzoj 2179 FFT快速傅立叶
    洛谷 3803 【模板】多项式乘法(FFT)
    CF 622F The Sum of the k-th Powers——拉格朗日插值
  • 原文地址:https://www.cnblogs.com/tingxin/p/13200480.html
Copyright © 2011-2022 走看看