log_archive_dest_n參數解釋

在dataguard的配置當中,LOG_ARCHIVE_DEST_n參數的配置比較重要,故做下整理

以下是reference中的截圖

wKiom1Yba_vgDW8lAAJpiISrUH4021.jpg

The LOG_ARCHIVE_DEST_n initializationparameter defines up to 31 (where n = 1, 2, 3, ... 31) destinations,each of which must specify either the LOCATION or the SERVICE attribute to specify where toarchive the redo data. All other attributes are optional. Note that whether youare specifying the LOCATIONattribute or the SERVICE attribute, it must be the firstattribute supplied in the list of attributes.

If you choosenot to enter any attributes, then you can specify a NULL string by entering thefollowing:

LOG_ARCHIVE_DEST_n='';

You set theattributes for the LOG_ARCHIVE_DEST_n initialization parameter to control differentaspects of how redo transport services transfer redo data from a production orprimary database destination to another (standby) database destination. You canquery the V$ARCHIVE_DEST view tosee the current attribute settings for each destination (n).

For every LOG_ARCHIVE_DEST_n initialization parameter that you define, you must specify acorresponding LOG_ARCHIVE_DEST_STATE_n parameter. TheLOG_ARCHIVE_DEST_STATE_n (where n is an integer from 1 to 31) initialization parameter specifies whetherthe corresponding destination is currently enabled or disabled.

 

Destinations LOG_ARCHIVE_DEST_11 through LOG_ARCHIVE_DEST_31 do not support the SYNCARCHLOCATIONMANDATORY, or ALTERNATE attributes, and cannot be specified as the target of the ALTERNATE attribute.

LOG_ARCHIVE_DEST_11 through LOG_ARCHIVE_DEST_31 can only be used when the COMPATIBLE initialization parameter is set to 11.2.0 or higher.

 

參數解釋:

1.AFFIRM和NOAFFIRM

AFFIRM明確指定redo傳輸目的地在寫redo數據到standby redo日誌之後告知傳送者接收到了redo數據

NOAFFIRM明確指定redo傳輸目的地在寫redo數據到standby redo日誌之前告知傳送者接收到了redo數據

如果沒有明確指定,當sync屬性被指定時,默認是AFFIRM,當async屬性被指定,默認是NOAFFIRM

2.db_unique_name

這個參數在目的地指定數據庫唯一的名字,如果在DG中有多個standby數據庫,這個屬性有用,使用db_unique_name屬性能明確標識主數據庫和standby數據庫之間的關係。db_unique_name指定的名字必須匹配在DG_CONFIG列表中db_unique_name的其中一個值,db_unique_name屬性指定的名字還必須匹配指定目的地數據庫初始化參數db_unique_name的值,如果不指定,連接會被拒絕。

3.delay

delay參數明確指定一個standby位置應用接收到的歸檔redo數據延遲的時間,delay是可選的,默認是沒有任何延遲,delay屬性的設置表明在standby目的地應用歸檔redo日誌是不活動的,直到指定的時間間隔過期纔會應用日誌,在standby數據庫上,當redo數據庫成功傳輸和歸檔後開始計算時間,delay的時間間隔以分鐘爲單位,可以用於保護standby數據庫免遭、來自主數據庫的用戶錯誤或者損壞帶來的影響,是一種折中方案,在failover過程中必然需要更多的時間來應用日誌。Delay不影響redo時間傳送到standby目的地,如果啓動實時應用,設置的任何延遲都將被忽略。改變delay屬性設置會在下一次redo時間唄歸檔時起作用,正在歸檔的日誌不受影響

4.location和service

每個目的地必須制定location或者service屬性,用來制定redo傳輸服務栓出redo數據到本地磁盤目錄或者遠程數據庫目的地。

log_archive_dest_1—log_archive_dest_10目的地能包括

location屬性或者service屬性

log_archive_dest_11—log_archive_dest_31目的地只能包括

service屬性。

如果要爲log_archive_dest_n初始化參數指定多個屬性,在屬性列表中首先指定location或者service屬性。確保數據庫本地歸檔redo日誌目錄是可訪問的使用location屬性至少指定一個本地磁盤目錄。通過指定location='use_db_recovery_file_dest'

可以指定文件傳輸位置爲閃回恢復區。對應數據庫初始化參數db_recovery_file_dest指定的目錄,oracle通過omf自動管理存儲在閃回恢復區中的文件,在service屬性中必須使用Oracle net服務名

5.SYNC和ASYNC

指定使用同步sync傳輸或者異步async傳輸模式。

log_archive_dest_11—log_archive_dest_31不支持sync屬性,sync屬性表明通過食物生成的redo數據在食物提交之前必須被每個啓用的目的地接收,async屬性表明通過食物生成的redo數據在事務提交之前不需要被目的地接收,如果沒有指定,默認值是async

6.vaild_for

在DG中,Oracle基於數據庫角色和redo日誌類型判斷log_archive_dest_n指定的目錄是否產生相應的歸檔redo日誌,vaild_for屬性可選,Oracle推薦在DG配置中的每個數據庫爲日誌傳輸目的地指定vaild_for屬性,以至於主數據庫角色轉換到配置中的任何standby數據庫之後,redo傳輸都能繼續工作。

爲每個log_archive_dest_n目的地配置valid_for參數

VALID_FOR=(redo_log_type,database_role)

redo_log_type關鍵字表明該目的地產生歸檔的redo日誌類型

online_logfile:目的地只歸檔聯機redo日誌

standby_logfile:目的地只歸檔standbyredo日誌

all_logfiles:目的地既歸檔聯機redo日誌,也歸檔standby redo日誌

database_role表明該目的地產生歸檔的數據庫角色

primary_role:只有數據庫是主,該目的地纔會產生歸檔

standby_role:只有數據庫是備,該目的地纔會產生歸檔

all_role:當數據庫不論是主還是備,該目的地都會產生歸檔

如果目的地沒有指定valid_for屬性,默認情況下,不管數據庫是主還是備,目的地都會歸檔聯機redo和standby redo,默認的行爲等於設置valid_for=(all_logfiles,all_roles)屬性值,在主數據庫和standby數據庫中可以使用相同的初始化參數設置啓用valid_for屬性

例子:

log_archive_dest_1的vaild_for屬性設置爲(online_logfile,all_roles),log_archive_dest_3的vaild_for屬性設置爲(standby_logfile,standby_role),那當該數據庫是主時,只會歸檔聯機日誌到log_archive_dest_1指定的目錄,如果該數據庫被轉換爲備,那standbyredo日誌被歸檔到log_archive_dest_3指定的目錄,log_archive_dest_1不會歸檔standby redo日誌

未完待續。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章