ORA-16019 和 ORA-16018 錯誤的處理方法
一. ORA-16019 和 ORA-16018 錯誤產生描述
同事在修改歸檔目錄,一不小心把引數設定錯誤了, 他設定的是log_archive_dest引數。 這個引數和預設log_archive_dest_n 和 DB_RECOVERY_FILE_DEST是衝突的。也就是說, 只能用一個。 先看相關的程式碼來說明這個問題。
SQL> show parameter log_archive_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string /u01/oracle/archive_test/test1
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_2 string
這是同事修改之後的結果,我們來修改一下DB_RECOVERY_FILE_DEST引數:
SQL> alter system set DB_RECOVERY_FILE_DEST='';
alter system set DB_RECOVERY_FILE_DEST=''
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST
報錯,不能修改,在修改log_archive_dest_1 引數:
SQL> alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1";
alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1"
*
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='location=/u01/oracle/archive_test/test1';
alter system set log_archive_dest='location=/u01/oracle/archive_test/test1'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
依舊報錯, 至此,我們不能修改歸檔的任何目錄。 他們他們是不相容的,如果我們在沒有清空其他目錄的條件下來修改,就會造成如上的死鎖。 既誰不能修改誰。 他們之間互相鎖住了。
解決方法:
在這種情況下,我們只能透過修改pfile檔案來刪除掉衝突的引數,在用修改之後的pfile啟動資料庫。
SQL> create pfile from spfile;
File created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
刪除pfile裡的相關衝突引數
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup pfile=?/dbs/initorcl.ora
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 1218968 bytes
Variable Size 109053544 bytes
Database Buffers 167772160 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
二. 關於log_archive_dest, ORA-16019 , ORA-16018 的說明
ORA-16018: cannot use string with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
Cause: One of the following events caused an incompatibility:
1) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when a LOG_ARCHIVE_DEST_n (n = 1...10) parameter was encountered while fetching initialization parameters.
2) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when a LOG_ARCHIVE_DEST_n parameter was encountered while fetching initialization parameters.
3) A LOG_ARCHIVE_DEST_n parameter was in use when an ALTER SYSTEM command was used to define a value for either the LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST parameter.
4) Parameter DB_RECOVERY_FILE_DEST was in use when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST.
Action: Eliminate any incompatible parameter definitions.
ORA-16018: cannot use string with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
Cause: One of the following events caused an incompatibility:
1) Parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST was in use when a LOG_ARCHIVE_DEST_n (n = 1...10) parameter was encountered while fetching initialization parameters.
2) An ALTER SYSTEM ARCHIVE LOG START TO command was in effect when a LOG_ARCHIVE_DEST_n parameter was encountered while fetching initialization parameters.
3) A LOG_ARCHIVE_DEST_n parameter was in use when an ALTER SYSTEM command was used to define a value for either the LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST parameter.
4) Parameter DB_RECOVERY_FILE_DEST was in use when an attempt was made to use an ALTER SYSTEM or ALTER SESSION command to define a value for LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST.
Action: Eliminate any incompatible parameter definitions.
關於log_archive_dest 引數,我們參考Oracle 連線文件:
LOG_ARCHIVE_DEST is applicable only if you are running the database in ARCHIVELOG mode or are recovering a database from archived redo logs. LOG_ARCHIVE_DEST is incompatible with the LOG_ARCHIVE_DEST_n parameters, and must be defined as the null string ("") or (' ') when any LOG_ARCHIVE_DEST_n parameter has a value other than a null string. Use a text string to specify the default location and root of the disk file or tape device when archiving redo log files. (Archiving to tape is not supported on all operating systems. The value cannot be a raw partition.
If LOG_ARCHIVE_DEST is not explicitly defined and all the LOG_ARCHIVE_DEST_n parameters have null string values, LOG_ARCHIVE_DEST is set to an operating system-specific default value on instance startup.
To override the destination that this parameter specifies, either specify a different destination for manual archiving or use the SQL*Plus statement ARCHIVE LOG START filespec for automatic archiving, where filespec is the new archive destination. To permanently change the destination, use the statement ALTER SYSTEM SET LOG_ARCHIVE_DEST = filespec, where filespec is the new archive destination.
Neither LOG_ARCHIVE_DEST nor LOG_ARCHIVE_FORMAT have to be complete file or directory specifiers themselves; they only need to form a valid file path after the variables are substituted into LOG_ARCHIVE_FORMAT and the two parameters are concatenated together.
三. 如何正確設定引數
3.1 如果我們想設定log_archive_dest 這個引數的時候,我們應該如何操作:
3.1.1清空db_recover_file_dest 和 log_archive_dest_n 引數,因為這2個引數和log_archive_dest引數衝突:
SQL> alter system set db_recovery_file_dest='';
System altered.
SQL> alter system set log_archive_dest_1='';
System altered.
3.1.2修改log_archive_dest引數,注意這裡寫的是直接路徑,沒有location選項。 因為我們之前清空了衝突的兩個引數,所以可以隨便修改,不會報錯了。
SQL> alter system set log_archive_dest='/u01/oracle/archive_test/test1';
System altered.
SQL> alter system set log_archive_dest='/u01/oracle/archive_test';
System altered.
SQL> alter system set log_archive_dest='/u01/oracle/archive_test/test1';
System altered.
3.2 如果我們想從log_archive_dest 這個引數 切換回log_archive_dest_1引數,操作也是一樣,
3.2.1 先清空該引數
SQL> alter system set log_archive_dest='';
System altered.
3.2.2 修改相應的log_archive_dest_1引數:
SQL> alter system set log_archive_dest_1="location=/u01/oracle/archive_test/test1";
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST='/u01/oracle/archive_test/test1';
System altered.
轉自tianlesoftware:http://blog.csdn.net/tianlesoftware/article/details/5782655
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29618264/viewspace-2125274/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PHP錯誤處理和異常處理PHP
- namespace mismatch require錯誤處理方法namespaceUI
- 前端的水平線,錯誤處理和除錯前端除錯
- 錯誤處理
- Python錯誤處理和異常處理(二)Python
- php錯誤與異常處理方法PHP
- npm 安裝錯誤及處理方法NPM
- go的錯誤處理Go
- async/await 優雅的錯誤處理方法AI
- 如何在 Go 中優雅的處理和返回錯誤(1)——函式內部的錯誤處理Go函式
- hadoop常見錯誤及處理方法Hadoop
- Oracle RAC 錯誤記錄以及處理方法Oracle
- 六、函式、包和錯誤處理函式
- C++錯誤和異常處理C++
- PHP 錯誤處理PHP
- php錯誤處理PHP
- Go 錯誤處理Go
- Swift錯誤處理Swift
- Zabbix錯誤處理
- mysqldump錯誤處理MySql
- Host is not allowed to connect to this MySQL server 錯誤的處理方法MySqlServer
- Android - Unparsed aapt error(s)錯誤的處理方法AndroidAPTError
- axios 的錯誤處理iOS
- COM的錯誤處理 (轉)
- 錯誤處理:如何通過 error、deferred、panic 等處理錯誤?Error
- Windows ORA-12560錯誤處理方法Windows
- Android中AVD的使用以及錯誤處理方法Android
- ORA-00257 archiver error. 錯誤的處理方法HiveError
- Python錯誤處理Python
- 印表機錯誤無法列印怎麼處理 印表機錯誤不能列印的方法
- 請教 Element 的錯誤處理
- Restful API 中的錯誤處理RESTAPI
- 【譯】RxJava 中的錯誤處理RxJava
- grpc中的錯誤處理RPC
- JavaScript的錯誤簡易處理JavaScript
- 【故障處理】ORA-12162 錯誤的處理
- Python程式設計中一些常見的錯誤和處理方法Python程式設計
- mysql多源複製跳過錯誤處理方法MySql