`
chengyue2007
  • 浏览: 1467977 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

ORA-00258: NOARCHIVELOG 模式下的人工存档必须标识日志

 
阅读更多

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
   }

参考链接:http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/img_text/archive_log_clause.htm

6.小结
本文描述的问题根本原因是数据库没有运行在归档模式下,强烈建议重要的数据库运行在归档模式,同时部署可行的备份恢复策略。

Good luck.

secooler
10.04.21

-- The End --

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics