在一个新装的库上,做脚本备份的时候遇到了一个错误,先贴出整个LOG内容:
恢复管理器: Release 11.2.0.3.0 - Production on 星期二 1月 2 08:36:40 2018
Copyright © 1982, 2011, Oracle and/or its affiliates. All rights reserved.
已连接到目标数据库: ORCL (DBID=1491089077)
RMAN> RUN {
2> backup device type disk tag ‘%TAG’ database;
3> backup device type disk tag ‘%TAG’ archivelog all not backed up delete all input;
4> ALLOCATE CHANNEL CH1 DEVICE TYPE DISK;
5> ALLOCATE CHANNEL CH2 DEVICE TYPE DISK;
6> delete noprompt obsolete device type disk;
7> RELEASE CHANNEL CH1;
8> RELEASE CHANNEL CH2;
9> }
10> exit
启动 backup 于 02-1月 -18
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=262 设备类型=DISK
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件: 文件号=00004 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
输入数据文件: 文件号=00005 名称=F:\ORADATA\USERS02.DBF
输入数据文件: 文件号=00006 名称=F:\ORADATA\USERS03.DBF
输入数据文件: 文件号=00002 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
输入数据文件: 文件号=00003 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
输入数据文件: 文件号=00001 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
通道 ORA_DISK_1: 正在启动段 1 于 02-1月 -18
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: backup 命令 (ORA_DISK_1 通道上, 在 01/02/2018 08:39:18 上) 失败
ORA-19809: 超出了恢复文件数的限制
ORA-19804: 无法回收 67108864 字节磁盘空间 (从 21474836480 限制中)
恢复管理器完成。
大概内容应该是做备份用的空间不够恢复文件用吧,再去看看alert 日志:
Tue Jan 02 08:42:24 2018
db_recovery_file_dest_size of 6144 MB is 0.15% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Tue Jan 02 08:51:59 2018
Errors in file D:\APP\ADMINISTRATOR\diag\rdbms\orcl\orcl\trace\orcl_ora_4240.trc:
ORA-19815: 警告: db_recovery_file_dest_size 字节 (共 6442450944 字节) 已使用 99.85%, 尚有 9814016 字节可用。 默认归档空间看来是用完了呀!
准备着手解决:
- 查看当前归档的设置情况 show parameter db_recovery_file_dest
- 估算一下备份大概需要多大的空间,改一个合理的参数空间。
- alter system set db_recovery_file_dest_size=500G;
- 重新执行rman备份
备份成功。
故障分析
在使用rman进行数据库全备份时出现ORA-19809: 超出了恢复文件数的限制错误,查报错说明如下:
ORA-19809: limit exceeded for recovery files
Cause: The limit for recovery files specified by the DB_RECOVERY_FILE_DEST_
SIZE was exceeded.
Action: The error is accompanied by 19804. See message 19804 for further details.
在这里我们可以看到,文档明确指出了ORA-19809错误是伴随着ORA-19804出现,接着我们看下ORA-19804的出现原因及解决方案:
ORA-19804: cannot reclaim string bytes disk space from string limit
Cause: Oracle cannot reclaim disk space of specified bytes from the DB_RECOVERY_FILE_DEST_SIZE limit.
Action: There are five possible solutions:
- Take frequent backup of recovery area using RMAN.
- Consider changing RMAN retention policy.
- Consider changing RMAN archivelog deletion policy.
- Add disk space and increase DB_RECOVERY_FILE_DEST_SIZE.
- Delete files from recovery area using RMAN.
以上已经明确给出导致这个错误的原因及五点解决方案
最简单也是最常用的办法就是扩大DB_RECOVERY_FILE_DEST_SIZE的设置