Oracle 19C Data Guard基礎運維-06 PROTECTION MODE

chenoracle發表於2020-04-20

Oracle 19C Data Guard 基礎運維 -06  PROTECTION  MODE  

針對三種Protection Modes ,對應的 Network transmission mode Disk write option 如下,對比了 10g,11g,19C 版本官方文件關於 Protection Modes 描述, 10g 描述的更詳細些。

19C

11g

10g

https://docs.oracle.com/cd/B19306_01/server.102/b14239/log_transport.htm#i1183694

引數說明:

SYNC:

SYNC屬性指定使用同步重做傳輸模式將重做資料傳送到重做傳輸目標。

The SYNC  attribute specifies that the synchronous redo transport mode be used to send redo data to a redo transport destination.

ASYNC:

ASYNC屬性指定使用非同步重做傳輸模式將重做資料傳送到重做傳輸目標。如果未指定SYNC或ASYNC屬性,則使用非同步重做傳輸模式。

The ASYNC  attribute specifies that the asynchronous redo transport mode be used to send redo data to a redo transport destination. The asynchronous redo transport mode is used if neither the SYNC  nor the ASYNC  attribute is specified.

AFFIRM:

指定重做傳輸 目的地 在將接收到的 redo data 寫入 standby redo log 後對其進行確認。

specifies that a redo transport destination acknowledges received redo

data after  writing it to the standby redo log.

NOAFFIRM:

指定重做傳輸 目的地 在將接收到的 redo data 寫入standby redo log 之前 對其進行確認。

specifies that a redo transport destination acknowledges received redo

data before  writing it to the standby redo log.

主庫引數:

SQL> set line 100

SQL> SELECT NAME,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE ,DB_UNIQUE_NAME FROM v$database;

NAME   PROTECTION_MODE      PROTECTION_LEVEL     DATABASE_ROLE    DB_UNIQUE_NAME

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

CJCDB   MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  PRIMARY      chendb

SQL> show parameter log_archive_config

NAME          TYPE  VALUE

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

log_archive_config        string  DG_CONFIG=(chendb,cjcdb)

SQL> show parameter log_archive_dest_1

NAME          TYPE  VALUE

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

log_archive_dest_1   string  LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=chendb    

SQL> show parameter log_archive_dest_2

NAME          TYPE  VALUE

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

log_archive_dest_2    string  SERVICE=cjcdb ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=cjcdb

備庫引數:

SQL> SELECT NAME,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE ,DB_UNIQUE_NAME FROM v$database;

NAME   PROTECTION_MODE      PROTECTION_LEVEL     DATABASE_ROLE    DB_UNIQUE_NAME

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

CJCDB   MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  PHYSICAL STANDBY cjcdb

SQL> show parameter log_archive_config

NAME          TYPE  VALUE

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

log_archive_config    string  DG_CONFIG=(cjcdb,chendb)

SQL> show parameter log_archive_dest_1

NAME          TYPE  VALUE

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

log_archive_dest_1    string  LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=cjcdb      

SQL> show parameter log_archive_dest_2

NAME          TYPE  VALUE

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

log_archive_dest_2    string  SERVICE=chendb ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chendb

更改引數:

---主庫

SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=cjcdb LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=cjcdb';

SQL> shutdown immediate

SQL> startup

---備庫

SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=chendb LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chendb';

SQL> shutdown immediate

SQL> startup

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

------ALTER DATABASE RECOVER  managed standby database using current logfile disconnect from session;

再次檢視引數:

---主庫

SQL> show parameter log_archive_dest_2

NAME          TYPE  VALUE

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

log_archive_dest_2    string  SERVICE=cjcdb LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=cjcdb

---備庫      

SQL> show parameter log_archive_dest_2

NAME          TYPE  VALUE

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

log_archive_dest_2    string  SERVICE=chendb LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chendb

更改保護模式:

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

一:由MAXIMUM PERFORMANCE更改成MAXIMUM AVAILABILITY

主庫:

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;

主庫日誌:

備庫日誌:

檢視包括模式:主庫、備庫

SQL>  SELECT PROTECTION_MODE FROM V$DATABASE;

PROTECTION_MODE

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

MAXIMUM AVAILABILITY

二:由 MAXIMUM AVAILABILITY 更改成MAXIMUM PROTECTION

主庫:

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;

主庫日誌:

備庫日誌:

檢視包括模式:主庫、備庫

SQL> SELECT PROTECTION_MODE FROM V$DATABASE;

PROTECTION_MODE

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

MAXIMUM PROTECTION

三:由 MAXIMUM PROTECTION 更改成MAXIMUM PERFORMANCE

主庫:

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE  PERFORMANCE ;

主庫日誌:

備庫日誌:

檢視包括模式:主庫、備庫

SQL> SELECT PROTECTION_MODE FROM V$DATABASE;

PROTECTION_MODE

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

MAXIMUM PERFORMANCE

歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2687289/,如需轉載,請註明出處,否則將追究法律責任。

相關文章