微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ORA-00257 archiver error. 错误的处理方法

 

  方法一:

通常是由于redo log file过大达到大小限制上限导致的
10g认的参数db_recovery_file_dest_size大小是2g
将db_recovery_file_dest_size改大一点就可以了。

由于db_recovery_file_dest会受到db_recovery_file_dest_size参数的限制,
经常发生因归档日志超过db_recovery_file_dest_size的大小而无法归档,或者可以将
参数db_recovery_file_dest设置为空。


sql> show parameter db_recovery_file_dest_size;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest_size           big integer 2G

sql> alter system set db_recovery_file_dest_size = 3g scope = both
  2  ;


方法二:

archive log 日志已满
ORA-00257: archiver error. Connect internal only,until freed 错误的处理方法
1. 用sys用户登录
  sqlplus sys/pass@tt as sysdba
2. 看看archiv log所在位置
sql> show parameter log_archive_dest;
NAME                                     TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest                   string
log_archive_dest_1               string
log_archive_dest_10             string
3. 一般VALUE为空时,可以用archive log list;检查一下归档目录和log sequence
sql> archive log list;
Database log mode                 Archive Mode
Automatic archival                   Enabled
Archive destination                  USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     360
Next log sequence to archive  360
Current log sequence              362
4. 检查flash recovery area的使用情况,可以看见archivelog已经很大了,达到96.62
sql> select * from V$FLASH_RECOVERY_AREA_USAGE;
FILE_TYPE    PERCENT_SPACE_USED PERCENT_SPACE_RECLaimABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE                 .13                        0               1
ONLINELOG                  2.93                        0               3
ARCHIVELOG                96.62                       0              141
BACKUPPIECE                   0                         0               0
IMAGEcopY                      0                         0               0
FLASHBACKLOG                0                         0               0
5. 计算flash recovery area已经占用的空间
sql> select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage;
SUM(PERCENT_SPACE_USED)*3/100
-----------------------------
                       2.9904
                     
6. 找到recovery目录,show parameter recover
sql> show parameter recover;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string           /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size        big integer   5G
recovery_parallelism                   integer         0
                     
7 上述结果告诉我们,归档位置用的是认值,放在flash_recovery_area下(db_recovery_file_dest目录=/u01/app/oracle/flash_recovery_area)
[root@sha3 10.2.0]# echo $ORACLE_BASE
/u01/app/oracle
[root@sha3 10.2.0]# cd $ORACLE_BASE/flash_recovery_area/tt/archivelog
转移或清除对应的归档日志,删除一些不用的日期目录的文件,注意保留最后几个文件(比如360以后的)
---------------------------------------------------------------------------------------
注意:
删除归档日志后,必须用RMAN维护控制文件,否则空间显示仍然不释放。
---------------------------------------------------------------------------------------
8. rman target sys/pass
[root@sha3 oracle]# rman target sys/pass
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Jan 20 01:41:26 2009
copyright (c) 1982,2007, Oracle.  All rights reserved.
connected to target database: tt (DBID=4147983671)
 
9. 检查一些无用的archivelog
RMAN> crosscheck archivelog all;
10. 删除过期的归档
RMAN> delete expired archivelog all;
delete archivelog until time 'sysdate-1' ; 删除截止到前一天的所有archivelog
11. 再次查询,发现使用率正常,已经降到23.03
sql> select * from V$FLASH_RECOVERY_AREA_USAGE;
FILE_TYPE    PERCENT_SPACE_USED PERCENT_SPACE_RECLaimABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE                 .13                         0               1
ONLINELOG                  2.93                         0               3
ARCHIVELOG                23.03                         0              36
BACKUPPIECE                   0                         0               0
IMAGEcopY                     0                         0               0
FLASHBACKLOG                  0                         0               0
其它有用的Command:
----------------------------------
如果archive log模式下不能正常startup,则先恢复成noarchive log,startup成功后,再shutdown;
shutdown immediate;
startup mount;
alter database noarchivelog;
alter database open;
shutdown immediate;
再次startup以archive log模式
shutdown immediate;
startup mount;
show parameter log_archive_dest;
alter database archivelog;
archive log list;               
alter database open;
如果还不行,则删除一些archlog log
sql> select group#,sequence# from v$log;
    GROUP# SEQUENCE#
---------- ----------
         1         62
         3         64
         2         63
原来是日志组一的一个日志不能归档
sql> alter database clear unarchived logfile group 1;
alter database open;
最后,也可以指定位置Arch Log,请按照如下配置
select name from v$datafile;
alter system set log_archive_dest='/opt/app/oracle/oradata/usagedb/arch' scope=spfile
或者修改大小
sql> alter system set db_recovery_file_dest_size=3G scope=both;


方法三:

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐