执行全库备份时遇到RMAN-06169的错误错误信息如下:RMAN> BACKUP DATABASE;Starting backup at 03-JUL-15using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=192 device type=DISKRMAN-06169: could not read file header for datafile 6 error reason 4RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of backup command at 07/03/2015 15:46:15RMAN-06056: could not access datafile 6原因分析首先查询下Oracle关于RMAN-06169错误的解释:RMAN-06169: could not read file header for datafile string error reason stringDescription:RMAN-06169 could not read file header for datafile string error reason stringCause:The specified datafile could not be accessed. The reason codes are:1 – file name is missing in the control file2 – file is offline3 – file is not verified4 – DBWR could not find the file5 – unable to open file6 – I/O error during read7 – file header is corrupt8 – file is not a datafile9 – file does not belong to this database10 – file number is incorrect12 – wrong file version15 – control file is not currentAction: If the error can be corrected, do so and retry the operation. The SKIP option can be used to ignore this error during a backup.根据Reason后边的数字码查找对应的问题:4 – DBWR could not find the file。从解释看,应该是数据文件方面的问题,接着查看datafile 6说的是哪个数据文件:SQL> select file#, name,status, enabled from v$datafile where file# = 6; FILE# NAME STATUS ENABLED---------- -------------------------------------------------------------------------------- ------- ---------- 6 E:\APP\TIANPAN\ORADATA\EMP\PART01.DBF OFFLINE READ WRITE查了下发现E:\APP\TIANPAN\ORADATA\EMP目录下压根没有任何数据文件,这才回忆起来这是之前做练习时创建的表空间和数据文件,后来不知道怎么把数据文件给删除了。数据文件删除了,但控制文件中依然记录着有着这么一个数据文件,所以rman备份的时候,会有RMAN-06169: could not read file header for datafile 6 error reason 4的错误提示。解决方法:对我来说,因为这个表空间和数据文件都是测试练习所用,既然数据文件删除了,那就索性把表空间也删除掉再做备份了。如果你有多个数据文件,那么就需要drop多次tablespace了。执行删除表空间命令:SQL> DROP TABLESPACE PART1 INCLUDING CONTENTS AND DATAFILES;Tablespace dropped题外话:当然我在drop tablespace的时候还遇到了另外一个错误 - ORA-14404: partitioned table contains partitions in a different tablespace,为了让文章清晰起见,ORA-14404错误的解决方法还是记录在另外一篇文章《删除表空间时,遇到了ORA-14404错误》中。参考:RMAN06056: could not access datafile 44:https://community.oracle.com/thread/2484322?tstart=0Remove obsolete Datafiles from a Tablespace:http://www.akadia.com/services/ora_remove_datafile.html