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

溫馨提示×

溫馨提示×

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

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

oracle 11g dataguard主備切換

發布時間:2020-07-06 12:03:22 來源:網絡 閱讀:3809 作者:z597011036 欄目:關系型數據庫

1.檢查主備的環境

dg1節點:

SQL> archive log list;

Database log mode            Archive Mode

Automatic archival            Enabled

Archive destination           /u01/oradata/tong/archive

Oldest online log sequence      59

Next log sequence to archive     61

Current log sequence           61

SQL> 


dg2節點:

SQL> archive log list;

Database log mode            Archive Mode

Automatic archival            Enabled

Archive destination           /u01/oradata/tong/archive

Oldest online log sequence      60

Next log sequence to archive     0

Current log sequence          61

SQL> 


2.查看主備的角色

dg1節點(primary角色):

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS    DATABASE_ROLE

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

TO STANDBY           PRIMARY

SQL> 


dg2節點(standby角色):

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS    DATABASE_ROLE

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

NOT ALLOWED          PHYSICAL STANDBY

SQL> 


3.在主庫上執行切換命令(primary節點)

SQL> alter database commit to switchover to physical standby; --將primary角色轉換為standby角色

Database altered.

SQL> shutdown immediate              --關閉數據庫,啟動到mount狀態

ORA-01507: database not mounted


ORACLE instance shut down.

SQL> startup mount


Total System Global Area  830930944 bytes

Fixed Size                  2217912 bytes

Variable Size             545261640 bytes

Database Buffers          281018368 bytes

Redo Buffers                2433024 bytes

Database mounted.

SQL> select switchover_status,database_role from v$database;     --查看目前primary角色的狀態

SWITCHOVER_STATUS    DATABASE_ROLE

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

TO PRIMARY           PHYSICAL STANDBY

SQL> 


4.在備庫上執行(standby節點)

SQL> select switchover_status,database_role from v$database;     --查看standby備庫角色的狀態

SWITCHOVER_STATUS    DATABASE_ROLE

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

TO PRIMARY           PHYSICAL STANDBY

SQL> alter database commit to switchover to primary;       --將備庫的角色修改為primary

Database altered.

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS    DATABASE_ROLE

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

NOT ALLOWED          PRIMARY

SQL> alter database open;          --打開數據庫

Database altered.

SQL> 


5.在備庫上執行(standby節點)

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS    DATABASE_ROLE

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

RECOVERY NEEDED      PHYSICAL STANDBY

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;      --修改以前主庫為日志應用

Database altered. 

SQL> 


6.測試主備節點是否切換成功

dg2節點(primary角色):

SQL> select * from tt;

  A

----------

  1

  3

  4

  5

  6

  7

6 rows selected.

SQL> insert into tt values(8);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from tt where a=8;

  A

----------

  8

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> archive log list;

Database log mode         Archive Mode

Automatic archival         Enabled

Archive destination        /u01/oradata/tong/archive

Oldest online log sequence    78

Next log sequence to archive   80

Current log sequence         80

SQL> 


dg1節點(standby角色):

SQL> archive log list;

Database log mode         Archive Mode

Automatic archival         Enabled

Archive destination        /u01/oradata/tong/archive

Oldest online log sequence    79

Next log sequence to archive   0

Current log sequence         80

SQL> alter database  recover managed standby database cancel;  

Database altered.

SQL> alter database open read only;

Database altered.

SQL> select * from tt;

   A

----------

    1

    3

    4

    5

    6

    7

    8

7 rows selected.

SQL> 


向AI問一下細節

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

AI

盐津县| 牡丹江市| 清丰县| 新巴尔虎右旗| 安庆市| 栾川县| 灵寿县| 霍林郭勒市| 灵璧县| 静乐县| 工布江达县| 托克逊县| 陆良县| 竹山县| 辽宁省| 武穴市| 铁岭县| 余江县| 德江县| 崇明县| 宁陵县| 兴义市| 景洪市| 黄大仙区| 左权县| 珲春市| 稻城县| 平远县| 通江县| 桃江县| 桐柏县| 葫芦岛市| 翼城县| 屯门区| 错那县| 乌苏市| 宝兴县| 新郑市| 如皋市| 左贡县| 青浦区|