由于存储空间缘故需要移动表空间MRP_INDEX2的数据文件,如下所示,首先将表空间MRP_INDEX2脱机;
然后复制数据文件;然后重命名文件,最后将表空间联机
在操作过后,最后一步将表空间MRP_INDEX2联机上线时,出现如下错误提示:
SQL> ALTER TABLESPACE MRP_INDEX2 OFFLINE
NORMAL;
Tablespace altered.
SQL> !cp
/u03/flash_recovery_area/oradata/epps/mrp_index2_x01.dbf /u04/epps/oradata/mrp_index2_x01.dbf
SQL> !cp
/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf /u04/epps/oradata/mrp_index2_x02.dbf
SQL> ALTER DATABASE RENAME FILE '/u03/flash_recovery_area/oradata/epps/mrp_index2_x01.dbf'
TO '/u04/epps/oradata/mrp_index2_x01.dbf';
Database altered.
如下所示,在重命名文件时,文件路径弄错了,当时一直没有留言到这个错误,怕耽搁Tablespace联机上线时间。于是先将表空间联机上线
SQL> ALTER DATABASE RENAME FILE
'/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf' TO
'u04/epps/oradata/mrp_index2_x02.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01141: error renaming data file 86 - new file
'u04/epps/oradata/mrp_index2_x02.dbf' not found
ORA-01110: data file 86:
'/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;
Tablespace altered.
检查过后发现了上面脚本错误,于是接着处理,但是将表空间MRP_INDEX2脱机后,没有重新拷贝数据文件过去,直接重命名数据文件(SCN已经改变,导致下面ORA-01113错误),然后表空间联机上线时,出现了下面错误
SQL> ALTER TABLESPACE MRP_INDEX2 OFFLINE
NORMAL;
Tablespace altered.
SQL> ALTER DATABASE RENAME FILE
'/u03/flash_recovery_area/oradata/epps/mrp_index2_x02.dbf' TO
'/u04/epps/oradata/mrp_index2_x02.dbf';
Database altered.
SQL>
SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;
ALTER TABLESPACE MRP_INDEX2 ONLINE
*
ERROR at line 1:
ORA-01113: file 86 needs media recovery
ORA-01110: data file 86:
'/u04/epps/oradata/mrp_index2_x02.dbf'
解决方法:
1:首先将该报错的数据文件脱机
SQL> alter database datafile
'/u04/epps/oradata/mrp_index2_x02.dbf' offline;
Database altered.
2:其次recover这个数据文件
SQL> alter database recover datafile
'/u04/epps/oradata/mrp_index2_x02.dbf';
Database altered.
3:然后将该数据文件联机上线
SQL> alter database datafile
'/u04/epps/oradata/mrp_index2_x02.dbf' online;
Database altered.
4:最后将该表空间MRP_INDEX2联机上线。
SQL> ALTER TABLESPACE MRP_INDEX2 ONLINE ;
该贴被潇湘隐者编辑于2014-10-16 11:43:30
该贴由hui.chen转至本版2014-11-5 16:24:11