ora-01122,ora-01110

开发同事误删除了一个dbf文件,导致数据库启动出错。

其实出现这个问题,首先在管理上就有问题,不应该给开发这么大的权限。

补救方法很多,随便挑选一个:

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

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

数据库未开归档,所以不能这么做,

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

 

官方文档里这样说:
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.

所以执行了offline drop之后,其实物理的数据文件还是未删除,所以这个时候你也不能手动rm-rf删除,因为别的数据字典还记录这个数据文件,所以你需要在表空间几倍删除他,drop tablespace tbs_name including contexts and datafiles;

转载于:https://my.oschina.net/u/3862440/blog/2870159

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值