在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日志

未完待续。。。