关于无法标识/锁定数据库文件

本文详细介绍了在使用Oracle数据库时遇到数据文件异常情况时,如何通过命令将数据文件离线并删除,以及后续如何将实例恢复正常运行状态的方法。包括离线数据文件的操作步骤和原因分析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天在导库的时候失败了,就把oracle服务给停了,然后把表空间文件给删了.结果在启动实例的时候报了如下错误:

后来通过执行一下查询发现,实例的状态为mounted.

1 SELECT * FROM V$INSTANCE;

没办法,内事不决问百度,发现如下解决办法:

1 alter database datafile 'd:\xx.dbf' offline drop;
2 alter database open;

oracle 官方说明如下:

Altering Datafile Availability

You can alter the availability of individual datafiles or tempfiles by taking them offline or bringing them online. Offline datafiles are unavailable to the database and cannot be accessed until they are brought back online.

Reasons for altering datafile availability include the following:

  • You want to perform an offline backup of a datafile.

  • You want to rename or relocate a datafile. You must first take it offline or take the tablespace offline.

  • The database has problems writing to a datafile and automatically takes the datafile offline. Later, after resolving the problem, you can bring the datafile back online manually.

  • A datafile becomes missing or corrupted. You must take it offline before you can open the database.

Taking Datafiles Offline in NOARCHIVELOG Mode

To take a datafile offline when the database is in NOARCHIVELOG mode, use the ALTER DATABASE statement with both the DATAFILE and OFFLINE FOR DROP clauses.

  • The OFFLINE keyword causes the database to mark the datafile OFFLINE, whether or not it is corrupted, so that you can open the database.

  • The FOR DROP keywords mark the datafile for subsequent dropping. Such a datafile can no longer be brought back online.

The following statement takes the specified datafile offline and marks it to be dropped:

ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/users03.dbf' OFFLINE FOR DROP;

 

转载于:https://www.cnblogs.com/kairui/archive/2013/03/23/ora_01157.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值