2018年10月29日 星期一

ORA-01115 + ORA-01110 + ORA-27072 錯誤處理

ORA-01115 + ORA-01110 + ORA-27072 錯誤處理
ORACLE TABLE SPACE 移除失敗
因為從作業系統中,已經先將 TABLESPACE DATAFILE 檔案 刪除了 '/oracle/app/oracle/oradata/TBS_AAA_01.dbf'

DROP TABLESPACE TBS_AAA
*
ERROR at line 1:
ORA-01115: IO error reading block from file 16 (block # 1)
ORA-01110: data file 16: '/oracle/app/oracle/oradata/TBS_AAA_01.dbf'
ORA-27072: File I/O error
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4
Additional information: 1

這時候可以用以下指令來移除無效的 DATAFILE
alter database datafile '/oracle/app/oracle/oradata/TBS_AAA_01.dbf'' offline drop;

然後再進行 DROP TABLESPACE
DROP TABLESPACE TBS_AAA INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;

參考文章 https://community.hpe.com/t5/General/No-datafile-can-t-drop-recreate-tablespace/td-p/2868288#.W9bSIEszaUk