以只讀模式開啟物理備庫的時候,遇到ORA-16006錯誤

perfychi發表於2012-12-13

以只讀模式開啟物理備庫的時候,遇到ORA-16006錯誤

SYS|544 SQL> alter database recover managed standby database cancel;

Database altered.

Elapsed: 00:00:03.02
SYS|544 SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-16006: audit_trail destination incompatible with database open mode


Elapsed: 00:00:00.01
SYS|544 SQL> !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|544 SQL> show parameter audit_trail;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_trail                          string      DB, EXTENDED

後來查了一下,發現是主庫設定了審計資料存放到資料庫表這個引數,而備庫引數是從主庫引數修改過來的,現在由於備庫要開啟只讀模式,所以有衝突,那就把審計資訊放倒作業系統目錄下吧。

SYS|544 SQL> alter system set audit_trail='os' scope=spfile;         

System altered.

Elapsed: 00:00:00.01
SYS|544 SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SYS|544 SQL> startup mount;
ORACLE instance started.
Total System Global Area 335544320 bytes
Fixed Size                  1219304 bytes
Variable Size             104858904 bytes
Database Buffers          226492416 bytes
Redo Buffers                2973696 bytes
Database mounted.
SYS|544 SQL> alter database open read only;

Database altered.

Elapsed: 00:00:03.32

只讀模式開啟成功。以後如果這個備庫switchover或failover成主庫的時候,它的審計資訊會放到audit_file_dest引數指定的目錄裡。


SYS|544 SQL> show parameter audit_trail
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_trail                          string      OS
SYS|544 SQL> show parameter audit_file
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/PHYSTDBY
                                                 /adump
SYS|544 SQL> 

看來要注意的細節問題還很多。

--End--

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-751056/,如需轉載,請註明出處,否則將追究法律責任。

相關文章