1.现象,RMAN备份报错没有文件或者路径
RMAN>  backup incremental level 0 database format ‘/backup/inc_0.bak’;

Starting backup at 12-07-05 00:20:38
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/system.dbf
input datafile fno=00004 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/users01.dbf
input datafile fno=00002 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/undotbs01.dbf
input datafile fno=00003 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/sysaux01.dbf
input datafile fno=00007 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/ats001.dbf
input datafile fno=00005 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak.dbf
input datafile fno=00006 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak1.dbf
channel ORA_DISK_1: starting piece 1 at 12-07-05 00:20:38
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/05/2012 00:21:33
ORA-19502: write error on file “/backup/inc_0.bak”, blockno 42625 (blocksize=8192)
ORA-27072: File I/O error
Linux Error: 2: No such file or directory
Additional information: 4
Additional information: 42625
Additional information: 901120
2.查看信息
RMAN> report schema;

Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
—- ——– ——————– ——- ————————
1    340      SYSTEM               ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/system.dbf
2    85       UNDOTBS1             ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/undotbs01.dbf
3    80       SYSAUX               ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/sysaux01.dbf
4    210      USERS                ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/users01.dbf
5    2        HOT_BAK              ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak.dbf
6    1        HOT_BAK              ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak1.dbf
7    10       ATS001               ***     /opt/ora_data/FSXYBAK/datafile/add_disk/test/test/ats001.dbf
可以看到system有340MB,加上其他的估计至少超过当前/目录的337M空间
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             7.3G  6.6G  337M  96% /
/dev/sda1              99M   12M   82M  13% /boot
none                  119M     0  119M   0% /dev/shm
/dev/sdb1             3.0G  2.4G  494M  83% /opt/ora_data/FSXYBAK/datafile/add_disk
空间只剩337M,猜测可能是空间不足
3.验证备份的合理性
RMAN> backup validate database;

Starting backup at 12-07-05 00:31:33
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=144 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/system.dbf
input datafile fno=00004 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/users01.dbf
input datafile fno=00002 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/undotbs01.dbf
input datafile fno=00003 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/sysaux01.dbf
input datafile fno=00007 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/ats001.dbf
input datafile fno=00005 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak.dbf
input datafile fno=00006 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak1.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 12-07-05 00:32:12               —-/验证说明备份没有问题

4.尝试增加硬盘空间处理

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             7.3G  6.4G  534M  93% /
/dev/sda1              99M   12M   82M  13% /boot
none                  119M     0  119M   0% /dev/shm
/dev/sdb1             3.0G  2.4G  494M  83% /opt/ora_data/FSXYBAK/datafile/add_disk
问题解决
RMAN> run{
2> backup incremental level 0 database format ‘/backup/inc_0_%U.bak’;}

Starting backup at 12-07-05 00:34:37
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/system.dbf
input datafile fno=00004 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/users01.dbf
input datafile fno=00002 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/undotbs01.dbf
input datafile fno=00003 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/sysaux01.dbf
input datafile fno=00007 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/ats001.dbf
input datafile fno=00005 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak.dbf
input datafile fno=00006 name=/opt/ora_data/FSXYBAK/datafile/add_disk/test/test/hot_bak1.dbf
channel ORA_DISK_1: starting piece 1 at 12-07-05 00:34:37
channel ORA_DISK_1: finished piece 1 at 12-07-05 00:35:22
piece handle=/backup/inc_0_0gnf9l8t_1_1.bak tag=TAG20120705T003437 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 12-07-05 00:35:24
channel ORA_DISK_1: finished piece 1 at 12-07-05 00:35:25
piece handle=/backup/inc_0_0hnf9lab_1_1.bak tag=TAG20120705T003437 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 12-07-05 00:35:25

 

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             7.3G  6.8G   56M 100% /
/dev/sda1              99M   12M   82M  13% /boot
none                  119M     0  119M   0% /dev/shm

可以看出0级别的增量备份大约有500M的大小

小结:

1)这个案例正常来讲RMAN应该报Space not enough这个错误,即空间不足,而实际上是没有文件或者路径,实际上是有的,这样会产生一种误解

2)可以看出数据库表空间的总和大小,基本和RMAN全备(0 level)差不多小[表空间使用率接近100%]

3)诊断数据库不单纯的从错误信息入手,更重要的需要结合os,network(rac)以及存储等多方面入手,而感觉就来自于对知识面的广度和深度,这个’语感’是需要累积的长期过程。