诗檀软件专业数据库修复团队
oerr ora 1206
01206, 00000, "file is not part of this database - wrong database id"
// *Cause: The database ID in the file header does not match the database id
// in the control file. The file may be from a different database, or
// it may not be a database file at all. If the database was rebuilt,
// this may be a file from before the rebuild. Note that if you see
// this error when the file is supposed to be plugged in from another
// database via the Transportable Tablespace feature, it means the
// database ID in the file header does not match the one expected.
// *Action: Restore a copy of the correct data file and do recovery as needed.
适用于:
Oracle Database - Enterprise Edition – 版本11.2.0.3 及以上
本文信息适用于任何平台。
症状
Flashback database 命令失败,生成错误ORA-01206:
FLASHBACK DATABASE TO RESTORE POINT MY_RESTORE_POINT_1
*
ERROR at line 1:
ORA-01206: file is not part of this database - wrong database id
ORA-01110: data file 65: '+DATA1/orcl/datafile/my_ro_datafile.dbf'
原因
仅对于是只读表空间一部分的数据文件生成错误
使用RMAN duplicate命令,数据库从其他数据库克隆
源数据库曾有Read_only表空间
在RMAN Duplicate时,数据文件头的dbid未更改,因为无法写在数据文件上。
这其实是在之前发行版上报告的bug的修复:
RMAN Duplicate with Read-Only Datafiles fail with: ORA-01122, ORA-01110, and ORA-01206 (Doc ID 1113705.1)
解决方案
对来自之前的resetlogs操作的READONLY 数据文件按需处理。
遇到该问题的客户可以:
恢复到数据库的最近状态:
SQL> startup mount
SQL> alter database datafile 62 offline drop;
SQL> recover database;
SQL> alter database open;
SQL> alter tablespace MY_RO_TABLESPACE online;
或运行flashback 操作:
SQL> startup mount
SQL> alter database datafile 62 offline drop;
SQL> FLASHBACK DATABASE TO RESTORE POINT MY_RESTORE_POINT_1;
SQL> alter database open resetlogs;
SQL> alter tablespace MY_RO_TABLESPACE online;