前段时间在一个项目中使用到了dataguard,但是因为业务量比较小,在正常的工作状态下日志的切换间隔比较长,如果dg不能很好的应用主库的 日志话,dg也就失去了存在的一样。最后发生oracle已经提我们考虑了此问题,设置一个参数问题就迎刃而解了。这个参数就是 ARCHIVE_LAG_TARGET,强制进行日志切换的。

ARCHIVE_LAG_TARGET参数可以设置一个时间,以秒为单位,通过时间限制,强制数据库进行日志切换,进行归档。

这个参数的缺省值是0,即为不启用该参数。该参数合理的取值范围在60 ~ 7200之间。
通常大于7200和小于1800不被推荐,低于30分钟的切换时间可能导致性能问题。参数的设置语句如下:

alter system set ARCHIVE_LAG_TARGE=1800 scope=both ;

oracle的官方文档关于此参数的介绍如下:

ARCHIVE_LAG_TARGET

PropertyDescription
Parameter typeInteger
Default value0 (disabled)
ModifiableALTER SYSTEM
Range of values0 or any integer in [60, 7200]
BasicNo
Real Application ClustersMultiple instances should use the same value.

ARCHIVE_LAG_TARGET limits the amount of data that can be lost and effectively increases the availability of the standby database by forcing a log switch after the specified amount of time elapses.

A 0 value disables the time-based thread advance feature; otherwise, the value represents the number of seconds. Values larger than 7200 seconds are not of much use in maintaining a reasonable lag in the standby database. The typical, or recommended value is 1800 (30 minutes). Extremely low values can result in frequent log switches, which could degrade performance; such values can also make the archiver process too busy to archive the continuously generated logs.