91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

【Data guard】Switchover切換

發布時間:2020-08-11 07:35:06 來源:ITPUB博客 閱讀:141 作者:恩強Boy 欄目:關系型數據庫

主備庫切換操作驗證 switchover

1.   主庫執行切換(A機)

1   查看 主庫狀態

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE    DATABASE_ROLE    SWITCHOVER_STATUS

--------------- -------------------- ---------------- --------------------

bhtc db               READ WRITE             PRIMARY             TO STANDBY

 

2 )主庫執行切換命令

SQL> alter database commit to switchover to physical standby with session shutdown wait;

Database altered.


2 )重啟主庫角色變為備庫( mount 狀態

 

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area 1.3429E+10 bytes

Fixed Size                  2265944 bytes

Variable Size            6878661800 bytes

Database Buffers         6543114240 bytes

Redo Buffers                4612096 bytes

Database mounted.

 

4 )查看 主庫狀態

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE    DATABASE_ROLE    SWITCHOVER_STATUS

--------------- -------------------- ---------------- --------------------

Bhtc db                MOUNTED     PHYSICAL STANDBY      RECOVERY NEEDED  

 

2.   備庫切換成主庫 B 機)

 

1 )查看備庫狀態

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME   OPEN_MODE   DATABASE_ROLE    SWITCHOVER_STATUS

---------------    --------------------     ----------------       --------------------

bhtcdg              MOUNTED          PHYSICAL STANDBY      TO PRIMARY

 

2 )將備庫切換成主庫

 

SQL> alter database commit to switchover to primary with session shutdown  wait ;

Database altered.


3 )查看備庫狀態

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE     DATABASE_ROLE   SWITCHOVER_STATUS

--------------- -------------------- ---------------- --------------------

bhtcdg             MOUNTED           PRIMARY            NOT ALLOWED


4 )開啟

 

SQL> alter database open;

Database altered.

 

SQL>  select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE  DATABASE_ROLE    SWITCHOVER_STAT

--------------- ---------- ---------------- ---------------

bhtcdg         READ WRITE    PRIMARY          RESOLVABLE GAP

 

3.  打開數據庫( A 機)

 

SQL> alter database open read only;

 

4.  應用日志( A 機)

SQL> alter database recover managed standby database using current logfile disconnect from session;

 

3. 驗證數據

1 )在新主庫創建用戶( B 機)

 

SQL> create user test1 identified by test1;

SQL> commit;

 

SQL> alter system switch logfile;

System altered.


2 )在新備庫查看( A 機)

SQL> select username from dba_users where username='TEST1';

 

USERNAME

------------------------------

TEST1

 

 

4. 切換回 最初的狀態

 

(1) 主庫操作( B

SQL> alter database commit to switchover to physical standby with session shutdown;

Database altered.

 

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area 1.3429E+10 bytes

Fixed Size                  2265944 bytes

Variable Size            6878661800 bytes

Database Buffers         6543114240 bytes

Redo Buffers                4612096 bytes

Database mounted.

 

 

(2) 備庫 操作( A 機)

 

SQL> alter database commit to switchover to primary with session shutdown;

Database altered.

 

SQL> alter database open;

Database altered.

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE    DATABASE_ROLE    SWITCHOVER_STATUS

--------------- -------------------- ---------------- --------------------

bhtcdb               READ WRITE            PRIMARY            RESOLVABLE GAP

 

3 B 操作

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME   OPEN_MODE   DATABASE_ROLE    SWITCHOVER_STATUS

-------------------- -------------------- ---------------- --------------------

bhtcdg                MOUNTED      PHYSICAL STANDBY  NOT ALLOWED

 

4 )打開備庫開啟實時同步

 

SQL> alter database open read only;

Database altered.

 

SQL> alter database recover managed standby database using current logfile disconnect;

Database altered.

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE  DATABASE_ROLE    SWITCHOVER_STAT

--------------- ---------- ---------------- ---------------

bhtcdg          READ ONLY  PHYSICAL STANDBY NOT ALLOWED

                WITH APPLY

 

5 )再次查看 A

 

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

 

DB_UNIQUE_NAME  OPEN_MODE    DATABASE_ROLE    SWITCHOVER_STATUS

--------------- -------------------- ---------------- --------------------

bhtc db             READ WRITE            PRIMARY           TO STANDBY

 

此時 ,已經切換回最初的狀態

 

6 )備庫查看日志應用情況

 

SQL> select sequence#,applied from v$archived_log;

 

 SEQUENCE# APPLIED

---------- ---------

         8 YES

         7 YES

         9 YES

        10 YES

        11 YES

        12 YES

        13 YES

        13 YES

        14 YES

        14 YES

        15 YES

 

 SEQUENCE# APPLIED

---------- ---------

        15 YES

        16 YES

        16 YES

        17 YES

        17 NO

        18 YES

        19 YES

        20 YES

        21 IN-MEMORY

 

---------- end ----------

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

页游| 三江| 滨州市| 龙海市| 会昌县| 梁平县| 白银市| 磴口县| 滨州市| 内江市| 上高县| 西充县| 兴仁县| 清丰县| 祥云县| 庆城县| 姚安县| 高州市| 饶河县| 图片| 宁乡县| 信阳市| 广灵县| 广丰县| 桦川县| 疏勒县| 阿勒泰市| 临澧县| 永善县| 达拉特旗| 汤阴县| 兴海县| 佛山市| 竹溪县| 呼图壁县| 错那县| 普格县| 阿鲁科尔沁旗| 安达市| 镇宁| 西吉县|