1、archive log 归档日志已满处理方法ORA-00257: archiver error. Connect internal only, until freed 错误的处理方法1. 用 sys 用户登录sqlplus sys/passtt as sysdba2. 看看 archiv log 所在位置SQL show parameter log_archive_dest;NAME TYPE VALUE- - -log_archive_dest stringlog_archive_dest_1 stringlog_archive_dest_10 string3. 一般 VALUE 为空时,可
2、以用 archive log list;检查一下归档目录和 log sequenceSQL archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 360Next log sequence to archive 360Current log sequence 3624. 检查 flash recovery area 的使用情况,可以看见 archivelog 已经
3、很大了,达到 96.62SQL select * from V$FLASH_RECOVERY_AREA_USAGE;FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES- - - -CONTROLFILE .13 0 1ONLINELOG 2.93 0 3ARCHIVELOG 96.62 0 141BACKUPPIECE 0 0 0IMAGECOPY 0 0 0FLASHBACKLOG 0 0 05. 计算 flash recovery area 已经占用的空间SQL select sum(percent_
4、space_used)*3/100 from v$flash_recovery_area_usage;SUM(PERCENT_SPACE_USED)*3/100-2.99046. 找到 recovery 目录, show parameter recoverSQL show parameter recover;NAME TYPE VALUE- - -db_recovery_file_dest string /u01/app/oracle/flash_recovery_areadb_recovery_file_dest_size big integer 5Grecovery_parallelism
5、 integer 07 上述结果告诉我们,归档位置用的是默认值,放在 flash_recovery_area 下(db_recovery_file_dest 目录=/u01/app/oracle/flash_recovery_area)rootsha3 10.2.0# echo $ORACLE_BASE/u01/app/oraclerootsha3 10.2.0# cd $ORACLE_BASE/flash_recovery_area/tt/archivelog转移或清除对应的归档日志, 删除一些不用的日期目录的文件,注意保留最后几个文件(比如 360 以后的)-注意: 在删除归档日志后,必须
6、用 RMAN 维护控制文件,否则空间显示仍然不释放。-8. rman target sys/passrootsha3 oracle# rman target sys/passRecovery Manager: Release 10.2.0.4.0 - Production on Tue Jan 20 01:41:26 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: tt (DBID=4147983671)9. 检查一些无用的 archivelogRMAN crossc
7、heck archivelog all;10. 删除过期的归档RMAN delete expired archivelog all; delete archivelog until time sysdate-1 ; 删除截止到前一天的所有 archivelog11. 再次查询,发现使用率正常,已经降到 23.03SQL select * from V$FLASH_RECOVERY_AREA_USAGE;FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES- - - -CONTROLFILE .13 0 1O
8、NLINELOG 2.93 0 3ARCHIVELOG 23.03 0 36BACKUPPIECE 0 0 0IMAGECOPY 0 0 0FLASHBACKLOG 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
9、 模式shutdown immediate;startup mount;show parameter log_archive_dest; alter database archivelog;archive log list; alter database open;如果还不行,则删除一些 archlog logSQL select group#,sequence# from v$log;GROUP# SEQUENCE#- -1 623 642 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;