ORA-16006 audit_trail destination incompatible with database open mode

错误提示
sys@ETMCDB> alter database open read only;

alter database open read only
*
ERROR at line 1:

ORA-16006: audit_trail destination incompatible with database open mode

解决方法
sys@ETMCDB> show parameter audit_trail;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_trail                          string      DB, EXTENDED

sys@ETMCDB> alter system set audit_trail='os' scope=spfile;
System altered.
sys@ETMCDB> shutdown immediate;
sys@ETMCDB> startup mount;
sys@ETMCDB> alter database open read only;
Database altered.

错误原因
sys@ETMCDB> !oerr ora 16006
16006, 00000, "audit_trail destination incompatible with database open mode"
// *Cause:  The audit_trail initialization parameter was set to "DB" (or
//          TRUE), which is incompatible with a database opened for read-only
//          access.
// *Action: When the database is opened for read-only access, the audit_trail
//          initialization parameter can only be set to "OS" or "NONE" (FALSE).
//

sys@ETMCDB> show parameter audit_trail;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_trail                          string      DB, EXTENDED

后来查了一下,发现是主库设置了审计数据存放到数据库表这个参数,而备库参数是从主库参数修改过来的,现在由于备库要打开只读模式,所以有冲突,那就把审计信息放倒操作系统目录下吧。
只读模式打开成功。以后如果这个备库switchover或failover成主库的时候,它的审计信息会放到audit_file_dest参数指定的目录里。 --引用<<以只读模式打开物理备库的时候,遇到ORA-16006错误>>
sys@ETMCDB> show parameter audit_trail
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_trail                          string      OS
sys@ETMCDB> show parameter audit_file
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/ETMCDB/adump

你可能感兴趣的:(database)