赞
踩
一、描述
出现ORA-00257错误(空间不足错误),大部分原因是归档日志满了,删除归档日志或者加大存储空间就可以解决。
报错详情:ORA-00257: archiver error. Connect internal only, until freed 。
二、处理方法
sqlplus sys/123456 as sysdba
SQL> show parameter log_archive_dest;
NAME TYPE VALUE
------------------------------------ ----------- -------------
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string
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
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
SQL> select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage;
SUM(PERCENT_SPACE_USED)*3/100
-----------------------------
2.9904
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
[root@sha3 10.2.0]# echo $ORACLE_BASE /u01/app/oracle
[root@sha3 10.2.0]# cd $ORACLE_BASE/flash_recovery_area/tt/archivelog
PS:转移或清除对应的归档日志, 删除一些不用的日期目录的文件,注意保留最后几个文件(比如360以后的);
还需要注意: 在删除归档日志后,必须用RMAN维护控制文件,否则空间显示仍然不释放。
[root@sha3 oracle]# rman target sys/123456
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)
RMAN> crosscheck archivelog all; #检查控制文件和实际物理文件的差别
RMAN> delete expired archivelog all;
# delete expired删除的是那些本来RMAN以为存在但是实际上在磁盘或者磁带上已经被删除了的信息,删除的只是RMAN资料库中的记录
# delete archivelog until time 'sysdate-1' ; 删除截止到前一天的所有archivelog
# delete obsolete则删除旧于备份保留策略定义的备份数据同时也更新RMAN资料库以及控制文件
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;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。