DG中3種保護模式之間的切換
對於生成當中的資料庫,不同公司不同業務需求或者不同時間,對主庫與備庫的保護模式需求不一樣,
這樣,就需要切換主資料庫與備用資料庫之間的保護模式。以下是模式之間的切換過程。
--檢視主庫的保護模式:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PERFORMANCE TO STANDBY PRIMARY
--檢視備庫的保護模式:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE NOT ALLOWED PHYSICAL STANDBY
----Data Guard三種保護模組式之間的轉換:
--最大效能轉換至最大可用:
--關閉主庫,重啟到mount狀態:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 683674704 bytes
Database Buffers 146800640 bytes
Redo Buffers 2371584 bytes
Database mounted.
--在主庫修改引數資訊:
SQL> alter system set
2 LOG_ARCHIVE_DEST_2='SERVICE=PROD LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PROD';
System altered.
--SQL> alter database set standby database to maximize availability;
Database altered.
--開啟主庫並驗證:
SQL> alter database open;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM AVAILABILITY TO STANDBY PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM AVAILABILITY NOT ALLOWED PHYSICAL STANDBY
備庫也已經把模式改變到最大可用模式。
--將主庫與備庫調至最大保護模式:
--由於最大保護模式與最大可用模式的重做歸檔程式、網路傳輸與磁碟寫選項是一樣的
--所以可以直接更改模式就可以了,不需要先修改引數資訊:
--把主庫與備庫調至最大保護模式:
--直接修改到maximize protection模式:
SQL> alter database set standby database to maximize protection;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PROTECTION TO STANDBY PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PROTECTION NOT ALLOWED PHYSICAL STANDBY
可以看到主庫與備庫都調至到最大保護模式。
--把資料庫重新調至回到最大效能模式:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 687869008 bytes
Database Buffers 142606336 bytes
Redo Buffers 2371584 bytes
Database mounted.
SQL>
SQL> alter system set
2 LOG_ARCHIVE_DEST_2='SERVICE=PROD ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PROD';
System altered.
SQL> alter database set standby database to maximize performance;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE NOT ALLOWED PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE NOT ALLOWED PRIMARY
---最後開啟主庫:
SQL> alter database open;
Database altered.
這樣,就需要切換主資料庫與備用資料庫之間的保護模式。以下是模式之間的切換過程。
--檢視主庫的保護模式:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PERFORMANCE TO STANDBY PRIMARY
--檢視備庫的保護模式:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE NOT ALLOWED PHYSICAL STANDBY
----Data Guard三種保護模組式之間的轉換:
--最大效能轉換至最大可用:
--關閉主庫,重啟到mount狀態:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 683674704 bytes
Database Buffers 146800640 bytes
Redo Buffers 2371584 bytes
Database mounted.
--在主庫修改引數資訊:
SQL> alter system set
2 LOG_ARCHIVE_DEST_2='SERVICE=PROD LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PROD';
System altered.
--SQL> alter database set standby database to maximize availability;
Database altered.
--開啟主庫並驗證:
SQL> alter database open;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM AVAILABILITY TO STANDBY PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM AVAILABILITY NOT ALLOWED PHYSICAL STANDBY
備庫也已經把模式改變到最大可用模式。
--將主庫與備庫調至最大保護模式:
--由於最大保護模式與最大可用模式的重做歸檔程式、網路傳輸與磁碟寫選項是一樣的
--所以可以直接更改模式就可以了,不需要先修改引數資訊:
--把主庫與備庫調至最大保護模式:
--直接修改到maximize protection模式:
SQL> alter database set standby database to maximize protection;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PROTECTION TO STANDBY PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PROTECTION NOT ALLOWED PHYSICAL STANDBY
可以看到主庫與備庫都調至到最大保護模式。
--把資料庫重新調至回到最大效能模式:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 687869008 bytes
Database Buffers 142606336 bytes
Redo Buffers 2371584 bytes
Database mounted.
SQL>
SQL> alter system set
2 LOG_ARCHIVE_DEST_2='SERVICE=PROD ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PROD';
System altered.
SQL> alter database set standby database to maximize performance;
Database altered.
--驗證主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE NOT ALLOWED PRIMARY
--確認備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE NOT ALLOWED PRIMARY
---最後開啟主庫:
SQL> alter database open;
Database altered.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2126846/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【DG】DG的3種保護模式模式
- DataGuard切換保護模式模式
- DG的保護模式模式
- 10g DG保護模式的切換:從最大效能到最大可用模式
- 【DataGuard】Oracle DataGuard 資料保護模式切換Oracle模式
- 【DG】三大模式切換模式
- DG_三大模式切換模式
- Data Guard 的3種資料保護模式模式
- DG學習筆記(7)_保護模式筆記模式
- DG的切換操作
- dataguard三種保護模式模式
- ORACLE10G DG中資料保護模式Oracle模式
- Oracle DG管理模式和只讀模式相互切換Oracle模式
- 單例項DG切換中的虛擬IP單例
- Oracle 歸檔和非歸檔模式之間的切換Oracle模式
- dg切換操作文件
- oracle dg切換操作示例Oracle
- DG保護模式與備用聯機日誌檔案模式
- 【DATAGUARD】物理dg的switchover切換(五)
- Data Guard的三種保護模式(摘自官方文件)模式
- 聊聊Dataguard的三種保護模式實驗(上)模式
- 聊聊Dataguard的三種保護模式實驗(下)模式
- 保護模式模式
- 2013-3-19資料庫DG切換資料庫
- 使用Broker實現DG切換
- Oracle RAC DG手動切換Oracle
- RAC+單例項DG的切換單例
- 【DATAGUARD】物理dg的failover切換(六)AI
- 建立 oracle data gurd 以及三種保護模式Oracle模式
- 探索Oracle11gR2 之 DataGuard_03 三種保護模式Oracle模式
- Windows的保護模式 (轉)Windows模式
- 如何停止iPhone和Mac之間的切換?iPhoneMac
- 單節點DG的switchover切換介紹
- 快速解決cmd中不同盤之間不能切換的問題
- 【DG】Data Guard主備庫Switchover切換
- oracle DG VCS切換異常問題Oracle
- 真實模式和保護模式模式
- 單節點DG的failover切換介紹AI