RMAN-08137: 警告: 因为仍需要归档日志, 所以未删除 问题解决

环境:windowsXP oracle11g 开发数据库
情景:用户登录失败,提示只有内部账号才能登陆,
      查看alert文件及trace文件得到下面一些信息
ORA-16014: log 1 sequence# 401 not archived, no available destinations

ORA-19815: WARNING: db_recovery_file_dest_size of 10737418240 bytes is 99.99% used, and has 685568 remaining bytes available.
************************************************************************
You have following choices to free up space from flash recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
过程:
提示比较明显,归档空间不够了,无法归档,而且给出了解决办法,
在sqlplus中 conn / as sysdba可以连接数据库,
查看参数设置
show parameter db_recovery_file_dest -->d:\oracle\flash_recovery_area
dshow parameter db_recovery_file_dest_size -->10G


查看实际目录下却是有很多归档日志沾满了空间,然后手工删除所有的归档日志(因为是开发库),
仍然提示相同的错误,
查看空间:select * from V$FLASH_RECOVERY_AREA_USAGE;
使用率几乎是100%,还剩余200多个文件,靠,不对啊,我已经把文件夹都清空了啊!!

不行就改参数吧,alter system set b_recovery_file_dest_size =20G scope=both;
再查一下空间使用情况:使用率是百分之五十左右,文件数还是200多个,空间好像增大了,


为了保险起见重启了数据库,理论上是不需要重启的因为 scope=both,
终于可以正常启动,哈哈,

再一想,没有解决根本问题啊,还有200多个文件删除不了啊,照这样下去多少空间也不够啊!
google了一把才明白必须用rman删除才行,恍然明白了上面列出的trance文件中的解决方案,
原来这个空间是rman来管理的,只是手工删除操作系统文件还不行,必须通过rman删除,

好,那就用rman删除吧,
命令如下:

crosscheck archivelog all;
返回:对归档日志的验证失败

靠,怎么还失败了!

再执行:delete noprompt expired archivelog all;

返回:RMAN-08137: 警告: 因为仍需要归档日志, 所以未删除

抓狂!!!!!!!

上了趟厕所,继续google,有人说oracle 11g有bug删除归档日志需要用force关键字,赶紧试一下

delete noprompt force archivelog all;
再次查看空间,变成了百分之零点几,文件数也为0,
好使,终于搞定了,苍天呐!!

posted @ 2013-09-17 10:36  wilson.han  阅读(3396)  评论(0编辑  收藏  举报