归档日志目录设置问题(ORA-16019)

11g 版本中,如果归档目录没有设置的话,默认是在$ORACLE_HOME/dbs下;

当然可以设置关于归档的一些参数:log_archive_dest  及log_archive_dest_n

这里需要注意的是log_archive_dest 和 log_archive_dest_n 参数是相排斥的,同时只能用其中的一种;

否则会出现ORA-16019错误;

官方给出的描述及解决方法:

ORA-16019: cannot use string with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST
Cause: One of the following events caused an incompatibility: 1) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when the specified LOG_ARCHIVE_DEST_n (n = 1...31) or DB_RECOVERY_FILE_DEST parameter was encountered while fetching initialization parameters. 2) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for the specified LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST parameter. 3) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when the specified LOG_ARCHIVE_DEST_n parameter was encountered while fetching initialization parameters. 4) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for the specified LOG_ARCHIVE_DEST_n parameter.
Action: Eliminate any incompatible parameter definitions.

实验:

SQL> show parameter log_archive_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest                   string      LOCATION=/u01/app/oracle/checkpoints/

。。。

。。。

。。。


SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/checkpoints/';
alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/checkpoints/'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use LOG_ARCHIVE_DEST_1 with LOG_ARCHIVE_DEST or
LOG_ARCHIVE_DUPLEX_DEST


这时需要把log_archive_dest设置为空

SQL>alter system set log_archive_dest ='';

System altered.

然后在根据需要设置log_archive_dest_n的值,用来并行归档

SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/checkpoints/';

System altered.

SQL> show parameter log_archive_dest_1


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string      LOCATION=/u01/app/oracle/checkpoints/
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
。。。

。。。

。。。



SQL> alter system set log_archive_dest_2='LOCATION=/u01/app/oracle/cold_backup2/';

System altered.

SQL> show parameter log_archive_dest_2


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2                   string      LOCATION=/u01/app/oracle/cold_
                                                 backup2/
log_archive_dest_20                  string
log_archive_dest_21                  string
log_archive_dest_22                  string

。。。

。。。

。。。

这时如果发出归档命令,或者系统自动归档的话,就会在刚才设置的这两个地方同时归档;

但是请注意,如果设置了log_archive_dest_n的值,并且这些位置又出现问题不能用,那么系统在归档的时候就会出现等待,因为指定的归档位置不可用,

直到你修复好指定目录;


OCP相关题库:

Q108. You want to set the following Initialization parametersfor your database Instance

 

LOG_ARCHIVE_DEBT_1 = `LOCATION=/disk1/arch'

 

LOG_ARCHIVE_DBST_2 = `LOCATION=/disk2/arch'

 

LOC_ARCHIVB DBST_3 = `LOCATION=/disk3/arch'

 

LOG_ARCHIVE DBST_ = `LOCATION=/disk3/arch'

 

Identify the statement that correctly describes this setting.

 

A. The MANDATORY location must be a flash recovery area.

B. The optional 可选的destinations 目的地 may not use the flash recovery area.

C. This setting is not allowed because the first destinationis not set as MANDATORY 强制的;.

D. The online redo log file is not allowed to be overwrittenif the archived log cannot be created in the fourth destination.

 

Answer: D


你可能感兴趣的:(ORA-16019)