【問題處理】ORA-00258: NOARCHIVELOG 模式下的人工存檔必須標識日誌

kingsql發表於2014-10-19
1.手工歸檔時報出如下錯誤
sys@orcl> alter system archive log current;
alter system archive log current
*
ERROR at line 1:
ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

2.alert警告日誌中同樣記錄了這個錯誤
Sun Apr 18 14:08:40 2010
Errors in file /oracle/admin/orcl/udump/orcl_ora_25744.trc:
ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

3.關於ORA-00258錯誤的解釋資訊
1)使用oerr工具檢視該錯誤描述
orcl@luckystardb /home/oracle$ oerr ora 258
00258, 00000, "manual archiving in NOARCHIVELOG mode must identify log"
// *Cause: The database is in NOARCHIVELOG mode and a command to manually
//          archive a log did not specify the log explicitly by sequence
//          number, group number or filename.
// *Action: Specify log by filename, by group number or by thread and
//          sequence number.

2)MOS中的描述資訊
OERR: ORA 258 manual archiving in NOARCHIVELOG mode must identify log [ID 18327.1]

Error:  ORA 258
Text:   manual archiving in NOARCHIVELOG mode must identify log
-------------------------------------------------------------------------------
Cause:  An attempt was made to archive a redo log file manually without
        specifying the sequence number, group number, or filename while the
        database was in NOARCHIVELOG mode.
Action: The name, group number, or thread and sequence number of redo log
        files must be specified to archive redo log files manually while the
        database is in NOARCHIVELOG mode.


4.問題處理
1)第一種處理方法
問題原因是資料庫沒有處於歸檔模式,最根本的解決方法是修改資料庫為歸檔模式,具體操作步驟請參見文章《【ARCHIVE】單機環境修改資料庫為非歸檔模式》http://space.itpub.net/519536/viewspace-660184。

2)第二種處理方法(意義不大)
既然錯誤提示“ORA-00258: manual archiving in NOARCHIVELOG mode must identify log”,那我們就可以使用帶有指定日誌組的SQL命令完成歸檔操作。
(1)檢視資料庫的歸檔目錄位置
sys@ora10g> show parameter log_archive_dest_1

NAME                  TYPE    VALUE
--------------------- ----------------------------------------
log_archive_dest_1    string  location=/oracle/arch/ora10g
log_archive_dest_10   string

(2)檢視當前資料庫日誌情況
sys@ora10g> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS   FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- -------- ------------- -------------------
         1          1       1528  209715200          1 NO  CURRENT      476386158 2010-04-20 13:20:13
         2          1       1526  209715200          1 YES INACTIVE     476094078 2010-04-14 16:00:07
         3          1       1527  209715200          1 NO  INACTIVE     476248931 2010-04-17 22:00:54

(3)嘗試歸檔第一組日誌
sys@ora10g> alter system archive log group 1;
alter system archive log group 1
*
ERROR at line 1:
ORA-00259: log 1 of open instance ora10g (thread 1) is the current log, cannot archive

錯誤提示很顯然,當前日誌組不允許歸檔。

(4)嘗試歸檔第二組日誌
sys@ora10g> alter system archive log group 2;
alter system archive log group 2
*
ERROR at line 1:
ORA-16013: log 2 sequence# 1526 does not need archiving

因為歸檔狀態是“YES”,因此該組日誌無需歸檔。

(5)嘗試歸檔第三組之日
sys@ora10g> alter system archive log group 3;

System altered.

歸檔成功。

(6)確認歸檔檔案
sys@ora10g> !ls -l /oracle/arch/ora10g/
total 194652
-rw-r----- 1 oracle oinstall 199121920 Apr 21 06:38 1_1527_688786498.arch

(7)有關手工歸檔操作補充內容
以上我們使用的是資料庫指定的路徑存放手工歸檔生成的檔案,我們還可以指定歸檔寫入的路徑
方法如下
sys@ora10g> alter system archive log group 3 to '/home/oracle';

System altered.

sys@ora10g> !ls -l /home/oracle/1_1527_688786498.arch
-rw-r----- 1 oracle oinstall 199121920 Apr 21 06:45 /home/oracle/1_1527_688786498.arch

5.有關“alter system archive log”命令的語法參考
Oracle 10gR2官方文件中有關歸檔命令用法的參考如下:
ARCHIVE LOG
   [  INSTANCE 'instance_name' ]
   { { SEQUENCE integer
     | CHANGE integer
     | CURRENT [ NOSWITCH ]
     | GROUP integer
     | LOGFILE 'filename'
          [ USING BACKUP CONTROLFILE ]
     | NEXT
     | ALL
     | START
     }
     [ TO 'location' ]
   | STOP
   }

參考連結:

6.小結
本文描述的問題根本原因是資料庫沒有執行在歸檔模式下,強烈建議重要的資料庫執行在歸檔模式,同時部署可行的備份恢復策略。

Good luck.

secooler
10.04.21

-- The End --

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

相關文章