ora-01122,ora-01110

開發同事誤刪除了一個dbf文件,致使數據庫啓動出錯。數據庫

其實出現這個問題,首先在管理上就有問題,不該該給開發這麼大的權限。oracle

補救方法不少,隨便挑選一個:app

alter database datafile '/u01/app/oracle/oradata/pdf1.dbf' offline ;less

*
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabledide

數據庫未開歸檔,因此不能這麼作,spa

alter database datafile '/u01/app/oracle/oradata/pdf1.dbf' offline drop;orm

 

官方文檔裏這樣說:
DATAFILE Clauses 
The DATAFILE clauses affect your database files as follows: 

ONLINE
Specify ONLINE to bring the datafile online. 

OFFLINE
Specify OFFLINE to take the datafile offline. If the database is open, you must perform media recovery on the datafile before bringing it back online, because a checkpoint is not performed on the datafile before it is taken offline. 

DROP
If the database is in NOARCHIVELOG mode, you must specify the DROP clause to take a datafile offline. However, the DROP clause does not remove the datafile from the database. To do that, you must drop the tablespace in which the datafile resides. Until you do so, the datafile remains in the data dictionary with the status RECOVER or OFFLINE.ci

因此執行了offline drop以後,其實物理的數據文件仍是未刪除,因此這個時候你也不能手動rm-rf刪除,由於別的數據字典還記錄這個數據文件,因此你須要在表空間幾倍刪除他,drop tablespace tbs_name including contexts and datafiles;開發

本站公眾號
   歡迎關注本站公眾號,獲取更多信息