开发同事误删除了一个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;开发