归档路径alternate参数的困惑
时间:2010-09-27 来源:lovegigi1999
Use the ALTERNATE attribute of the LOG_ARCHIVE_DEST_n parameter to define an alternate archiving destination to be used if archiving to the original archiving destination fails.
An archiving destination can have a maximum of one alternate destination specified. An alternate destination is used when the transmission of an online redo log from the primary site to the standby site fails. If archiving fails and the REOPEN attribute is specified with a value of zero (0), or NOREOPEN is specified, the Oracle database server attempts to archive online redo logs to the alternate destination on the next archival operation.
An alternate destination can reference a local or remote archiving destination. An alternate destination cannot be self-referencing.
A destination can also be in the ALTERNATE state; this state is specified using the LOG_ARCHIVE_DEST_STATE_n initialization parameter. The ALTERNATE state defers processing of the destination until such time as another destination failure automatically enables this destination, if the alternate destination attributes are valid. See Section 5.4 for more details about the LOG_ARCHIVE_DEST_STATE_n parameter.
The ALTERNATE attribute cannot be modified at the session level.
In the following example, if the LOG_ARCHIVE_DEST_1 destination fails, the archiving process automatically switches to the LOG_ARCHIVE_DEST_2 destination.
LOG_ARCHIVE_DEST_1='LOCATION=/disk1 MANDATORY ALTERNATE=LOG_ARCHIVE_DEST_2'SQL> show parameter archive
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_2='LOCATION=/disk2 MANDATORY'
LOG_ARCHIVE_DEST_STATE_2=ALTERNATE
********************************************************************************
以下为我的实验
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
log_archive_dest string
log_archive_dest_1 string location=d:\log_dir ALTERNATE=log_archive_dest_3
log_archive_dest_10 string
log_archive_dest_2 string location=d:\log_dir_bak
log_archive_dest_3 string location=D:\log_dir_alt
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string DEFER
log_archive_dest_state_3 string alternate
移除log_dir
SQL> alter system switch logfile;
System altered.
SQL> @dir_alt
驱动器 D 中的卷是 Work
卷的序列号是 DCC9-8384
D:\ 的目录
找不到文件
驱动器 D 中的卷是 Work
卷的序列号是 DCC9-8384
D:\log_dir_bak 的目录
2010-09-27 14:46 <DIR> .
2010-09-27 14:46 <DIR> ..
2010-09-26 17:18 135,168 ARC00001.001
2010-09-26 17:19 1,024 ARC00002.001
2010-09-26 17:20 2,048 ARC00003.001
2010-09-26 17:22 1,024 ARC00005.001
2010-09-26 17:24 2,560 ARC00007.001
2010-09-26 17:27 1,536 ARC00009.001
2010-09-26 17:34 1,536 ARC00012.001
2010-09-26 17:34 2,560 ARC00013.001
2010-09-27 14:44 1,536 ARC00019.001
2010-09-27 14:44 1,536 ARC00020.001
2010-09-27 14:44 5,632 ARC00021.001
2010-09-27 14:46 2,560 ARC00022.001
12 个文件 158,720 字节
2 个目录 15,691,153,408 可用字节
驱动器 D 中的卷是 Work
卷的序列号是 DCC9-8384
D:\log_dir_alt 的目录
2010-09-27 14:47 <DIR> .
2010-09-27 14:47 <DIR> ..
2010-09-26 17:34 1,536 ARC00012.001
2010-09-26 17:34 2,560 ARC00013.001
2010-09-27 14:46 2,560 ARC00022.001
2010-09-27 14:47 1,536 ARC00023.001
4 个文件 8,192 字节
2 个目录 15,691,153,408 可用字节SQL> host dir d:
驱动器 D 中的卷是 Work
卷的序列号是 DCC9-8384
D:\ 的目录
2010-09-27 15:43 9,728 LOG_DIRARC00029.001
可见当主归档路径失效时,alternate状态路径并没有启用,而是备份到了主路径的上层路径
问题出在哪里呢?