[20170215]设置log_archive_dest_state_2参数.txt
--//最近一直在测试dg gap的监测与解决问题.
--//经常停止在打开传输并应用日志.一般选择切换日志的模式,alter system archive log current ;或者alter system switch logfile ;
--//实际上也可以通过
--//alter system set log_archive_dest_state_2=defer scope=memory;
--//再执行
--//alter system set log_archive_dest_state_2=enable scope=memory;
--//也可以达到相同的目的,测试说明看看:
1.环境:
SYS@book> @ &r.ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.测试:
SYS@book> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/archivelog/book
Oldest online log sequence 589
Next log sequence to archive 591
Current log sequence 591
--//当前seq=591.
SYS@book> alter system set log_archive_dest_state_2=defer scope=memory;
System altered.
SYS@book> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/archivelog/book
Oldest online log sequence 589
Next log sequence to archive 591
Current log sequence 591
--//当前seq=591.
SYS@book> alter system set log_archive_dest_state_2=enable scope=memory;
System altered.
SYS@book> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/archivelog/book
Oldest online log sequence 590
Next log sequence to archive 592
Current log sequence 592
--//当前seq=592.已经发生了切换.
3.实际上本质还是切换日志来激活传输日志的功能.
--//而是我使用scope=memory;这样不修改spfile参数.
--//另外注意一个细节问题,有一些dba配置log_archive_dest_state_2喜欢配置加实例名,这样上面的命令并不会生效,因为实例名优先.
--//例子:(我个人非常不喜欢这样,如果2个实例参数一样,不建议这样设置使用,维护很乱!!!).
SYS@fyhis> show spparameter log_archive_dest_state_2
SID NAME TYPE VALUE
-------- ----------------------------- ------- ----------------------------
fyxxx1 log_archive_dest_state_2 string ENABLE
fyxxx2 log_archive_dest_state_2 string ENABLE
* log_archive_dest_state_2 string ENABLE
--//这样要加入sid=fyxxx1 才有效.